Commit 5e25decca83087210d1e20fcccec7144d3cf1e3d

Authored by 陶汉栋
1 parent f79b70be
Exists in master and in 1 other branch cloud_copy

no message

Showing 28 changed files with 0 additions and 3401 deletions   Show diff stats
cloud/weigeng/.gitignore
... ... @@ -1,31 +0,0 @@
1   -HELP.md
2   -target/
3   -!.mvn/wrapper/maven-wrapper.jar
4   -!**/src/main/**
5   -!**/src/test/**
6   -
7   -### STS ###
8   -.apt_generated
9   -.classpath
10   -.factorypath
11   -.project
12   -.settings
13   -.springBeans
14   -.sts4-cache
15   -
16   -### IntelliJ IDEA ###
17   -.idea
18   -*.iws
19   -*.iml
20   -*.ipr
21   -
22   -### NetBeans ###
23   -/nbproject/private/
24   -/nbbuild/
25   -/dist/
26   -/nbdist/
27   -/.nb-gradle/
28   -build/
29   -
30   -### VS Code ###
31   -.vscode/
cloud/weigeng/.mvn/wrapper/MavenWrapperDownloader.java
... ... @@ -1,114 +0,0 @@
1   -/*
2   -Licensed to the Apache Software Foundation (ASF) under one
3   -or more contributor license agreements. See the NOTICE file
4   -distributed with this work for additional information
5   -regarding copyright ownership. The ASF licenses this file
6   -to you under the Apache License, Version 2.0 (the
7   -"License"); you may not use this file except in compliance
8   -with the License. You may obtain a copy of the License at
9   -
10   - https://www.apache.org/licenses/LICENSE-2.0
11   -
12   -Unless required by applicable law or agreed to in writing,
13   -software distributed under the License is distributed on an
14   -"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15   -KIND, either express or implied. See the License for the
16   -specific language governing permissions and limitations
17   -under the License.
18   -*/
19   -
20   -import java.io.File;
21   -import java.io.FileInputStream;
22   -import java.io.FileOutputStream;
23   -import java.io.IOException;
24   -import java.net.URL;
25   -import java.nio.channels.Channels;
26   -import java.nio.channels.ReadableByteChannel;
27   -import java.util.Properties;
28   -
29   -public class MavenWrapperDownloader {
30   -
31   - /**
32   - * Default URL to download the maven-wrapper.jar from, if no 'downloadUrl' is provided.
33   - */
34   - private static final String DEFAULT_DOWNLOAD_URL =
35   - "https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.4.2/maven-wrapper-0.4.2.jar";
36   -
37   - /**
38   - * Path to the maven-wrapper.properties file, which might contain a downloadUrl property to
39   - * use instead of the default one.
40   - */
41   - private static final String MAVEN_WRAPPER_PROPERTIES_PATH =
42   - ".mvn/wrapper/maven-wrapper.properties";
43   -
44   - /**
45   - * Path where the maven-wrapper.jar will be saved to.
46   - */
47   - private static final String MAVEN_WRAPPER_JAR_PATH =
48   - ".mvn/wrapper/maven-wrapper.jar";
49   -
50   - /**
51   - * Name of the property which should be used to override the default download url for the wrapper.
52   - */
53   - private static final String PROPERTY_NAME_WRAPPER_URL = "wrapperUrl";
54   -
55   - public static void main(String args[]) {
56   - System.out.println("- Downloader started");
57   - File baseDirectory = new File(args[0]);
58   - System.out.println("- Using base directory: " + baseDirectory.getAbsolutePath());
59   -
60   - // If the maven-wrapper.properties exists, read it and check if it contains a custom
61   - // wrapperUrl parameter.
62   - File mavenWrapperPropertyFile = new File(baseDirectory, MAVEN_WRAPPER_PROPERTIES_PATH);
63   - String url = DEFAULT_DOWNLOAD_URL;
64   - if (mavenWrapperPropertyFile.exists()) {
65   - FileInputStream mavenWrapperPropertyFileInputStream = null;
66   - try {
67   - mavenWrapperPropertyFileInputStream = new FileInputStream(mavenWrapperPropertyFile);
68   - Properties mavenWrapperProperties = new Properties();
69   - mavenWrapperProperties.load(mavenWrapperPropertyFileInputStream);
70   - url = mavenWrapperProperties.getProperty(PROPERTY_NAME_WRAPPER_URL, url);
71   - } catch (IOException e) {
72   - System.out.println("- ERROR loading '" + MAVEN_WRAPPER_PROPERTIES_PATH + "'");
73   - } finally {
74   - try {
75   - if (mavenWrapperPropertyFileInputStream != null) {
76   - mavenWrapperPropertyFileInputStream.close();
77   - }
78   - } catch (IOException e) {
79   - // Ignore ...
80   - }
81   - }
82   - }
83   - System.out.println("- Downloading from: : " + url);
84   -
85   - File outputFile = new File(baseDirectory.getAbsolutePath(), MAVEN_WRAPPER_JAR_PATH);
86   - if (!outputFile.getParentFile().exists()) {
87   - if (!outputFile.getParentFile().mkdirs()) {
88   - System.out.println(
89   - "- ERROR creating output direcrory '" + outputFile.getParentFile().getAbsolutePath() + "'");
90   - }
91   - }
92   - System.out.println("- Downloading to: " + outputFile.getAbsolutePath());
93   - try {
94   - downloadFileFromURL(url, outputFile);
95   - System.out.println("Done");
96   - System.exit(0);
97   - } catch (Throwable e) {
98   - System.out.println("- Error downloading");
99   - e.printStackTrace();
100   - System.exit(1);
101   - }
102   - }
103   -
104   - private static void downloadFileFromURL(String urlString, File destination) throws Exception {
105   - URL website = new URL(urlString);
106   - ReadableByteChannel rbc;
107   - rbc = Channels.newChannel(website.openStream());
108   - FileOutputStream fos = new FileOutputStream(destination);
109   - fos.getChannel().transferFrom(rbc, 0, Long.MAX_VALUE);
110   - fos.close();
111   - rbc.close();
112   - }
113   -
114   -}
cloud/weigeng/.mvn/wrapper/maven-wrapper.jar
No preview for this file type
cloud/weigeng/.mvn/wrapper/maven-wrapper.properties
... ... @@ -1 +0,0 @@
1   -distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.6.0/apache-maven-3.6.0-bin.zip
cloud/weigeng/libs/sqljdbc4-4.2-6.jar
No preview for this file type
cloud/weigeng/mvnw
... ... @@ -1,286 +0,0 @@
1   -#!/bin/sh
2   -# ----------------------------------------------------------------------------
3   -# Licensed to the Apache Software Foundation (ASF) under one
4   -# or more contributor license agreements. See the NOTICE file
5   -# distributed with this work for additional information
6   -# regarding copyright ownership. The ASF licenses this file
7   -# to you under the Apache License, Version 2.0 (the
8   -# "License"); you may not use this file except in compliance
9   -# with the License. You may obtain a copy of the License at
10   -#
11   -# https://www.apache.org/licenses/LICENSE-2.0
12   -#
13   -# Unless required by applicable law or agreed to in writing,
14   -# software distributed under the License is distributed on an
15   -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16   -# KIND, either express or implied. See the License for the
17   -# specific language governing permissions and limitations
18   -# under the License.
19   -# ----------------------------------------------------------------------------
20   -
21   -# ----------------------------------------------------------------------------
22   -# Maven2 Start Up Batch script
23   -#
24   -# Required ENV vars:
25   -# ------------------
26   -# JAVA_HOME - location of a JDK home dir
27   -#
28   -# Optional ENV vars
29   -# -----------------
30   -# M2_HOME - location of maven2's installed home dir
31   -# MAVEN_OPTS - parameters passed to the Java VM when running Maven
32   -# e.g. to debug Maven itself, use
33   -# set MAVEN_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000
34   -# MAVEN_SKIP_RC - flag to disable loading of mavenrc files
35   -# ----------------------------------------------------------------------------
36   -
37   -if [ -z "$MAVEN_SKIP_RC" ] ; then
38   -
39   - if [ -f /etc/mavenrc ] ; then
40   - . /etc/mavenrc
41   - fi
42   -
43   - if [ -f "$HOME/.mavenrc" ] ; then
44   - . "$HOME/.mavenrc"
45   - fi
46   -
47   -fi
48   -
49   -# OS specific support. $var _must_ be set to either true or false.
50   -cygwin=false;
51   -darwin=false;
52   -mingw=false
53   -case "`uname`" in
54   - CYGWIN*) cygwin=true ;;
55   - MINGW*) mingw=true;;
56   - Darwin*) darwin=true
57   - # Use /usr/libexec/java_home if available, otherwise fall back to /Library/Java/Home
58   - # See https://developer.apple.com/library/mac/qa/qa1170/_index.html
59   - if [ -z "$JAVA_HOME" ]; then
60   - if [ -x "/usr/libexec/java_home" ]; then
61   - export JAVA_HOME="`/usr/libexec/java_home`"
62   - else
63   - export JAVA_HOME="/Library/Java/Home"
64   - fi
65   - fi
66   - ;;
67   -esac
68   -
69   -if [ -z "$JAVA_HOME" ] ; then
70   - if [ -r /etc/gentoo-release ] ; then
71   - JAVA_HOME=`java-config --jre-home`
72   - fi
73   -fi
74   -
75   -if [ -z "$M2_HOME" ] ; then
76   - ## resolve links - $0 may be a link to maven's home
77   - PRG="$0"
78   -
79   - # need this for relative symlinks
80   - while [ -h "$PRG" ] ; do
81   - ls=`ls -ld "$PRG"`
82   - link=`expr "$ls" : '.*-> \(.*\)$'`
83   - if expr "$link" : '/.*' > /dev/null; then
84   - PRG="$link"
85   - else
86   - PRG="`dirname "$PRG"`/$link"
87   - fi
88   - done
89   -
90   - saveddir=`pwd`
91   -
92   - M2_HOME=`dirname "$PRG"`/..
93   -
94   - # make it fully qualified
95   - M2_HOME=`cd "$M2_HOME" && pwd`
96   -
97   - cd "$saveddir"
98   - # echo Using m2 at $M2_HOME
99   -fi
100   -
101   -# For Cygwin, ensure paths are in UNIX format before anything is touched
102   -if $cygwin ; then
103   - [ -n "$M2_HOME" ] &&
104   - M2_HOME=`cygpath --unix "$M2_HOME"`
105   - [ -n "$JAVA_HOME" ] &&
106   - JAVA_HOME=`cygpath --unix "$JAVA_HOME"`
107   - [ -n "$CLASSPATH" ] &&
108   - CLASSPATH=`cygpath --path --unix "$CLASSPATH"`
109   -fi
110   -
111   -# For Mingw, ensure paths are in UNIX format before anything is touched
112   -if $mingw ; then
113   - [ -n "$M2_HOME" ] &&
114   - M2_HOME="`(cd "$M2_HOME"; pwd)`"
115   - [ -n "$JAVA_HOME" ] &&
116   - JAVA_HOME="`(cd "$JAVA_HOME"; pwd)`"
117   - # TODO classpath?
118   -fi
119   -
120   -if [ -z "$JAVA_HOME" ]; then
121   - javaExecutable="`which javac`"
122   - if [ -n "$javaExecutable" ] && ! [ "`expr \"$javaExecutable\" : '\([^ ]*\)'`" = "no" ]; then
123   - # readlink(1) is not available as standard on Solaris 10.
124   - readLink=`which readlink`
125   - if [ ! `expr "$readLink" : '\([^ ]*\)'` = "no" ]; then
126   - if $darwin ; then
127   - javaHome="`dirname \"$javaExecutable\"`"
128   - javaExecutable="`cd \"$javaHome\" && pwd -P`/javac"
129   - else
130   - javaExecutable="`readlink -f \"$javaExecutable\"`"
131   - fi
132   - javaHome="`dirname \"$javaExecutable\"`"
133   - javaHome=`expr "$javaHome" : '\(.*\)/bin'`
134   - JAVA_HOME="$javaHome"
135   - export JAVA_HOME
136   - fi
137   - fi
138   -fi
139   -
140   -if [ -z "$JAVACMD" ] ; then
141   - if [ -n "$JAVA_HOME" ] ; then
142   - if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
143   - # IBM's JDK on AIX uses strange locations for the executables
144   - JAVACMD="$JAVA_HOME/jre/sh/java"
145   - else
146   - JAVACMD="$JAVA_HOME/bin/java"
147   - fi
148   - else
149   - JAVACMD="`which java`"
150   - fi
151   -fi
152   -
153   -if [ ! -x "$JAVACMD" ] ; then
154   - echo "Error: JAVA_HOME is not defined correctly." >&2
155   - echo " We cannot execute $JAVACMD" >&2
156   - exit 1
157   -fi
158   -
159   -if [ -z "$JAVA_HOME" ] ; then
160   - echo "Warning: JAVA_HOME environment variable is not set."
161   -fi
162   -
163   -CLASSWORLDS_LAUNCHER=org.codehaus.plexus.classworlds.launcher.Launcher
164   -
165   -# traverses directory structure from process work directory to filesystem root
166   -# first directory with .mvn subdirectory is considered project base directory
167   -find_maven_basedir() {
168   -
169   - if [ -z "$1" ]
170   - then
171   - echo "Path not specified to find_maven_basedir"
172   - return 1
173   - fi
174   -
175   - basedir="$1"
176   - wdir="$1"
177   - while [ "$wdir" != '/' ] ; do
178   - if [ -d "$wdir"/.mvn ] ; then
179   - basedir=$wdir
180   - break
181   - fi
182   - # workaround for JBEAP-8937 (on Solaris 10/Sparc)
183   - if [ -d "${wdir}" ]; then
184   - wdir=`cd "$wdir/.."; pwd`
185   - fi
186   - # end of workaround
187   - done
188   - echo "${basedir}"
189   -}
190   -
191   -# concatenates all lines of a file
192   -concat_lines() {
193   - if [ -f "$1" ]; then
194   - echo "$(tr -s '\n' ' ' < "$1")"
195   - fi
196   -}
197   -
198   -BASE_DIR=`find_maven_basedir "$(pwd)"`
199   -if [ -z "$BASE_DIR" ]; then
200   - exit 1;
201   -fi
202   -
203   -##########################################################################################
204   -# Extension to allow automatically downloading the maven-wrapper.jar from Maven-central
205   -# This allows using the maven wrapper in projects that prohibit checking in binary data.
206   -##########################################################################################
207   -if [ -r "$BASE_DIR/.mvn/wrapper/maven-wrapper.jar" ]; then
208   - if [ "$MVNW_VERBOSE" = true ]; then
209   - echo "Found .mvn/wrapper/maven-wrapper.jar"
210   - fi
211   -else
212   - if [ "$MVNW_VERBOSE" = true ]; then
213   - echo "Couldn't find .mvn/wrapper/maven-wrapper.jar, downloading it ..."
214   - fi
215   - jarUrl="https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.4.2/maven-wrapper-0.4.2.jar"
216   - while IFS="=" read key value; do
217   - case "$key" in (wrapperUrl) jarUrl="$value"; break ;;
218   - esac
219   - done < "$BASE_DIR/.mvn/wrapper/maven-wrapper.properties"
220   - if [ "$MVNW_VERBOSE" = true ]; then
221   - echo "Downloading from: $jarUrl"
222   - fi
223   - wrapperJarPath="$BASE_DIR/.mvn/wrapper/maven-wrapper.jar"
224   -
225   - if command -v wget > /dev/null; then
226   - if [ "$MVNW_VERBOSE" = true ]; then
227   - echo "Found wget ... using wget"
228   - fi
229   - wget "$jarUrl" -O "$wrapperJarPath"
230   - elif command -v curl > /dev/null; then
231   - if [ "$MVNW_VERBOSE" = true ]; then
232   - echo "Found curl ... using curl"
233   - fi
234   - curl -o "$wrapperJarPath" "$jarUrl"
235   - else
236   - if [ "$MVNW_VERBOSE" = true ]; then
237   - echo "Falling back to using Java to download"
238   - fi
239   - javaClass="$BASE_DIR/.mvn/wrapper/MavenWrapperDownloader.java"
240   - if [ -e "$javaClass" ]; then
241   - if [ ! -e "$BASE_DIR/.mvn/wrapper/MavenWrapperDownloader.class" ]; then
242   - if [ "$MVNW_VERBOSE" = true ]; then
243   - echo " - Compiling MavenWrapperDownloader.java ..."
244   - fi
245   - # Compiling the Java class
246   - ("$JAVA_HOME/bin/javac" "$javaClass")
247   - fi
248   - if [ -e "$BASE_DIR/.mvn/wrapper/MavenWrapperDownloader.class" ]; then
249   - # Running the downloader
250   - if [ "$MVNW_VERBOSE" = true ]; then
251   - echo " - Running MavenWrapperDownloader.java ..."
252   - fi
253   - ("$JAVA_HOME/bin/java" -cp .mvn/wrapper MavenWrapperDownloader "$MAVEN_PROJECTBASEDIR")
254   - fi
255   - fi
256   - fi
257   -fi
258   -##########################################################################################
259   -# End of extension
260   -##########################################################################################
261   -
262   -export MAVEN_PROJECTBASEDIR=${MAVEN_BASEDIR:-"$BASE_DIR"}
263   -if [ "$MVNW_VERBOSE" = true ]; then
264   - echo $MAVEN_PROJECTBASEDIR
265   -fi
266   -MAVEN_OPTS="$(concat_lines "$MAVEN_PROJECTBASEDIR/.mvn/jvm.config") $MAVEN_OPTS"
267   -
268   -# For Cygwin, switch paths to Windows format before running java
269   -if $cygwin; then
270   - [ -n "$M2_HOME" ] &&
271   - M2_HOME=`cygpath --path --windows "$M2_HOME"`
272   - [ -n "$JAVA_HOME" ] &&
273   - JAVA_HOME=`cygpath --path --windows "$JAVA_HOME"`
274   - [ -n "$CLASSPATH" ] &&
275   - CLASSPATH=`cygpath --path --windows "$CLASSPATH"`
276   - [ -n "$MAVEN_PROJECTBASEDIR" ] &&
277   - MAVEN_PROJECTBASEDIR=`cygpath --path --windows "$MAVEN_PROJECTBASEDIR"`
278   -fi
279   -
280   -WRAPPER_LAUNCHER=org.apache.maven.wrapper.MavenWrapperMain
281   -
282   -exec "$JAVACMD" \
283   - $MAVEN_OPTS \
284   - -classpath "$MAVEN_PROJECTBASEDIR/.mvn/wrapper/maven-wrapper.jar" \
285   - "-Dmaven.home=${M2_HOME}" "-Dmaven.multiModuleProjectDirectory=${MAVEN_PROJECTBASEDIR}" \
286   - ${WRAPPER_LAUNCHER} $MAVEN_CONFIG "$@"
cloud/weigeng/mvnw.cmd
... ... @@ -1,161 +0,0 @@
1   -@REM ----------------------------------------------------------------------------
2   -@REM Licensed to the Apache Software Foundation (ASF) under one
3   -@REM or more contributor license agreements. See the NOTICE file
4   -@REM distributed with this work for additional information
5   -@REM regarding copyright ownership. The ASF licenses this file
6   -@REM to you under the Apache License, Version 2.0 (the
7   -@REM "License"); you may not use this file except in compliance
8   -@REM with the License. You may obtain a copy of the License at
9   -@REM
10   -@REM https://www.apache.org/licenses/LICENSE-2.0
11   -@REM
12   -@REM Unless required by applicable law or agreed to in writing,
13   -@REM software distributed under the License is distributed on an
14   -@REM "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15   -@REM KIND, either express or implied. See the License for the
16   -@REM specific language governing permissions and limitations
17   -@REM under the License.
18   -@REM ----------------------------------------------------------------------------
19   -
20   -@REM ----------------------------------------------------------------------------
21   -@REM Maven2 Start Up Batch script
22   -@REM
23   -@REM Required ENV vars:
24   -@REM JAVA_HOME - location of a JDK home dir
25   -@REM
26   -@REM Optional ENV vars
27   -@REM M2_HOME - location of maven2's installed home dir
28   -@REM MAVEN_BATCH_ECHO - set to 'on' to enable the echoing of the batch commands
29   -@REM MAVEN_BATCH_PAUSE - set to 'on' to wait for a key stroke before ending
30   -@REM MAVEN_OPTS - parameters passed to the Java VM when running Maven
31   -@REM e.g. to debug Maven itself, use
32   -@REM set MAVEN_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000
33   -@REM MAVEN_SKIP_RC - flag to disable loading of mavenrc files
34   -@REM ----------------------------------------------------------------------------
35   -
36   -@REM Begin all REM lines with '@' in case MAVEN_BATCH_ECHO is 'on'
37   -@echo off
38   -@REM set title of command window
39   -title %0
40   -@REM enable echoing my setting MAVEN_BATCH_ECHO to 'on'
41   -@if "%MAVEN_BATCH_ECHO%" == "on" echo %MAVEN_BATCH_ECHO%
42   -
43   -@REM set %HOME% to equivalent of $HOME
44   -if "%HOME%" == "" (set "HOME=%HOMEDRIVE%%HOMEPATH%")
45   -
46   -@REM Execute a user defined script before this one
47   -if not "%MAVEN_SKIP_RC%" == "" goto skipRcPre
48   -@REM check for pre script, once with legacy .bat ending and once with .cmd ending
49   -if exist "%HOME%\mavenrc_pre.bat" call "%HOME%\mavenrc_pre.bat"
50   -if exist "%HOME%\mavenrc_pre.cmd" call "%HOME%\mavenrc_pre.cmd"
51   -:skipRcPre
52   -
53   -@setlocal
54   -
55   -set ERROR_CODE=0
56   -
57   -@REM To isolate internal variables from possible post scripts, we use another setlocal
58   -@setlocal
59   -
60   -@REM ==== START VALIDATION ====
61   -if not "%JAVA_HOME%" == "" goto OkJHome
62   -
63   -echo.
64   -echo Error: JAVA_HOME not found in your environment. >&2
65   -echo Please set the JAVA_HOME variable in your environment to match the >&2
66   -echo location of your Java installation. >&2
67   -echo.
68   -goto error
69   -
70   -:OkJHome
71   -if exist "%JAVA_HOME%\bin\java.exe" goto init
72   -
73   -echo.
74   -echo Error: JAVA_HOME is set to an invalid directory. >&2
75   -echo JAVA_HOME = "%JAVA_HOME%" >&2
76   -echo Please set the JAVA_HOME variable in your environment to match the >&2
77   -echo location of your Java installation. >&2
78   -echo.
79   -goto error
80   -
81   -@REM ==== END VALIDATION ====
82   -
83   -:init
84   -
85   -@REM Find the project base dir, i.e. the directory that contains the folder ".mvn".
86   -@REM Fallback to current working directory if not found.
87   -
88   -set MAVEN_PROJECTBASEDIR=%MAVEN_BASEDIR%
89   -IF NOT "%MAVEN_PROJECTBASEDIR%"=="" goto endDetectBaseDir
90   -
91   -set EXEC_DIR=%CD%
92   -set WDIR=%EXEC_DIR%
93   -:findBaseDir
94   -IF EXIST "%WDIR%"\.mvn goto baseDirFound
95   -cd ..
96   -IF "%WDIR%"=="%CD%" goto baseDirNotFound
97   -set WDIR=%CD%
98   -goto findBaseDir
99   -
100   -:baseDirFound
101   -set MAVEN_PROJECTBASEDIR=%WDIR%
102   -cd "%EXEC_DIR%"
103   -goto endDetectBaseDir
104   -
105   -:baseDirNotFound
106   -set MAVEN_PROJECTBASEDIR=%EXEC_DIR%
107   -cd "%EXEC_DIR%"
108   -
109   -:endDetectBaseDir
110   -
111   -IF NOT EXIST "%MAVEN_PROJECTBASEDIR%\.mvn\jvm.config" goto endReadAdditionalConfig
112   -
113   -@setlocal EnableExtensions EnableDelayedExpansion
114   -for /F "usebackq delims=" %%a in ("%MAVEN_PROJECTBASEDIR%\.mvn\jvm.config") do set JVM_CONFIG_MAVEN_PROPS=!JVM_CONFIG_MAVEN_PROPS! %%a
115   -@endlocal & set JVM_CONFIG_MAVEN_PROPS=%JVM_CONFIG_MAVEN_PROPS%
116   -
117   -:endReadAdditionalConfig
118   -
119   -SET MAVEN_JAVA_EXE="%JAVA_HOME%\bin\java.exe"
120   -set WRAPPER_JAR="%MAVEN_PROJECTBASEDIR%\.mvn\wrapper\maven-wrapper.jar"
121   -set WRAPPER_LAUNCHER=org.apache.maven.wrapper.MavenWrapperMain
122   -
123   -set DOWNLOAD_URL="https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.4.2/maven-wrapper-0.4.2.jar"
124   -FOR /F "tokens=1,2 delims==" %%A IN (%MAVEN_PROJECTBASEDIR%\.mvn\wrapper\maven-wrapper.properties) DO (
125   - IF "%%A"=="wrapperUrl" SET DOWNLOAD_URL=%%B
126   -)
127   -
128   -@REM Extension to allow automatically downloading the maven-wrapper.jar from Maven-central
129   -@REM This allows using the maven wrapper in projects that prohibit checking in binary data.
130   -if exist %WRAPPER_JAR% (
131   - echo Found %WRAPPER_JAR%
132   -) else (
133   - echo Couldn't find %WRAPPER_JAR%, downloading it ...
134   - echo Downloading from: %DOWNLOAD_URL%
135   - powershell -Command "(New-Object Net.WebClient).DownloadFile('%DOWNLOAD_URL%', '%WRAPPER_JAR%')"
136   - echo Finished downloading %WRAPPER_JAR%
137   -)
138   -@REM End of extension
139   -
140   -%MAVEN_JAVA_EXE% %JVM_CONFIG_MAVEN_PROPS% %MAVEN_OPTS% %MAVEN_DEBUG_OPTS% -classpath %WRAPPER_JAR% "-Dmaven.multiModuleProjectDirectory=%MAVEN_PROJECTBASEDIR%" %WRAPPER_LAUNCHER% %MAVEN_CONFIG% %*
141   -if ERRORLEVEL 1 goto error
142   -goto end
143   -
144   -:error
145   -set ERROR_CODE=1
146   -
147   -:end
148   -@endlocal & set ERROR_CODE=%ERROR_CODE%
149   -
150   -if not "%MAVEN_SKIP_RC%" == "" goto skipRcPost
151   -@REM check for post script, once with legacy .bat ending and once with .cmd ending
152   -if exist "%HOME%\mavenrc_post.bat" call "%HOME%\mavenrc_post.bat"
153   -if exist "%HOME%\mavenrc_post.cmd" call "%HOME%\mavenrc_post.cmd"
154   -:skipRcPost
155   -
156   -@REM pause the script if MAVEN_BATCH_PAUSE is set to 'on'
157   -if "%MAVEN_BATCH_PAUSE%" == "on" pause
158   -
159   -if "%MAVEN_TERMINATE_CMD%" == "on" exit %ERROR_CODE%
160   -
161   -exit /B %ERROR_CODE%
cloud/weigeng/pom.xml
... ... @@ -1,97 +0,0 @@
1   -<?xml version="1.0" encoding="UTF-8"?>
2   -<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
3   - xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
4   - <modelVersion>4.0.0</modelVersion>
5   - <parent>
6   - <groupId>org.springframework.boot</groupId>
7   - <artifactId>spring-boot-starter-parent</artifactId>
8   - <version>2.1.8.RELEASE</version>
9   - <relativePath/> <!-- lookup parent from repository -->
10   - </parent>
11   - <groupId>com.sincere</groupId>
12   - <artifactId>weigeng</artifactId>
13   - <version>0.0.1</version>
14   - <name>weigeng</name>
15   - <description>Demo project for Spring Boot</description>
16   -
17   - <properties>
18   - <java.version>1.8</java.version>
19   - <spring-cloud.version>Greenwich.SR2</spring-cloud.version>
20   - </properties>
21   -
22   - <dependencies>
23   - <dependency>
24   - <groupId>org.springframework.boot</groupId>
25   - <artifactId>spring-boot-starter-web</artifactId>
26   - </dependency>
27   -
28   - <dependency>
29   - <groupId>org.springframework.cloud</groupId>
30   - <artifactId>spring-cloud-starter-netflix-eureka-server</artifactId>
31   - </dependency>
32   -
33   - <dependency>
34   - <groupId>com.baidu.aip</groupId>
35   - <artifactId>java-sdk</artifactId>
36   - <version>4.10.0</version>
37   - </dependency>
38   -
39   - <dependency>
40   - <groupId>com.microsoft.sqlserver.jdbc</groupId>
41   - <artifactId>sqljdbc</artifactId>
42   - <scope>system</scope>
43   - <version>1</version>
44   - <systemPath>${project.basedir}/libs/sqljdbc4-4.2-6.jar</systemPath>
45   - </dependency>
46   -
47   - <dependency>
48   - <groupId>org.mybatis.spring.boot</groupId>
49   - <artifactId>mybatis-spring-boot-starter</artifactId>
50   - <version>2.0.1</version>
51   - </dependency>
52   -
53   - <dependency>
54   - <groupId>com.drewnoakes</groupId>
55   - <artifactId>metadata-extractor</artifactId>
56   - <version>2.4.0-beta-1</version>
57   - </dependency>
58   -
59   - <dependency>
60   - <groupId>org.apache.poi</groupId>
61   - <artifactId>poi</artifactId>
62   - <version>4.1.0</version>
63   - </dependency>
64   -
65   - <dependency>
66   - <groupId>org.springframework.boot</groupId>
67   - <artifactId>spring-boot-starter-test</artifactId>
68   - <scope>test</scope>
69   - </dependency>
70   - </dependencies>
71   -
72   - <dependencyManagement>
73   - <dependencies>
74   - <dependency>
75   - <groupId>org.springframework.cloud</groupId>
76   - <artifactId>spring-cloud-dependencies</artifactId>
77   - <version>${spring-cloud.version}</version>
78   - <type>pom</type>
79   - <scope>import</scope>
80   - </dependency>
81   - </dependencies>
82   - </dependencyManagement>
83   -
84   - <build>
85   - <plugins>
86   - <plugin>
87   - <groupId>org.springframework.boot</groupId>
88   - <artifactId>spring-boot-maven-plugin</artifactId>
89   - <configuration>
90   - <includeSystemScope>true</includeSystemScope>
91   - </configuration>
92   - </plugin>
93   -
94   - </plugins>
95   - </build>
96   -
97   -</project>
cloud/weigeng/src/main/java/com/sincere/weigeng/AuthService.java
... ... @@ -1,86 +0,0 @@
1   -package com.sincere.weigeng;
2   -
3   -import org.json.JSONObject;
4   -
5   -import java.io.BufferedReader;
6   -import java.io.InputStreamReader;
7   -import java.net.HttpURLConnection;
8   -import java.net.URL;
9   -import java.util.List;
10   -import java.util.Map;
11   -
12   -/**
13   - * 获取token类
14   - */
15   -public class AuthService {
16   - //设置APPID/AK/SK
17   - public static final String APP_ID = "15990462";
18   - public static final String API_KEY = "t70Rzr6SGmfU9S6MrqAkspsY";
19   - public static final String SECRET_KEY = "nSqpqtrf7cCjo8vOB9knL85nwWNoxwvS ";
20   - /**
21   - * 获取权限token
22   - * @return 返回示例:
23   - * {
24   - * "access_token": "24.460da4889caad24cccdb1fea17221975.2592000.1491995545.282335-1234567",
25   - * "expires_in": 2592000
26   - * }
27   - */
28   - public static String getAuth() {
29   - // 官网获取的 API Key 更新为你注册的
30   - String clientId = "t70Rzr6SGmfU9S6MrqAkspsY";
31   - // 官网获取的 Secret Key 更新为你注册的
32   - String clientSecret = "nSqpqtrf7cCjo8vOB9knL85nwWNoxwvS";
33   - return getAuth(clientId, clientSecret);
34   - }
35   -
36   - /**
37   - * 获取API访问token
38   - * 该token有一定的有效期,需要自行管理,当失效时需重新获取.
39   - * @param ak - 百度云官网获取的 API Key
40   - * @param sk - 百度云官网获取的 Securet Key
41   - * @return assess_token 示例:
42   - * "24.460da4889caad24cccdb1fea17221975.2592000.1491995545.282335-1234567"
43   - */
44   - public static String getAuth(String ak, String sk) {
45   - // 获取token地址
46   - String authHost = "https://aip.baidubce.com/oauth/2.0/token?";
47   - String getAccessTokenUrl = authHost
48   - // 1. grant_type为固定参数
49   - + "grant_type=client_credentials"
50   - // 2. 官网获取的 API Key
51   - + "&client_id=" + ak
52   - // 3. 官网获取的 Secret Key
53   - + "&client_secret=" + sk;
54   - try {
55   - URL realUrl = new URL(getAccessTokenUrl);
56   - // 打开和URL之间的连接
57   - HttpURLConnection connection = (HttpURLConnection) realUrl.openConnection();
58   - connection.setRequestMethod("GET");
59   - connection.connect();
60   - // 获取所有响应头字段
61   - Map<String, List<String>> map = connection.getHeaderFields();
62   - // 遍历所有的响应头字段
63   - for (String key : map.keySet()) {
64   - System.err.println(key + "--->" + map.get(key));
65   - }
66   - // 定义 BufferedReader输入流来读取URL的响应
67   - BufferedReader in = new BufferedReader(new InputStreamReader(connection.getInputStream()));
68   - String result = "";
69   - String line;
70   - while ((line = in.readLine()) != null) {
71   - result += line;
72   - }
73   - /**
74   - * 返回结果示例
75   - */
76   - System.err.println("result:" + result);
77   - JSONObject jsonObject = new JSONObject(result);
78   - String access_token = jsonObject.getString("access_token");
79   - return access_token;
80   - } catch (Exception e) {
81   - System.err.printf("获取token失败!");
82   - e.printStackTrace(System.err);
83   - }
84   - return null;
85   - }
86   -}
cloud/weigeng/src/main/java/com/sincere/weigeng/HomeBean.java
... ... @@ -1,33 +0,0 @@
1   -package com.sincere.weigeng;
2   -
3   -public class HomeBean {
4   -
5   - private String CreatorUserId;
6   -
7   - private String Title;
8   -
9   -
10   - public String getCreatorUserId() {
11   - return CreatorUserId;
12   - }
13   -
14   - public void setCreatorUserId(String creatorUserId) {
15   - CreatorUserId = creatorUserId;
16   - }
17   -
18   - public String getTitle() {
19   - return Title;
20   - }
21   -
22   - public void setTitle(String title) {
23   - Title = title;
24   - }
25   -
26   - @Override
27   - public String toString() {
28   - return "HomeBean{" +
29   - "CreatorUserId='" + CreatorUserId + '\'' +
30   - ", Title='" + Title + '\'' +
31   - '}';
32   - }
33   -}
cloud/weigeng/src/main/java/com/sincere/weigeng/Homework.java
... ... @@ -1,189 +0,0 @@
1   -package com.sincere.weigeng;
2   -
3   -import java.io.Serializable;
4   -
5   -public class Homework implements Serializable {
6   -
7   - private String ID;
8   -
9   - private String CreatorUserId;
10   -
11   - private String PaperId;
12   -
13   - private String Title;
14   -
15   - private int SuggestionTime;
16   -
17   - private String Deadline;
18   -
19   - private int State;
20   -
21   - private String Intime;
22   -
23   - private int SubjectId;
24   -
25   - private int PublishAnswerType;
26   -
27   - private int IsPigai;
28   -
29   - private String StartTime;
30   -
31   - private int TypeId;
32   -
33   - private String QuestionIds;
34   -
35   - private int HomeworkType;
36   -
37   - private int PkgId;
38   -
39   - public String getCreatorUserId() {
40   - return CreatorUserId;
41   - }
42   -
43   - public void setCreatorUserId(String creatorUserId) {
44   - CreatorUserId = creatorUserId;
45   - }
46   -
47   - public String getPaperId() {
48   - return PaperId;
49   - }
50   -
51   - public String getID() {
52   - return ID;
53   - }
54   -
55   - public void setID(String ID) {
56   - this.ID = ID;
57   - }
58   -
59   - @Override
60   - public String toString() {
61   - return "Homework{" +
62   - "ID='" + ID + '\'' +
63   - ", CreatorUserId='" + CreatorUserId + '\'' +
64   - ", PaperId='" + PaperId + '\'' +
65   - ", Title='" + Title + '\'' +
66   - ", SuggestionTime=" + SuggestionTime +
67   - ", Deadline='" + Deadline + '\'' +
68   - ", State=" + State +
69   - ", Intime='" + Intime + '\'' +
70   - ", SubjectId=" + SubjectId +
71   - ", PublishAnswerType=" + PublishAnswerType +
72   - ", IsPigai=" + IsPigai +
73   - ", StartTime='" + StartTime + '\'' +
74   - ", TypeId=" + TypeId +
75   - ", QuestionIds='" + QuestionIds + '\'' +
76   - ", HomeworkType=" + HomeworkType +
77   - ", PkgId=" + PkgId +
78   - '}';
79   - }
80   -
81   - public void setPaperId(String paperId) {
82   - PaperId = paperId;
83   - }
84   -
85   - public String getTitle() {
86   - return Title;
87   - }
88   -
89   - public void setTitle(String title) {
90   - Title = title;
91   - }
92   -
93   - public int getSuggestionTime() {
94   - return SuggestionTime;
95   - }
96   -
97   - public void setSuggestionTime(int suggestionTime) {
98   - SuggestionTime = suggestionTime;
99   - }
100   -
101   - public String getDeadline() {
102   - return Deadline;
103   - }
104   -
105   - public void setDeadline(String deadline) {
106   - Deadline = deadline;
107   - }
108   -
109   - public int getState() {
110   - return State;
111   - }
112   -
113   - public void setState(int state) {
114   - State = state;
115   - }
116   -
117   - public String getIntime() {
118   - return Intime;
119   - }
120   -
121   - public void setIntime(String intime) {
122   - Intime = intime;
123   - }
124   -
125   - public int getSubjectId() {
126   - return SubjectId;
127   - }
128   -
129   - public void setSubjectId(int subjectId) {
130   - SubjectId = subjectId;
131   - }
132   -
133   - public int getPublishAnswerType() {
134   - return PublishAnswerType;
135   - }
136   -
137   - public void setPublishAnswerType(int publishAnswerType) {
138   - PublishAnswerType = publishAnswerType;
139   - }
140   -
141   - public int getIsPigai() {
142   - return IsPigai;
143   - }
144   -
145   - public void setIsPigai(int isPigai) {
146   - IsPigai = isPigai;
147   - }
148   -
149   - public String getStartTime() {
150   - return StartTime;
151   - }
152   -
153   - public void setStartTime(String startTime) {
154   - StartTime = startTime;
155   - }
156   -
157   - public int getTypeId() {
158   - return TypeId;
159   - }
160   -
161   - public void setTypeId(int typeId) {
162   - TypeId = typeId;
163   - }
164   -
165   - public String getQuestionIds() {
166   - return QuestionIds;
167   - }
168   -
169   - public void setQuestionIds(String questionIds) {
170   - QuestionIds = questionIds;
171   - }
172   -
173   - public int getHomeworkType() {
174   - return HomeworkType;
175   - }
176   -
177   - public void setHomeworkType(int homeworkType) {
178   - HomeworkType = homeworkType;
179   - }
180   -
181   - public int getPkgId() {
182   - return PkgId;
183   - }
184   -
185   - public void setPkgId(int pkgId) {
186   - PkgId = pkgId;
187   - }
188   -
189   -}
cloud/weigeng/src/main/java/com/sincere/weigeng/HomeworkReceive.java
... ... @@ -1,34 +0,0 @@
1   -package com.sincere.weigeng;
2   -
3   -import java.io.Serializable;
4   -
5   -public class HomeworkReceive implements Serializable {
6   -
7   - private String StudentId;
8   -
9   - private String StudnetAnswerIds;
10   -
11   - public String getStudentId() {
12   - return StudentId;
13   - }
14   -
15   - public void setStudentId(String studentId) {
16   - StudentId = studentId;
17   - }
18   -
19   - public String getStudnetAnswerIds() {
20   - return StudnetAnswerIds;
21   - }
22   -
23   - public void setStudnetAnswerIds(String studnetAnswerIds) {
24   - StudnetAnswerIds = studnetAnswerIds;
25   - }
26   -
27   - @Override
28   - public String toString() {
29   - return "HomeworkReceive{" +
30   - "StudentId='" + StudentId + '\'' +
31   - ", StudnetAnswerIds='" + StudnetAnswerIds + '\'' +
32   - '}';
33   - }
34   -}
cloud/weigeng/src/main/java/com/sincere/weigeng/ImageUtils.java
... ... @@ -1,168 +0,0 @@
1   -package com.sincere.weigeng;
2   -
3   -import com.drew.imaging.ImageMetadataReader;
4   -import com.drew.imaging.jpeg.JpegMetadataReader;
5   -import com.drew.metadata.Directory;
6   -import com.drew.metadata.Metadata;
7   -import com.drew.metadata.Tag;
8   -import com.sun.imageio.plugins.png.PNGImageReader;
9   -import org.apache.commons.lang.StringUtils;
10   -
11   -import javax.imageio.ImageIO;
12   -import java.awt.*;
13   -import java.awt.image.BufferedImage;
14   -import java.io.File;
15   -import java.io.IOException;
16   -import java.util.Iterator;
17   -
18   -public class ImageUtils {
19   -
20   -
21   - /* *//**
22   - * 获取图片正确显示需要旋转的角度(顺时针)
23   - * @return
24   - *//*
25   - public static int getRotateAngleForPhoto(String filePath){
26   - File file = new File(filePath);
27   - int angle = 0;
28   - Metadata metadata;
29   - try {
30   - metadata = JpegMetadataReader.readMetadata(file);
31   - Directory directory = metadata.getDirectory(ExifDirectory.class);
32   - if(directory.containsTag(ExifDirectory.TAG_ORIENTATION)){
33   -
34   - // Exif信息中方向  
35   - int orientation = directory.getInt(ExifDirectory.TAG_ORIENTATION);
36   - // 原图片的方向信息
37   - if(6 == orientation ){
38   - //6旋转90
39   - angle = 90;
40   - }else if( 3 == orientation){
41   - //3旋转180
42   - angle = 180;
43   - }else if( 8 == orientation){
44   - //8旋转90
45   - angle = 270;
46   - }
47   - }
48   - } catch (JpegProcessingException e) {
49   - e.printStackTrace();
50   - } catch (MetadataException e) {
51   - e.printStackTrace();
52   - } catch (IOException e) {
53   - e.printStackTrace();
54   - }
55   - return angle;
56   - }*/
57   -
58   -
59   - /**
60   - * 获得图片调整角度
61   - * make by dongxh 2017年11月1日下午3:40:20
62   - * @param imgFile
63   - * @return
64   - */
65   - public static Integer getImgRotateAngle(String imgFile){
66   - return 0;
67   - /*int angel = 0;
68   - try {
69   - File file = new File(imgFile);
70   - Metadata metadata = ImageMetadataReader.readMetadata(file);
71   - for (Directory directory : metadata.getDirectories()) {
72   - for (Tag tag : directory.getTags()) {
73   - if (tag.getTagType() == ExifDirectoryBase.TAG_ORIENTATION) {
74   - String description = tag.getDescription();
75   -// System.out.println(description);
76   - if (description.contains("90")) {
77   - // 顺时针旋转90度
78   - angel = 90;
79   - } else if (description.contains("180")) {
80   - // 顺时针旋转180度
81   - angel = 180;
82   - } else if (description.contains("270")) {
83   - // 顺时针旋转270度
84   - angel = 270;
85   - }
86   - }
87   - }
88   - }
89   -// System.out.println(angel);
90   - } catch (Exception e) {
91   - e.printStackTrace();
92   - }
93   - return angel;*/
94   - /*Integer angel = 0;
95   - Metadata metadata = null;
96   - try{
97   - if(StringUtils.isBlank(imgFile))return angel;
98   - File _img_file_ = new File(imgFile);
99   - if(!_img_file_.exists())return angel;
100   - metadata = JpegMetadataReader.readMetadata(_img_file_);
101   - Directory directory = metadata.getDirectory(ExifDirectory.class);
102   - Iterator iterator =directory.getTagIterator();
103   - while (iterator.hasNext()){
104   - System.out.println("directory:"+iterator.next().toString());
105   - }
106   - if(directory != null && directory.containsTag(ExifDirectory.TAG_ORIENTATION)){
107   - int orientation = directory.getInt(ExifDirectory.TAG_ORIENTATION);
108   - // 原图片的方向信息
109   - if(6 == orientation ){
110   - //6旋转90
111   - angel = 90;
112   - }else if( 3 == orientation){
113   - //3旋转180
114   - angel = 180;
115   - }else if( 8 == orientation){
116   - //8旋转90
117   - angel = 270;
118   - }
119   - }
120   - }catch(Exception e){
121   - e.printStackTrace();
122   - }
123   - return angel;*/
124   - }
125   -
126   - /**
127   - * 旋转照片
128   - * @return
129   - */
130   - public static String rotatePhonePhoto(String fullPath, int angel){
131   -
132   - BufferedImage src;
133   - try {
134   - src = ImageIO.read(new File(fullPath));
135   - int src_width = src.getWidth(null);
136   - int src_height = src.getHeight(null);
137   -
138   - int swidth=src_width;
139   - int sheight=src_height;
140   -
141   - if(angel==90||angel==270){
142   - swidth = src_height;
143   - sheight= src_width;
144   - }
145   -
146   - Rectangle rect_des = new Rectangle(new Dimension(swidth,sheight));
147   -
148   - BufferedImage res = new BufferedImage(rect_des.width, rect_des.height,BufferedImage.TYPE_INT_RGB);
149   - Graphics2D g2 = res.createGraphics();
150   -
151   - g2.translate((rect_des.width - src_width) / 2,
152   - (rect_des.height - src_height) / 2);
153   - g2.rotate(Math.toRadians(angel), src_width / 2, src_height / 2);
154   -
155   - g2.drawImage(src, null, null);
156   -
157   - ImageIO.write(res, "jpg", new File(fullPath));
158   -
159   - } catch (IOException e) {
160   -
161   - e.printStackTrace();
162   - }
163   -
164   - return fullPath;
165   -
166   - }
167   -
168   -}
cloud/weigeng/src/main/java/com/sincere/weigeng/JiaoCai.java
... ... @@ -1,46 +0,0 @@
1   -package com.sincere.weigeng;
2   -
3   -import java.io.Serializable;
4   -
5   -public class JiaoCai implements Serializable {
6   -
7   -
8   - private String ID;
9   -
10   - private String SubjectId;
11   -
12   - private String JiaoCaiName;
13   -
14   - public String getID() {
15   - return ID;
16   - }
17   -
18   - public void setID(String ID) {
19   - this.ID = ID;
20   - }
21   -
22   - public String getSubjectId() {
23   - return SubjectId;
24   - }
25   -
26   - public void setSubjectId(String subjectId) {
27   - SubjectId = subjectId;
28   - }
29   -
30   - public String getJiaoCaiName() {
31   - return JiaoCaiName;
32   - }
33   -
34   - public void setJiaoCaiName(String jiaoCaiName) {
35   - JiaoCaiName = jiaoCaiName;
36   - }
37   -
38   - @Override
39   - public String toString() {
40   - return "JiaoCai{" +
41   - "ID='" + ID + '\'' +
42   - ", SubjectId='" + SubjectId + '\'' +
43   - ", JiaoCaiName='" + JiaoCaiName + '\'' +
44   - '}';
45   - }
46   -}
cloud/weigeng/src/main/java/com/sincere/weigeng/Knowledge.java
... ... @@ -1,44 +0,0 @@
1   -package com.sincere.weigeng;
2   -
3   -import java.io.Serializable;
4   -
5   -public class Knowledge implements Serializable {
6   -
7   - private String Name;
8   -
9   - private String SubjectId;
10   -
11   - private String Id;
12   -
13   - public String getId() {
14   - return Id;
15   - }
16   -
17   - public void setId(String id) {
18   - Id = id;
19   - }
20   -
21   - public String getName() {
22   - return Name;
23   - }
24   -
25   - public void setName(String name) {
26   - Name = name;
27   - }
28   -
29   - public String getSubjectId() {
30   - return SubjectId;
31   - }
32   -
33   - public void setSubjectId(String subjectId) {
34   - SubjectId = subjectId;
35   - }
36   -
37   - @Override
38   - public String toString() {
39   - return "Knowledge{" +
40   - "Name='" + Name + '\'' +
41   - ", SubjectId='" + SubjectId + '\'' +
42   - '}';
43   - }
44   -}
cloud/weigeng/src/main/java/com/sincere/weigeng/MyTask.java
... ... @@ -1,30 +0,0 @@
1   -package com.sincere.weigeng;
2   -
3   -import com.baidu.aip.ocr.AipOcr;
4   -import com.baidu.aip.util.Base64Util;
5   -import com.fasterxml.jackson.databind.ObjectMapper;
6   -import org.json.JSONObject;
7   -import org.springframework.boot.ApplicationArguments;
8   -import org.springframework.boot.ApplicationRunner;
9   -import org.springframework.http.HttpEntity;
10   -import org.springframework.http.HttpHeaders;
11   -import org.springframework.http.MediaType;
12   -import org.springframework.http.ResponseEntity;
13   -import org.springframework.stereotype.Component;
14   -import org.springframework.util.LinkedMultiValueMap;
15   -import org.springframework.util.MultiValueMap;
16   -import org.springframework.web.client.RestTemplate;
17   -
18   -import java.util.HashMap;
19   -
20   -@Component
21   -public class MyTask implements ApplicationRunner {
22   -
23   -
24   -
25   - @Override
26   - public void run(ApplicationArguments args) throws Exception {
27   -
28   - System.out.println("authon:" + AuthService.getAuth());
29   - }
30   -}
cloud/weigeng/src/main/java/com/sincere/weigeng/QuestionBean.java
... ... @@ -1,277 +0,0 @@
1   -package com.sincere.weigeng;
2   -
3   -import java.io.Serializable;
4   -
5   -public class QuestionBean implements Serializable {
6   -
7   -
8   - private String ID;
9   -
10   - private String Question;
11   -
12   - private String Qtype;
13   -
14   - private String Answer;
15   -
16   - private String CorrectAnswer;
17   -
18   - private String Analysis;
19   -
20   - private String State;
21   -
22   - private String Intime;
23   -
24   - private String ExamineFlag;
25   -
26   - private String ExamineUserId;
27   -
28   - private String CreateUserId;
29   -
30   - private String SubjectId;
31   -
32   - private String SchoolId;
33   -
34   - private String DifficulteId;
35   -
36   - private String KnowledgeId;
37   -
38   - private String ChapterId;
39   -
40   - private String GradeId;
41   -
42   - private String SourceId;
43   -
44   - private String OrderId;
45   -
46   - private String SId;
47   -
48   - private String StemId;
49   -
50   - private String AutomaticCorrection;
51   -
52   - private String PkgId;
53   -
54   - private String PkgType;
55   -
56   - public String getQuestion() {
57   - return Question;
58   - }
59   -
60   - public void setQuestion(String question) {
61   - Question = question;
62   - }
63   -
64   - public String getQtype() {
65   - return Qtype;
66   - }
67   -
68   - public void setQtype(String qtype) {
69   - Qtype = qtype;
70   - }
71   -
72   - public String getAnswer() {
73   - return Answer;
74   - }
75   -
76   - public void setAnswer(String answer) {
77   - Answer = answer;
78   - }
79   -
80   - public String getCorrectAnswer() {
81   - return CorrectAnswer;
82   - }
83   -
84   - public void setCorrectAnswer(String correctAnswer) {
85   - CorrectAnswer = correctAnswer;
86   - }
87   -
88   - public String getAnalysis() {
89   - return Analysis;
90   - }
91   -
92   - public void setAnalysis(String analysis) {
93   - Analysis = analysis;
94   - }
95   -
96   - public String getState() {
97   - return State;
98   - }
99   -
100   - public void setState(String state) {
101   - State = state;
102   - }
103   -
104   - public String getIntime() {
105   - return Intime;
106   - }
107   -
108   - public void setIntime(String intime) {
109   - Intime = intime;
110   - }
111   -
112   - public String getExamineFlag() {
113   - return ExamineFlag;
114   - }
115   -
116   - public void setExamineFlag(String examineFlag) {
117   - ExamineFlag = examineFlag;
118   - }
119   -
120   - public String getExamineUserId() {
121   - return ExamineUserId;
122   - }
123   -
124   - public void setExamineUserId(String examineUserId) {
125   - ExamineUserId = examineUserId;
126   - }
127   -
128   - public String getCreateUserId() {
129   - return CreateUserId;
130   - }
131   -
132   - public void setCreateUserId(String createUserId) {
133   - CreateUserId = createUserId;
134   - }
135   -
136   - public String getSubjectId() {
137   - return SubjectId;
138   - }
139   -
140   - public void setSubjectId(String subjectId) {
141   - SubjectId = subjectId;
142   - }
143   -
144   - public String getSchoolId() {
145   - return SchoolId;
146   - }
147   -
148   - public void setSchoolId(String schoolId) {
149   - SchoolId = schoolId;
150   - }
151   -
152   - public String getDifficulteId() {
153   - return DifficulteId;
154   - }
155   -
156   - public void setDifficulteId(String difficulteId) {
157   - DifficulteId = difficulteId;
158   - }
159   -
160   - public String getKnowledgeId() {
161   - return KnowledgeId;
162   - }
163   -
164   - public void setKnowledgeId(String knowledgeId) {
165   - KnowledgeId = knowledgeId;
166   - }
167   -
168   - public String getChapterId() {
169   - return ChapterId;
170   - }
171   -
172   - public void setChapterId(String chapterId) {
173   - ChapterId = chapterId;
174   - }
175   -
176   - public String getGradeId() {
177   - return GradeId;
178   - }
179   -
180   - public void setGradeId(String gradeId) {
181   - GradeId = gradeId;
182   - }
183   -
184   - public String getSourceId() {
185   - return SourceId;
186   - }
187   -
188   - public void setSourceId(String sourceId) {
189   - SourceId = sourceId;
190   - }
191   -
192   - public String getOrderId() {
193   - return OrderId;
194   - }
195   -
196   - public void setOrderId(String orderId) {
197   - OrderId = orderId;
198   - }
199   -
200   - public String getSId() {
201   - return SId;
202   - }
203   -
204   - public void setSId(String SId) {
205   - this.SId = SId;
206   - }
207   -
208   - public String getStemId() {
209   - return StemId;
210   - }
211   -
212   - public void setStemId(String stemId) {
213   - StemId = stemId;
214   - }
215   -
216   - public String getAutomaticCorrection() {
217   - return AutomaticCorrection;
218   - }
219   -
220   - public void setAutomaticCorrection(String automaticCorrection) {
221   - AutomaticCorrection = automaticCorrection;
222   - }
223   -
224   - public String getPkgId() {
225   - return PkgId;
226   - }
227   -
228   - public void setPkgId(String pkgId) {
229   - PkgId = pkgId;
230   - }
231   -
232   - public String getPkgType() {
233   - return PkgType;
234   - }
235   -
236   - public void setPkgType(String pkgType) {
237   - PkgType = pkgType;
238   - }
239   -
240   - public String getID() {
241   - return ID;
242   - }
243   -
244   - public void setID(String ID) {
245   - this.ID = ID;
246   - }
247   -
248   - @Override
249   - public String toString() {
250   - return "QuestionBean{" +
251   - "ID='" + ID + '\'' +
252   - ", Question='" + Question + '\'' +
253   - ", Qtype='" + Qtype + '\'' +
254   - ", Answer='" + Answer + '\'' +
255   - ", CorrectAnswer='" + CorrectAnswer + '\'' +
256   - ", Analysis='" + Analysis + '\'' +
257   - ", State='" + State + '\'' +
258   - ", Intime='" + Intime + '\'' +
259   - ", ExamineFlag='" + ExamineFlag + '\'' +
260   - ", ExamineUserId='" + ExamineUserId + '\'' +
261   - ", CreateUserId='" + CreateUserId + '\'' +
262   - ", SubjectId='" + SubjectId + '\'' +
263   - ", SchoolId='" + SchoolId + '\'' +
264   - ", DifficulteId='" + DifficulteId + '\'' +
265   - ", KnowledgeId='" + KnowledgeId + '\'' +
266   - ", ChapterId='" + ChapterId + '\'' +
267   - ", GradeId='" + GradeId + '\'' +
268   - ", SourceId='" + SourceId + '\'' +
269   - ", OrderId='" + OrderId + '\'' +
270   - ", SId='" + SId + '\'' +
271   - ", StemId='" + StemId + '\'' +
272   - ", AutomaticCorrection='" + AutomaticCorrection + '\'' +
273   - ", PkgId='" + PkgId + '\'' +
274   - ", PkgType='" + PkgType + '\'' +
275   - '}';
276   - }
277   -}
cloud/weigeng/src/main/java/com/sincere/weigeng/StudentAnswer.java
... ... @@ -1,44 +0,0 @@
1   -package com.sincere.weigeng;
2   -
3   -import java.io.Serializable;
4   -
5   -public class StudentAnswer implements Serializable {
6   -
7   - private String ID;
8   -
9   - private String CorrectAnswer;
10   -
11   - private String Answer;
12   -
13   - public String getID() {
14   - return ID;
15   - }
16   -
17   - public String getAnswer() {
18   - return Answer;
19   - }
20   -
21   - public void setAnswer(String answer) {
22   - Answer = answer;
23   - }
24   -
25   - public void setID(String ID) {
26   - this.ID = ID;
27   - }
28   -
29   - public String getCorrectAnswer() {
30   - return CorrectAnswer;
31   - }
32   -
33   - public void setCorrectAnswer(String correctAnswer) {
34   - CorrectAnswer = correctAnswer;
35   - }
36   -
37   - @Override
38   - public String toString() {
39   - return "StudentAnswer{" +
40   - "ID='" + ID + '\'' +
41   - ", CorrectAnswer='" + CorrectAnswer + '\'' +
42   - '}';
43   - }
44   -}
cloud/weigeng/src/main/java/com/sincere/weigeng/StudentBean.java
... ... @@ -1,233 +0,0 @@
1   -package com.sincere.weigeng;
2   -
3   -import java.io.Serializable;
4   -import java.util.Date;
5   -
6   -public class StudentBean implements Serializable {
7   -
8   -
9   - private long ID;
10   - private String UserId;
11   -
12   - private String CustomerId;
13   -
14   - private int StudentType;
15   -
16   - private int UserType;
17   -
18   - private String Name;
19   -
20   - private int ClassId;
21   -
22   - private String ClassName;
23   -
24   - private String OldCard;
25   -
26   - private String Card;
27   -
28   - private int SchoolId;
29   -
30   - private int school_id;
31   -
32   - private int IsNew;
33   -
34   - private int UpdateType;
35   -
36   - private Date AddTime;
37   -
38   - private int Sex;
39   -
40   - private String Face;
41   -
42   - private String StudentCode;
43   -
44   - private String student_num;
45   -
46   - private String student_id;
47   -
48   - public String getUserId() {
49   - return UserId;
50   - }
51   -
52   - public void setUserId(String userId) {
53   - UserId = userId;
54   - }
55   -
56   - public String getCustomerId() {
57   - return CustomerId;
58   - }
59   -
60   - public void setCustomerId(String customerId) {
61   - CustomerId = customerId;
62   - }
63   -
64   - public int getStudentType() {
65   - return StudentType;
66   - }
67   -
68   - public void setStudentType(int studentType) {
69   - StudentType = studentType;
70   - }
71   -
72   - public int getUserType() {
73   - return UserType;
74   - }
75   -
76   - public void setUserType(int userType) {
77   - UserType = userType;
78   - }
79   -
80   - public String getName() {
81   - return Name;
82   - }
83   -
84   - public void setName(String name) {
85   - Name = name;
86   - }
87   -
88   - public int getClassId() {
89   - return ClassId;
90   - }
91   -
92   - public void setClassId(int classId) {
93   - ClassId = classId;
94   - }
95   -
96   - public String getClassName() {
97   - return ClassName;
98   - }
99   -
100   - public void setClassName(String className) {
101   - ClassName = className;
102   - }
103   -
104   - public String getOldCard() {
105   - return OldCard;
106   - }
107   -
108   - public void setOldCard(String oldCard) {
109   - OldCard = oldCard;
110   - }
111   -
112   - public String getCard() {
113   - return Card;
114   - }
115   -
116   - public int getSchool_id() {
117   - return school_id;
118   - }
119   -
120   - public void setSchool_id(int school_id) {
121   - this.school_id = school_id;
122   - }
123   -
124   - public String getStudent_num() {
125   - return student_num;
126   - }
127   -
128   - public void setStudent_num(String student_num) {
129   - this.student_num = student_num;
130   - }
131   -
132   - public void setCard(String card) {
133   - Card = card;
134   - }
135   -
136   - public int getSchoolId() {
137   - return SchoolId;
138   - }
139   -
140   - public void setSchoolId(int schoolId) {
141   - SchoolId = schoolId;
142   - }
143   -
144   - public int getIsNew() {
145   - return IsNew;
146   - }
147   -
148   - public void setIsNew(int isNew) {
149   - IsNew = isNew;
150   - }
151   -
152   - public int getUpdateType() {
153   - return UpdateType;
154   - }
155   -
156   - public void setUpdateType(int updateType) {
157   - UpdateType = updateType;
158   - }
159   -
160   - public Date getAddTime() {
161   - return AddTime;
162   - }
163   -
164   - public void setAddTime(Date addTime) {
165   - AddTime = addTime;
166   - }
167   -
168   - public int getSex() {
169   - return Sex;
170   - }
171   -
172   - public void setSex(int sex) {
173   - Sex = sex;
174   - }
175   -
176   - public String getFace() {
177   - return Face;
178   - }
179   -
180   - public void setFace(String face) {
181   - Face = face;
182   - }
183   -
184   - public String getStudentCode() {
185   - return StudentCode;
186   - }
187   -
188   - public void setStudentCode(String studentCode) {
189   - StudentCode = studentCode;
190   - }
191   -
192   - public long getID() {
193   - return ID;
194   - }
195   -
196   - public void setID(long ID) {
197   - this.ID = ID;
198   - }
199   -
200   - public String getStudent_id() {
201   - return student_id;
202   - }
203   -
204   - public void setStudent_id(String student_id) {
205   - this.student_id = student_id;
206   - }
207   -
208   - @Override
209   - public String toString() {
210   - return "StudentBean{" +
211   - "ID=" + ID +
212   - ", UserId='" + UserId + '\'' +
213   - ", CustomerId='" + CustomerId + '\'' +
214   - ", StudentType=" + StudentType +
215   - ", UserType=" + UserType +
216   - ", Name='" + Name + '\'' +
217   - ", ClassId=" + ClassId +
218   - ", ClassName='" + ClassName + '\'' +
219   - ", OldCard='" + OldCard + '\'' +
220   - ", Card='" + Card + '\'' +
221   - ", SchoolId=" + SchoolId +
222   - ", school_id=" + school_id +
223   - ", IsNew=" + IsNew +
224   - ", UpdateType=" + UpdateType +
225   - ", AddTime=" + AddTime +
226   - ", Sex=" + Sex +
227   - ", Face='" + Face + '\'' +
228   - ", StudentCode='" + StudentCode + '\'' +
229   - ", student_num='" + student_num + '\'' +
230   - ", student_id='" + student_id + '\'' +
231   - '}';
232   - }
233   -}
cloud/weigeng/src/main/java/com/sincere/weigeng/StudentInfo.java
... ... @@ -1,57 +0,0 @@
1   -package com.sincere.weigeng;
2   -
3   -import java.io.Serializable;
4   -
5   -public class StudentInfo implements Serializable {
6   -
7   - private String student_id;
8   -
9   - private String name;
10   -
11   - private String class_name;
12   -
13   - private String ParentMobile;
14   -
15   - private String studentcode;
16   -
17   -
18   - public String getStudentcode() {
19   - return studentcode;
20   - }
21   -
22   - public void setStudentcode(String studentcode) {
23   - this.studentcode = studentcode;
24   - }
25   -
26   - public String getStudent_id() {
27   - return student_id;
28   - }
29   -
30   - public void setStudent_id(String student_id) {
31   - this.student_id = student_id;
32   - }
33   -
34   - public String getName() {
35   - return name;
36   - }
37   -
38   - public void setName(String name) {
39   - this.name = name;
40   - }
41   -
42   - public String getClass_name() {
43   - return class_name;
44   - }
45   -
46   - public void setClass_name(String class_name) {
47   - this.class_name = class_name;
48   - }
49   -
50   - public String getParentMobile() {
51   - return ParentMobile;
52   - }
53   -
54   - public void setParentMobile(String parentMobile) {
55   - ParentMobile = parentMobile;
56   - }
57   -}
cloud/weigeng/src/main/java/com/sincere/weigeng/TestDao.java
... ... @@ -1,138 +0,0 @@
1   -package com.sincere.weigeng;
2   -
3   -import org.apache.ibatis.annotations.*;
4   -import org.springframework.stereotype.Repository;
5   -
6   -import java.util.List;
7   -
8   -@Repository
9   -@Mapper
10   -public interface TestDao {
11   -
12   -
13   - @Insert("insert into TK_QuestionStem values(#{QuestionStem},#{State},#{Intime})")
14   - int addQuestionStem(@Param("QuestionStem") String QuestionStem, @Param("State") String State, @Param("Intime") String Intime);
15   -
16   - @Insert("insert into TK_Question(Question,Qtype,Answer,CorrectAnswer,Analysis,State,Intime,ExamineFlag,ExamineUserId,CreateUserId,SubjectId,SchoolId,DifficulteId,KnowledgeId,ChapterId,GradeId,SourceId,OrderId,SId," +
17   - "StemId,AutomaticCorrection,PkgId,PkgType) " +
18   - "values(#{Question},#{Qtype},#{Answer},#{CorrectAnswer},#{Analysis},#{State},#{Intime},#{ExamineFlag},#{ExamineUserId}" +
19   - ",#{CreateUserId},#{SubjectId},#{SchoolId},#{DifficulteId},#{KnowledgeId},#{ChapterId},#{GradeId},#{SourceId},#{OrderId},#{SId}" +
20   - ",#{StemId},#{AutomaticCorrection},#{PkgId},#{PkgType})")
21   - int addQuestion(@Param("Question") String Question, @Param("Qtype") String Qtype, @Param("Answer") String Answer, @Param("CorrectAnswer") String CorrectAnswer
22   - , @Param("Analysis") String Analysis, @Param("State") String State, @Param("Intime") String Intime, @Param("ExamineFlag") String ExamineFlag, @Param("ExamineUserId") String ExamineUserId
23   - , @Param("CreateUserId") String CreateUserId, @Param("SubjectId") String SubjectId, @Param("SchoolId") String SchoolId, @Param("DifficulteId") String DifficulteId, @Param("KnowledgeId") String KnowledgeId
24   - , @Param("ChapterId") String ChapterId, @Param("GradeId") String GradeId, @Param("SourceId") String SourceId, @Param("OrderId") String OrderId, @Param("SId") String SId
25   - , @Param("StemId") String StemId, @Param("AutomaticCorrection") String AutomaticCorrection, @Param("PkgId") String PkgId, @Param("PkgType") String PkgType);
26   -
27   - @Select("select Top(1) ID from TK_QuestionStem order by Intime desc ")
28   - int getStemId();
29   -
30   - @Select("select * from TK_Question where Question like #{Question}")
31   - List<QuestionBean> getQuestions(@Param("Question")String Question);
32   -
33   - @Update("update TK_Question set CorrectAnswer = #{answer},Analysis = #{explanation} where ID = #{id}")
34   - void updateQuestion(@Param("id") String id, @Param("answer") String answer, @Param("explanation") String explanation);
35   -
36   -
37   - //学生做作业
38   - @Insert("insert into ZY_StudentAnswer (QuestionId,Answer,CorrectAnswer,QuestionType,IsCorrect,WorkID) values (" +
39   - "#{QuestionId},#{Answer},#{CorrectAnswer},#{QuestionType},#{IsCorrect},#{WorkID})")
40   - void StudentAnswer(@Param("QuestionId")String QuestionId,@Param("Answer")String Answer,@Param("CorrectAnswer")String CorrectAnswer,
41   - @Param("QuestionType")String QuestionType,@Param("IsCorrect")String IsCorresct,@Param("WorkID")String WorkID);
42   -
43   - @Insert("insert into ZY_HomeworkReceive values(#{WorkId},#{ClassId},#{StudentId},#{StudnetAnswerIds},#{IsFinished}," +
44   - "#{AnswerTime},#{FinishTime},#{Intime},#{IsPigai},#{IsPigai})")
45   - void HomeworkReceive(@Param("WorkId")String WorkId,@Param("ClassId")String ClassId,@Param("StudentId")String StudentId,@Param("StudnetAnswerIds")String StudnetAnswerIds,
46   - @Param("IsFinished")String IsFinished,@Param("AnswerTime")String AnswerTime,@Param("FinishTime")String FinishTime,@Param("Intime")String Intime,
47   - @Param("IsPigai")String IsPigai,@Param("IsPigai")String UseTime);
48   -
49   - @Select("select * from TK_Question where ID = #{ID}")
50   - QuestionBean getQues(@Param("ID")String ID);
51   -
52   - @Select("select StudentId from ZY_HomeworkReceive where WorkId = #{WorkId}")
53   - List<String> getStudentIds(@Param("WorkId")String WorkId);
54   -// )
55   -
56   - @Select("select ID from TK_Question where SchoolId = 885 and CorrectAnswer in('A','B','C','D') and ChapterId = #{ChapterId}")
57   - List<String> getQIDS(@Param("ChapterId")String ChapterId );
58   -
59   - @Select("select ID from ZY_StudentAnswer where WorkID = #{WorkID}")
60   - List<String> getStudentAnsIds(@Param("WorkID")String WorkID);
61   -
62   - //添加学生答题记录
63   - @Insert("insert into ZY_StudentAnswer values (#{QuestionId},#{Answer},#{AnswerTime},#{CorrectAnswer},#{QuestionType},#{Pigai},#{IsCorrect},#{AppachIds},#{TeacherAppachIds},#{WorkID})")
64   - void addStudentAnswer(@Param("QuestionId")String QuestionId,@Param("Answer")String Answer,@Param("AnswerTime")String AnswerTime,@Param("CorrectAnswer")String CorrectAnswer,
65   - @Param("QuestionType")String QuestionType,@Param("Pigai")String Pigai,@Param("IsCorrect")String IsCorrect,@Param("AppachIds")String AppachIds,
66   - @Param("TeacherAppachIds")String TeacherAppachIds,@Param("WorkID")String WorkID);
67   -
68   -
69   - @Select("select Top(#{top}) ID from ZY_StudentAnswer where WorkID = #{WorkID} order by ID desc")
70   - List<String> getTopIDs(@Param("WorkID")String WorkID,@Param("top")int top);
71   -
72   - @Select("select ID from ZY_HomeworkReceive where WorkId = #{WorkId} and ID >= #{ID} and ID<12054 order by ID desc")
73   - List<String> get_HomeworkReceive(@Param("WorkId")String WorkId,@Param("ID")String ID);
74   -
75   - @Update("update ZY_HomeworkReceive set StudnetAnswerIds = #{StudnetAnswerIds} where ID = #{ID}")
76   - void updateHomeWork(@Param("StudnetAnswerIds")String StudnetAnswerIds,@Param("ID")String ID);
77   -
78   - @Select("select * from ZY_HomeworkReceive where WorkId = #{WorkId} order by ID desc")
79   - List<HomeworkReceive> get_HomeworkRec(@Param("WorkId")String WorkId);
80   -
81   - @Select("select Title from ZY_Homework where ID = #{ID} order by ID desc")
82   - String getWorkName(@Param("ID") String workId);
83   -
84   - @Select("select * from ZY_StudentAnswer where WorkID = #{WorkId}")
85   - List<StudentAnswer> get_stuAnswer(@Param("WorkId")String WorkId);
86   -
87   - @Update("update ZY_StudentAnswer set Answer = #{Answer},IsCorrect = #{IsCorrect} ,CorrectAnswer = #{CorrectAnswer} where ID = #{ID}")
88   - void updateStudentAnswer(@Param("ID") String id,@Param("CorrectAnswer")String CorrectAnswer,@Param("Answer")String Answer,@Param("IsCorrect")String IsCorrect);
89   -
90   - @Select("select name from SZ_V_School_Student where student_id = #{student_id}")
91   - String getStudentName(@Param("student_id") String studentId);
92   -
93   - @Select("select student_id from SZ_V_School_Student where class_id = #{class_id}")
94   - List<String> getStudentIdsWithClassId(@Param("class_id") String class_id);
95   -
96   - @Select("select IsCorrect from ZY_StudentAnswer where ID = #{ID}")
97   - int getIsCorrect(@Param("ID") String id);
98   -
99   - @Select("select QuestionId from ZY_StudentAnswer where WorkID = #{WorkID}")
100   - List<String> getStuAnsIds(@Param("WorkID") String workId);
101   -
102   - @Select("select CorrectAnswer from ZY_StudentAnswer where WorkID = #{WorkID}")
103   - List<String> correctAns(@Param("WorkID")String WorkID);
104   -
105   -
106   - @Select("select * from ZY_TestPaper where CreatorUserId = #{CreateUserId} and Intime > #{Intime}")
107   - List<TestPaper> getTestPapers(@Param("CreateUserId") String createUserId,@Param("Intime")String Intime);
108   -
109   - @Insert("insert into ZY_TestPaper values (#{addCreateUserId},#{questionIds},#{status},#{publishTime},#{name},#{isRecommend},#{state},#{intime},#{schoolId})")
110   - void addTestPaper(@Param("addCreateUserId") String addCreateUserId, @Param("questionIds") String questionIds, @Param("status") int status,
111   - @Param("publishTime") String publishTime, @Param("name") String name, @Param("isRecommend") int isRecommend,
112   - @Param("state") int state, @Param("intime") String intime, @Param("schoolId") String schoolId);
113   -
114   - @Insert("insert into ZY_Homework values(#{addCreateUserId},#{id},#{name},#{s},#{s1},#{s2},#{s3},#{i},#{i1},#{i2},#{s4},#{i3},#{questionIds},#{i4},#{i5}) ")
115   - void addHomework(@Param("addCreateUserId") String addCreateUserId, @Param("id") int id, @Param("name") String name,
116   - @Param("s") String s, @Param("s1") String s1, @Param("s2") String s2, @Param("s3") String s3, @Param("i") int i,
117   - @Param("i1") int i1, @Param("i2") int i2,@Param("s4") String s4, @Param("i3") int i3, @Param("questionIds") String questionIds, @Param("i4") int i4, @Param("i5") int i5);
118   -
119   -
120   - @Select("select * from ZY_Homework where CreatorUserId in (select DISTINCT user_id from SZ_UserRole where school_id = 11)")
121   - List<HomeBean> getCreatorUserId();
122   -
123   - @Select("select * from ZY_Homework where CreatorUserId = #{CreatorUserId}")
124   - List<Homework> getHomeWork(@Param("CreatorUserId") String addCreateUserId);
125   -
126   - @Select("select * from SZ_V_School_Student where school_id = #{school_id}")
127   - List<StudentInfo> getStudents(@Param("school_id") int school_id);
128   -
129   - @Select("select QuestionIds from ZY_Homework where ID = #{workId}")
130   - String getQuestionIds(@Param("workId") String workId);
131   -
132   - @Select("select CorrectAnswer from TK_Question where ID = #{questionId}")
133   - String getCorrectAnswer(@Param("questionId") String questionId);
134   -
135   -
136   -
137   -
138   -}
cloud/weigeng/src/main/java/com/sincere/weigeng/TestPaper.java
... ... @@ -1,122 +0,0 @@
1   -package com.sincere.weigeng;
2   -
3   -import java.io.Serializable;
4   -
5   -public class TestPaper implements Serializable {
6   -
7   - private int ID;
8   -
9   - private String CreatorUserId;
10   -
11   - private String QuestionIds;
12   -
13   - private int Status;
14   -
15   - private String PublishTime;
16   -
17   - private String Name;
18   -
19   - private int IsRecommend;
20   -
21   - private int State;
22   -
23   - private String Intime;
24   -
25   - private int SchoolId;
26   -
27   - public String getCreatorUserId() {
28   - return CreatorUserId;
29   - }
30   -
31   - public void setCreatorUserId(String creatorUserId) {
32   - CreatorUserId = creatorUserId;
33   - }
34   -
35   - public String getQuestionIds() {
36   - return QuestionIds;
37   - }
38   -
39   - public void setQuestionIds(String questionIds) {
40   - QuestionIds = questionIds;
41   - }
42   -
43   - public int getStatus() {
44   - return Status;
45   - }
46   -
47   - public int getID() {
48   - return ID;
49   - }
50   -
51   - public void setID(int ID) {
52   - this.ID = ID;
53   - }
54   -
55   - public void setStatus(int status) {
56   - Status = status;
57   - }
58   -
59   - public String getPublishTime() {
60   - return PublishTime;
61   - }
62   -
63   - public void setPublishTime(String publishTime) {
64   - PublishTime = publishTime;
65   - }
66   -
67   - public String getName() {
68   - return Name;
69   - }
70   -
71   - public void setName(String name) {
72   - Name = name;
73   - }
74   -
75   - public int getIsRecommend() {
76   - return IsRecommend;
77   - }
78   -
79   - public void setIsRecommend(int isRecommend) {
80   - IsRecommend = isRecommend;
81   - }
82   -
83   - public int getState() {
84   - return State;
85   - }
86   -
87   - public void setState(int state) {
88   - State = state;
89   - }
90   -
91   - public String getIntime() {
92   - return Intime;
93   - }
94   -
95   - public void setIntime(String intime) {
96   - Intime = intime;
97   - }
98   -
99   - public int getSchoolId() {
100   - return SchoolId;
101   - }
102   -
103   - public void setSchoolId(int schoolId) {
104   - SchoolId = schoolId;
105   - }
106   -
107   - @Override
108   - public String toString() {
109   - return "TestPaper{" +
110   - "ID=" + ID +
111   - ", CreatorUserId='" + CreatorUserId + '\'' +
112   - ", QuestionIds='" + QuestionIds + '\'' +
113   - ", Status=" + Status +
114   - ", PublishTime='" + PublishTime + '\'' +
115   - ", Name='" + Name + '\'' +
116   - ", IsRecommend=" + IsRecommend +
117   - ", State=" + State +
118   - ", Intime='" + Intime + '\'' +
119   - ", SchoolId=" + SchoolId +
120   - '}';
121   - }
122   -}
cloud/weigeng/src/main/java/com/sincere/weigeng/WatchServer.java
... ... @@ -1,530 +0,0 @@
1   -package com.sincere.weigeng;
2   -
3   -
4   -import com.sincere.common.dto.smartCampus.UserDto;
5   -import com.sincere.common.dto.xiaoan.CheckInDto;
6   -import com.sincere.common.dto.xiaoan.CheckOutDto;
7   -import com.sincere.common.dto.xiaoan.PassFailDto;
8   -import com.sincere.common.dto.xiaoan.SendMessageDto;
9   -import com.sincere.common.util.DateUtils;
10   -import com.sincere.weigeng.feign.SmFeign;
11   -import com.sincere.weigeng.feign.XaFeign;
12   -import com.sincere.weigeng.logs.LogName;
13   -import com.sincere.weigeng.logs.LoggerUtils;
14   -import com.sincere.weigeng.utils.WGUtils;
15   -import com.sincere.weigeng.utils.WatchingShortHandler;
16   -import com.sincere.weigeng.utils.WgUdpCommShort;
17   -import org.apache.commons.lang3.StringUtils;
18   -import org.apache.mina.core.session.IoSession;
19   -import org.apache.mina.transport.socket.DatagramSessionConfig;
20   -import org.apache.mina.transport.socket.nio.NioDatagramAcceptor;
21   -import org.slf4j.Logger;
22   -import org.springframework.beans.factory.annotation.Autowired;
23   -import org.springframework.boot.ApplicationArguments;
24   -import org.springframework.boot.ApplicationRunner;
25   -import org.springframework.stereotype.Component;
26   -
27   -import java.io.IOException;
28   -import java.net.InetSocketAddress;
29   -import java.util.*;
30   -import java.util.concurrent.ConcurrentHashMap;
31   -
32   -/**
33   - * @author chen
34   - * @version 1.0
35   - * @date 2019/10/12 0012 16:57
36   - */
37   -
38   -@Component
39   -public class WatchServer implements ApplicationRunner {
40   -
41   - private static final Logger Log_orderSuccess = LoggerUtils.Logger(LogName.orderSuccess);
42   - private static final Logger Log_orderFail = LoggerUtils.Logger(LogName.orderFail);
43   - private static final Logger Log_kaoInfo = LoggerUtils.Logger(LogName.kaoInfo);
44   - private static final Logger Log_heartBeat = LoggerUtils.Logger(LogName.heartBeat);
45   - private static final Logger Log_error = LoggerUtils.Logger(LogName.error);
46   -
47   - private static List<Long> snoList = new ArrayList<>();
48   - private static List<Long> indexList = new ArrayList<>();
49   - private static WatchingShortHandler watchingShortHandler ;
50   - private static Queue<byte[]> queue = new LinkedList<>();
51   - private static Map<Long , IoSession> sessionMap = new ConcurrentHashMap<>();
52   -
53   - @Autowired
54   - SmFeign smFeign;
55   -
56   - @Autowired
57   - XaFeign xaFeign;
58   -
59   - private static String ip = "172.16.3.175";
60   - private static int port = 1200;
61   -
62   - @Override
63   - public void run(ApplicationArguments args) {
64   - //启动服务监听
65   - this.WatchingServerRunning(ip,port);
66   - }
67   -
68   - // 进入服务器监控状态
69   - public int WatchingServerRunning(String watchServerIP,int watchServerPort) {
70   - watchingShortHandler = new WatchingShortHandler(queue,sessionMap);
71   - // 创建UDP数据包NIO
72   - NioDatagramAcceptor acceptor = new NioDatagramAcceptor();
73   - // NIO设置底层IOHandler
74   - acceptor.setHandler(watchingShortHandler);
75   -
76   - // 设置是否重用地址? 也就是每个发过来的udp信息都是一个地址?
77   - DatagramSessionConfig dcfg = acceptor.getSessionConfig();
78   - dcfg.setReuseAddress(false);
79   - // 绑定端口地址
80   - try {
81   - acceptor.bind(new InetSocketAddress(watchServerIP, watchServerPort));
82   - } catch (IOException e) {
83   - Log_orderSuccess.info("绑定接收服务器失败....");
84   - e.printStackTrace();
85   - return 0;
86   - }
87   - Log_orderSuccess.info("绑定接收服务器成功....");
88   - long recordIndex = 0;
89   - while(true) {
90   - if (!queue.isEmpty()) {
91   - byte[] recvBuff;
92   - synchronized (queue) {
93   - recvBuff= queue.poll();
94   - }
95   - if (recvBuff[1]== 0x20) {
96   - long sn = WgUdpCommShort.getLongByByte(recvBuff, 4, 4);
97   - smFeign.updateLinkTime(sn+"");
98   - Log_heartBeat.info("设备"+sn);
99   - boolean isExist = true ;
100   - long recordIndexGet = WgUdpCommShort.getLongByByte(recvBuff, 8, 4);
101   - if(snoList.indexOf(sn) >= 0){
102   - int number = snoList.indexOf(sn);
103   - recordIndex = indexList.get(number);
104   - indexList.set(number,recordIndexGet);
105   - }else {
106   - snoList.add(sn);
107   - recordIndex = 0 ;
108   - indexList.add(recordIndexGet);
109   - System.out.println("设备"+sn+"上线");
110   - isExist = false ;
111   - }
112   - if(isExist){
113   - if (recordIndex < recordIndexGet || (recordIndexGet - recordIndex) < -5) {
114   - watching(recvBuff);
115   - }
116   - }
117   - }else {
118   - push(recvBuff);
119   - }
120   - } else {
121   - long times = 100;
122   - try {
123   - Thread.sleep(times);
124   - } catch (InterruptedException e) {
125   - e.printStackTrace();
126   - }
127   - }
128   - }
129   - }
130   -
131   - private void watching(byte[] recv){
132   - long res = 0;
133   - //8-11 记录的索引号
134   - //(=0表示没有记录) 4 0x00000000
135   - int recordIndex = 0;
136   - recordIndex = WGUtils.byteToInt(recv, 8, 4);
137   - //12 记录类型**********************************************
138   - //0=无记录
139   - //1=刷卡记录
140   - //2=门磁,按钮, 设备启动, 远程开门记录
141   - //3=报警记录 1
142   - //0xFF=表示指定索引位的记录已被覆盖掉了. 请使用索引0, 取回最早一条记录的索引值
143   - int recordType = recv[12];
144   -
145   - //13 有效性(0 表示不通过, 1表示通过) 1
146   - int recordValid = recv[13];
147   -
148   - //14 门号(1,2,3,4) 1 业务需要-->1出2进
149   - int recordDoorNO = recv[14];
150   -
151   - //15 进门/出门(1表示进门, 2表示出门) 1 0x01
152   - //int recordInOrOut = recv[15];
153   -
154   - //16-19 卡号(类型是刷卡记录时)
155   - //或编号(其他类型记录) 4
156   - String cardNo = WGUtils.getCardNo(recv, 16, 4);
157   -
158   - //20-26 刷卡时间:
159   - //年月日时分秒 (采用BCD码)见设置时间部分的说明
160   - String recordTime = "2000-01-01 00:00:00";
161   - recordTime = String.format("%02X%02X-%02X-%02X %02X:%02X:%02X",
162   - recv[20], recv[21], recv[22], recv[23], recv[24], recv[25], recv[26]);
163   - //2012.12.11 10:49:59 7
164   - //27 记录原因代码(可以查 “刷卡记录说明.xls”文件的ReasonNO)
165   - //处理复杂信息才用 1
166   - int reason = recv[27];
167   - if (recordType == 0) {
168   - Log_orderSuccess.info(String.format("索引位={0} 无记录", recordIndex));
169   - }else if (recordType == 0xff) {
170   - Log_orderSuccess.info("指定索引位的记录已被覆盖掉了,请使用索引0, 取回最早一条记录的索引值");
171   - } else if (recordType == 1) {
172   - long sno = 0;
173   - sno = WgUdpCommShort.getLongByByte(recv, 4, 4);//解析设备号
174   - String msg = "索引位=" + recordIndex
175   - + ",卡号=" + cardNo
176   - +"进出=" + (recordDoorNO == 1 ? "出门" : "进门")
177   - + ",有效=" + (recordValid == 1 ? "通过" : "禁止")
178   - + ",时间=" + recordTime
179   - + ",描述=" + WGUtils.getReasonDetailChinese(reason) + "";
180   - Log_orderSuccess.info("控制器:" + sno + msg);
181   - if(recordValid == 1) {
182   - //有效刷卡调考勤存储过程
183   - CheckInDto checkIn = new CheckInDto();
184   - checkIn.setDeviceId(sno+"");
185   - checkIn.setCardNo(cardNo);
186   - checkIn.setFunNo(8);
187   - checkIn.setFlag(recordDoorNO == 1 ? 1 : 0);
188   - checkIn.setCheckTime(recordTime);
189   - CheckOutDto checkOutDto = xaFeign.checkIn(checkIn);
190   - if(checkOutDto.getIsSuccess() == 1){
191   - //考勤成功
192   - String nowDate = DateUtils.date2String(new Date(),DateUtils.format2);
193   - Log_kaoInfo.info("考勤成功!,设备:"+sno+"卡号:"+cardNo+"方向:"+(recordDoorNO == 1 ? "出门" : "进门")+"______刷卡时间"+ recordTime+";入库时间:"+nowDate);
194   - }else {
195   - //考勤失败
196   - Log_orderFail.error("考勤失败!,设备:"+sno+"卡号:"+cardNo + "---"+ checkOutDto.getOut());
197   - }
198   - }else {
199   - //判断是否请假
200   - String studentNum = smFeign.checkLeave(cardNo);
201   - if (StringUtils.isNotBlank(studentNum)) {
202   - int outOf = recordDoorNO == 1 ? 1 : 0;
203   - //远程开门
204   - openDoor(sno,"64",recordDoorNO,cardNo);
205   - Log_orderSuccess.info("请假开门成功"+cardNo);
206   - } else {
207   - //没有请假不做任何处理,则是刷卡异常,入库
208   - UserDto user = smFeign.selectUserByCardNum(cardNo);
209   - PassFailDto passFail = new PassFailDto();
210   - passFail.setCardNum(cardNo);
211   - passFail.setDeviceId(sno+"");
212   - passFail.setDirection((recordDoorNO == 1 ? "出门" : "进门"));
213   - passFail.setResultIntro(WGUtils.getReasonDetailChinese(reason));
214   - passFail.setInTime(DateUtils.string2Date(recordTime, DateUtils.format2));
215   - passFail.setCreateTime(new Date());
216   - passFail.setSchoolId(user.getSchoolId());
217   - xaFeign.insertPassFail(passFail);
218   - }
219   - }
220   - }
221   - }
222   -
223   - private void push(byte[] recv){
224   - long index = WgUdpCommShort.getXidOfCommand(recv);
225   - long sno = WgUdpCommShort.getLongByByte(recv, 4, 4);
226   - String functionId = WGUtils.byte2Hex(recv[1]);
227   - SendMessageDto sendMessage = xaFeign.selectMessage(sno+"",index,functionId);
228   - if(sendMessage != null){
229   - if(recv[8] == 1){
230   - sendMessage.setCorrect(1);
231   - }else {
232   - sendMessage.setCorrect(0);
233   - }
234   - StringBuffer result = new StringBuffer();
235   - for(byte b : recv){
236   - result.append(WGUtils.byte2Hex(b)).append("-");
237   - }
238   - sendMessage.setResult(result.toString().substring(0,result.toString().length()-1));
239   - xaFeign.updateMessage(sendMessage.getId(),sendMessage.getResult(),sendMessage.getCorrect());
240   - }
241   - }
242   -
243   - //远程开门
244   - public long openDoor(long sno , String outsideOrderId,int doorNo , String cardNo){
245   - WgUdpCommShort pkt = new WgUdpCommShort();
246   - pkt.iDevSn = sno;
247   - try{
248   - int doorNO =doorNo;
249   - pkt.Reset();
250   - pkt.functionID = WGUtils.toFunctionHex(outsideOrderId);
251   - pkt.data[0] =(byte) (doorNO & 0xff);
252   - if(StringUtils.isNotBlank(cardNo)){
253   - pkt.data[20] = WGUtils.toHex(cardNo.substring(0,2));
254   - pkt.data[21] = WGUtils.toHex(cardNo.substring(2,4));
255   - pkt.data[22] = WGUtils.toHex(cardNo.substring(4,6));
256   - pkt.data[23] = WGUtils.toHex(cardNo.substring(6,8));
257   - }
258   - byte[] bytes = pkt.toByte();
259   - long index = WgUdpCommShort.getXidOfCommand(bytes);
260   - long result = insert(sno+"",outsideOrderId,cardNo,index,bytes);
261   - pkt.run(watchingShortHandler.getSessionMap().get(sno),bytes);
262   - return result ;
263   - }catch (Exception e){
264   - Log_error.error(e.toString());
265   - }
266   - return 0L;
267   - }
268   -
269   - //重置控制板时间
270   - public long setTime(long sno , String outsideOrderId){
271   - WgUdpCommShort pkt = new WgUdpCommShort();
272   - pkt.iDevSn = sno;
273   - try{
274   - pkt.Reset();
275   - pkt.functionID = WGUtils.toFunctionHex(outsideOrderId);
276   - Calendar cal = (Calendar.getInstance());
277   - pkt.data[0] = WGUtils.toHex(String.valueOf(cal.get(Calendar.YEAR)).substring(0,2));
278   - pkt.data[1] = WGUtils.toHex(String.valueOf(cal.get(Calendar.YEAR)).substring(2,4));
279   - pkt.data[2] = WGUtils.toHex(String.valueOf(cal.get(Calendar.MONTH)+1));
280   - pkt.data[3] = WGUtils.toHex(String.valueOf(cal.get(Calendar.DATE)));
281   - pkt.data[4] =WGUtils.toHex(String.valueOf(cal.get(Calendar.HOUR_OF_DAY)));
282   - pkt.data[5] =WGUtils.toHex(String.valueOf(cal.get(Calendar.MINUTE)));
283   - pkt.data[6] = WGUtils.toHex(String.valueOf(cal.get(Calendar.SECOND)));
284   - byte[] bytes = pkt.toByte();
285   - long index = WgUdpCommShort.getXidOfCommand(bytes);
286   - long result = insert(sno+"",outsideOrderId,null,index,bytes);
287   - pkt.run(watchingShortHandler.getSessionMap().get(sno),bytes);
288   - return result ;
289   - }catch (Exception e){
290   - Log_error.error(e.toString());
291   - }
292   - return 0L;
293   - }
294   -
295   - //设置考勤时段
296   - public List<Long> SetAttendanceTime(long sno ,String outsideOrderId, int shiduan , Date begin ,Date end ,
297   - int isMonDay ,int isTuesDay , int isWednesDay ,int isThursDay , int isFriday ,
298   - int isSaturDay , int isWeekend , String shiqu){
299   - List<Long> resultList = new ArrayList<>();
300   - WgUdpCommShort pkt = new WgUdpCommShort();
301   - pkt.iDevSn = sno;
302   - try{
303   - pkt.Reset();
304   - pkt.functionID = WGUtils.toFunctionHex(outsideOrderId);
305   - String[] shiQuArray = shiqu.split(",");
306   - int shiDuanCount = shiQuArray.length / 6 ;
307   - for (int i = 0; i < shiDuanCount; i++){
308   - if (i == 0) {
309   - pkt.data[0] = WGUtils.toHex(shiduan+"");
310   - } else {
311   - pkt.data[0] = WGUtils.toHex((shiduan+20*i)+"");
312   - }
313   - Calendar c = Calendar.getInstance();
314   - c.setTime(begin);
315   - //开始时间 20 19 01 01
316   - pkt.data[1] = WGUtils.toHex(String.valueOf(c.get(Calendar.YEAR)).substring(0,2));
317   - pkt.data[2] = WGUtils.toHex(String.valueOf(c.get(Calendar.YEAR)).substring(2,4));
318   - pkt.data[3] = WGUtils.toHex(String.valueOf(c.get(Calendar.MONTH)+1));
319   - pkt.data[4] = WGUtils.toHex(String.valueOf(c.get(Calendar.DATE)));
320   - //结束时间
321   - c.setTime(end);
322   - pkt.data[5] = WGUtils.toHex(String.valueOf(c.get(Calendar.YEAR)).substring(0,2));
323   - pkt.data[6] = WGUtils.toHex(String.valueOf(c.get(Calendar.YEAR)).substring(2,4));
324   - pkt.data[7] = WGUtils.toHex(String.valueOf(c.get(Calendar.MONTH)+1));
325   - pkt.data[8] = WGUtils.toHex(String.valueOf(c.get(Calendar.DATE)));
326   - //星期几 有效
327   - pkt.data[9] = WGUtils.toHex(String.valueOf(isMonDay));
328   - pkt.data[10] = WGUtils.toHex(String.valueOf(isTuesDay));
329   - pkt.data[11] = WGUtils.toHex(String.valueOf(isWednesDay));
330   - pkt.data[12] = WGUtils.toHex(String.valueOf(isThursDay));
331   - pkt.data[13] = WGUtils.toHex(String.valueOf(isFriday));
332   - pkt.data[14] = WGUtils.toHex(String.valueOf(isSaturDay));
333   - pkt.data[15] = WGUtils.toHex(String.valueOf(isWeekend));
334   - //有效时区
335   - pkt.data[16] = WGUtils.toHex(shiQuArray[i * 6 + 0].substring(0, 2));
336   - pkt.data[17] = WGUtils.toHex(shiQuArray[i * 6 + 0].substring(3, 5));
337   -
338   - pkt.data[18] = WGUtils.toHex(shiQuArray[i * 6 + 1].substring(0, 2));
339   - pkt.data[19] = WGUtils.toHex(shiQuArray[i * 6 + 1].substring(3, 5));
340   -
341   - pkt.data[20] = WGUtils.toHex(shiQuArray[i * 6 + 2].substring(0, 2));
342   - pkt.data[21] = WGUtils.toHex(shiQuArray[i * 6 + 2].substring(3, 5));
343   -
344   - pkt.data[22] = WGUtils.toHex(shiQuArray[i * 6 + 3].substring(0, 2));
345   - pkt.data[23] = WGUtils.toHex(shiQuArray[i * 6 + 3].substring(3, 5));
346   -
347   - pkt.data[24] = WGUtils.toHex(shiQuArray[i * 6 + 4].substring(0, 2));
348   - pkt.data[25] = WGUtils.toHex(shiQuArray[i * 6 + 4].substring(3, 5));
349   -
350   - pkt.data[26] = WGUtils.toHex(shiQuArray[i * 6 + 5].substring(0, 2));
351   - pkt.data[27] = WGUtils.toHex(shiQuArray[i * 6 + 5].substring(3, 5));
352   - if (shiDuanCount != 1) {
353   - //需要链接时段
354   - if (i != shiDuanCount - 1) {
355   - //只要不是最后一个时段
356   - pkt.data[28] = WGUtils.toHex((shiduan+20*(i+1)+""));
357   - } else {
358   - pkt.data[28] = 0;
359   - }
360   - } else {
361   - pkt.data[28] = 0;
362   - }
363   - byte[] bytes = pkt.toByte();
364   - long index = WgUdpCommShort.getXidOfCommand(bytes);
365   - long result = insert(sno+"",outsideOrderId,null,index,bytes);
366   - pkt.run(watchingShortHandler.getSessionMap().get(sno),bytes);
367   - resultList.add(result);
368   - }
369   - return resultList ;
370   - }catch (Exception e){
371   - Log_error.error(e.toString());
372   - }
373   - return resultList;
374   - }
375   -
376   - //设置权限
377   - public long SetSignalCardInfo(long sno , String outsideOrderId, String cardNo , int shiduan , Date begin , Date end){
378   - WgUdpCommShort pkt = new WgUdpCommShort();
379   - pkt.iDevSn = sno;
380   - try{
381   - pkt.Reset();
382   - pkt.functionID = WGUtils.toFunctionHex(outsideOrderId);
383   - pkt.iDevSn = sno;
384   - //0D D7 37 00
385   - pkt.data[0] = WGUtils.toHex(cardNo.substring(0,2));
386   - pkt.data[1] = WGUtils.toHex(cardNo.substring(2,4));
387   - pkt.data[2] = WGUtils.toHex(cardNo.substring(4,6));
388   - pkt.data[3] = WGUtils.toHex(cardNo.substring(6,8));
389   -
390   - //20 10 01 01 起始日期: 2010年01月01日 (必须大于2001年)
391   - Calendar c = Calendar.getInstance();
392   - c.setTime(begin);
393   - pkt.data[4] = WGUtils.toHex(String.valueOf(c.get(Calendar.YEAR)).substring(0,2));
394   - pkt.data[5] = WGUtils.toHex(String.valueOf(c.get(Calendar.YEAR)).substring(2,4));
395   - pkt.data[6] = WGUtils.toHex(String.valueOf(c.get(Calendar.MONTH)+1));
396   - pkt.data[7] = WGUtils.toHex(String.valueOf(c.get(Calendar.DATE)));
397   - //20 29 12 31 截止日期: 2029年12月31日
398   - c.setTime(end);
399   - pkt.data[8] = WGUtils.toHex(String.valueOf(c.get(Calendar.YEAR)).substring(0,2));
400   - pkt.data[9] = WGUtils.toHex(String.valueOf(c.get(Calendar.YEAR)).substring(2,4));
401   - pkt.data[10] = WGUtils.toHex(String.valueOf(c.get(Calendar.MONTH)+1));
402   - pkt.data[11] = WGUtils.toHex(String.valueOf(c.get(Calendar.DATE)));
403   - //01 允许通过 一号门 [对单门, 双门, 四门控制器有效]
404   - pkt.data[12] = WGUtils.toHex(shiduan+"");
405   - //01 允许通过 二号门 [对双门, 四门控制器有效]
406   - pkt.data[13] = WGUtils.toHex(shiduan+"");
407   - //01 允许通过 三号门 [对四门控制器有效]
408   - pkt.data[14] = WGUtils.toHex(shiduan+"");
409   - //01 允许通过 四号门 [对四门控制器有效]
410   - pkt.data[15] = WGUtils.toHex(shiduan+"");
411   - byte[] bytes = pkt.toByte();
412   - long index = WgUdpCommShort.getXidOfCommand(bytes);
413   - long result = insert(sno+"",outsideOrderId,cardNo,index,bytes);
414   - pkt.run(watchingShortHandler.getSessionMap().get(sno),bytes);
415   - return result ;
416   - }catch (Exception e){
417   - Log_error.error(e.toString());
418   - }
419   - return 0l;
420   - }
421   -
422   - //删除单张卡权限
423   - public long clearSinglePower(long sno ,String outsideOrderId, String cardNo){
424   - WgUdpCommShort pkt = new WgUdpCommShort();
425   - pkt.iDevSn = sno;
426   - try{
427   - pkt.Reset();
428   - pkt.functionID = WGUtils.toFunctionHex(outsideOrderId);
429   - pkt.iDevSn = sno;
430   - pkt.data[0] = WGUtils.toHex(cardNo.substring(0,2));
431   - pkt.data[1] = WGUtils.toHex(cardNo.substring(2,4));
432   - pkt.data[2] = WGUtils.toHex(cardNo.substring(4,6));
433   - pkt.data[3] = WGUtils.toHex(cardNo.substring(6,8));
434   - byte[] bytes = pkt.toByte();
435   - long index = WgUdpCommShort.getXidOfCommand(bytes);
436   - long result = insert(sno+"",outsideOrderId,cardNo,index,bytes);
437   - pkt.run(watchingShortHandler.getSessionMap().get(sno),bytes);
438   - return result ;
439   - }catch (Exception e){
440   - Log_error.error(e.toString());
441   - }
442   - return 0l;
443   - }
444   -
445   - //删除全部权限
446   - public long clearAllPower(long sno ,String outsideOrderId){
447   - WgUdpCommShort pkt = new WgUdpCommShort();
448   - pkt.iDevSn = sno;
449   - try{
450   - pkt.Reset();
451   - pkt.functionID = WGUtils.toFunctionHex(outsideOrderId);
452   - pkt.iDevSn = sno;
453   - pkt.data[0] = (byte) 0x55 ;
454   - pkt.data[1] = (byte) 0xAA ;
455   - pkt.data[2] = (byte) 0xAA ;
456   - pkt.data[3] = (byte) 0x55 ;
457   - byte[] bytes = pkt.toByte();
458   - long index = WgUdpCommShort.getXidOfCommand(bytes);
459   - long result = insert(sno+"",outsideOrderId,null,index,bytes);
460   - pkt.run(watchingShortHandler.getSessionMap().get(sno),bytes);
461   - return result ;
462   - }catch (Exception e){
463   - Log_error.error(e.toString());
464   - }
465   - return 0l;
466   - }
467   -
468   - //查询卡权限
469   - public long searchPower(long sno ,String outsideOrderId, String cardNo){
470   - WgUdpCommShort pkt = new WgUdpCommShort();
471   - pkt.iDevSn = sno;
472   - try{
473   - pkt.Reset();
474   - pkt.functionID = WGUtils.toFunctionHex(outsideOrderId);
475   - pkt.iDevSn = sno;
476   - pkt.data[0] = WGUtils.toHex(cardNo.substring(0,2));
477   - pkt.data[1] = WGUtils.toHex(cardNo.substring(2,4));
478   - pkt.data[2] = WGUtils.toHex(cardNo.substring(4,6));
479   - pkt.data[3] = WGUtils.toHex(cardNo.substring(6,8));
480   - byte[] bytes = pkt.toByte();
481   - long index = WgUdpCommShort.getXidOfCommand(bytes);
482   - long result = insert(sno+"",outsideOrderId,cardNo,index,bytes);
483   - pkt.run(watchingShortHandler.getSessionMap().get(sno),bytes);
484   - return result ;
485   - }catch (Exception e){
486   - Log_error.error(e.toString());
487   - }
488   - return 0l;
489   - }
490   -
491   - //删除时段
492   - public long clearShiDuan(long sno , String outsideOrderId){
493   - WgUdpCommShort pkt = new WgUdpCommShort();
494   - pkt.iDevSn = sno;
495   - try{
496   - pkt.Reset();
497   - pkt.functionID = WGUtils.toFunctionHex(outsideOrderId);
498   - pkt.iDevSn = sno;
499   - pkt.data[0] = (byte) 0x55 ;
500   - pkt.data[1] = (byte) 0xAA ;
501   - pkt.data[2] = (byte) 0xAA ;
502   - pkt.data[3] = (byte) 0x55 ;
503   - byte[] bytes = pkt.toByte();
504   - long index = WgUdpCommShort.getXidOfCommand(bytes);
505   - long result = insert(sno+"",outsideOrderId,null,index,bytes);
506   - pkt.run(watchingShortHandler.getSessionMap().get(sno),bytes);
507   - return result ;
508   - }catch (Exception e){
509   - Log_error.error(e.toString());
510   - }
511   - return 0l;
512   - }
513   -
514   - private long insert(String sn ,String functionId , String cardNo , long index , byte[] recv){
515   -
516   - StringBuffer send = new StringBuffer();
517   - for(byte b : recv){
518   - send.append(WGUtils.byte2Hex(b)).append("-");
519   - }
520   - SendMessageDto sendMessage = new SendMessageDto();
521   - sendMessage.setDeviceId(sn);
522   - sendMessage.setFunctionId(Integer.toHexString(Integer.valueOf(functionId)));
523   - sendMessage.setIndex(index);
524   - sendMessage.setCardNo(cardNo);
525   - sendMessage.setCreateTime(new Date());
526   - sendMessage.setSend(send.toString().substring(0,send.toString().length()-1));
527   - xaFeign.insertMessage(sendMessage);
528   - return sendMessage.getId();
529   - }
530   -}
cloud/weigeng/src/main/java/com/sincere/weigeng/WeigengApplication.java
... ... @@ -1,13 +0,0 @@
1   -package com.sincere.weigeng;
2   -
3   -import org.springframework.boot.SpringApplication;
4   -import org.springframework.boot.autoconfigure.SpringBootApplication;
5   -
6   -@SpringBootApplication
7   -public class WeigengApplication {
8   -
9   - public static void main(String[] args) {
10   - SpringApplication.run(WeigengApplication.class, args);
11   - }
12   -
13   -}
cloud/weigeng/src/main/java/com/sincere/weigeng/dao/UserDao.java
... ... @@ -1,29 +0,0 @@
1   -package com.sincere.weigeng.dao;
2   -
3   -import com.sincere.weigeng.JiaoCai;
4   -import com.sincere.weigeng.Knowledge;
5   -import org.apache.ibatis.annotations.*;
6   -import org.springframework.stereotype.Repository;
7   -
8   -import java.util.List;
9   -
10   -@Repository
11   -@Mapper
12   -public interface UserDao {
13   -
14   -// @Insert("insert into HS_StudentUpdateCard (Card,SchoolId,StudentCode,CustomerId,StudentType,UserType,ClassId,ClassName,IsNew,UpdateType,AddTime) " +
15   -// "values (#{Card},#{SchoolId},#{StudentCode},#{CustomerId},#{StudentType},#{UserType},#{ClassId},#{ClassName},#{IsNew,#{UpdateType),#{AddTime}")
16   -// void addStudentUpdate(@Param("Card") String card, @Param("SchoolId") int school_id, @Param("StudentCode") String studentCode, @Param("CustomerId") String CustomerId
17   -// , @Param("StudentType") String StudentType, @Param("UserType") String UserType, @Param("ClassId") String ClassId, @Param("ClassName") String ClassName,
18   -// @Param("IsNew") String IsNew, @Param("UpdateType") String UpdateType, @Param("AddTime") String AddTime);
19   -
20   -
21   - @Select ("select * from ZY_YYKnowledge where AddTime >2019 ")
22   - List<Knowledge> getKnowledge();
23   -
24   - @Select("select * from ZY_YYJiaoCai where ID >= 26")
25   - List<JiaoCai> getJiaoCai();
26   -
27   - @Insert("insert into ZY_YYJiaoCaiAndKnowledg values(#{id},#{id1},#{i},#{i1})")
28   - void addKnowAndJicaoCai(@Param("id") String id, @Param("id1") String id1, @Param("i") int i, @Param("i1") int i1);
29   -}
cloud/weigeng/src/main/resources/application.yaml
... ... @@ -1,33 +0,0 @@
1   -server:
2   - port: 1200
3   -
4   -spring:
5   - application:
6   - name: weigen-server
7   - profiles:
8   - active: dev
9   - datasource:
10   - username: szjxtuser
11   - password: RQminVCJota3H1u8bBYH
12   - url: jdbc:sqlserver://116.62.155.137:33419;database=SmartCampus
13   - driver-class-name: com.microsoft.sqlserver.jdbc.SQLServerDriver
14   -# datasource:
15   -# username: szjxtuser
16   -# password: RQminVCJota3H1u8bBYH
17   -# url: jdbc:sqlserver://116.62.155.137:33419;database=SmartAdmin
18   -
19   -eureka:
20   - instance:
21   - hostname: localhost
22   - lease-expiration-duration-in-seconds: 60
23   - lease-renewal-interval-in-seconds: 10
24   - client:
25   - service-url:
26   - # defaultZone: http://localhost:8761/eureka/
27   - defaultZone: http://121.40.109.21:8761/eureka/,http://121.40.109.21:8762/eureka/
28   -
29   -
30   -mybatis:
31   - type-aliases-package: com.sincere.weigeng.dao
32   - mapper-locations: classpath:mapper/*.xml
33   - config-location: classpath:mybatis-config.xml
cloud/weigeng/src/main/resources/mybatis-config.xml
... ... @@ -1,35 +0,0 @@
1   -<?xml version="1.0" encoding="UTF-8"?>
2   -<!DOCTYPE configuration
3   - PUBLIC "-//mybatis.org//DTD Config 3.0//EN"
4   - "http://mybatis.org/dtd/mybatis-3-config.dtd">
5   -
6   -<configuration>
7   - <properties >
8   - <property name="dialect" value="mysql" />
9   - </properties>
10   - <settings>
11   - <!-- 这个配置使全局的映射器启用或禁用缓存。系统默认值是true,设置只是为了展示出来 -->
12   - <setting name="cacheEnabled" value="true" />
13   - <!-- 全局启用或禁用延迟加载。当禁用时,所有关联对象都会即时加载。 系统默认值是true,设置只是为了展示出来 -->
14   - <setting name="lazyLoadingEnabled" value="true" />
15   - <!-- 允许或不允许多种结果集从一个单独的语句中返回(需要适合的驱动)。 系统默认值是true,设置只是为了展示出来 -->
16   - <setting name="multipleResultSetsEnabled" value="true" />
17   - <!--使用列标签代替列名。不同的驱动在这方便表现不同。参考驱动文档或充分测试两种方法来决定所使用的驱动。 系统默认值是true,设置只是为了展示出来 -->
18   - <setting name="useColumnLabel" value="true" />
19   - <!--允许 JDBC 支持生成的键。需要适合的驱动。如果设置为 true 则这个设置强制生成的键被使用,尽管一些驱动拒绝兼容但仍然有效(比如
20   - Derby)。 系统默认值是false,设置只是为了展示出来 -->
21   - <setting name="useGeneratedKeys" value="false" />
22   - <!--配置默认的执行器。SIMPLE 执行器没有什么特别之处。REUSE 执行器重用预处理语句。BATCH 执行器重用语句和批量更新 系统默认值是SIMPLE,设置只是为了展示出来 -->
23   - <setting name="defaultExecutorType" value="SIMPLE" />
24   - <!--设置超时时间,它决定驱动等待一个数据库响应的时间。 系统默认值是null,设置只是为了展示出来 -->
25   - <setting name="defaultStatementTimeout" value="25000" />
26   - </settings>
27   -
28   - <!--<typeAliases>-->
29   - <!--<typeAlias alias="user" type="com.shunzhi.mqtt2kanban.bean.User"/>-->
30   - <!--</typeAliases>-->
31   -
32   - <!--<mappers>-->
33   - <!--<control resource="mybatis/control/UserMapper.xml"/>-->
34   - <!--</mappers>-->
35   -</configuration>
cloud/weigeng/src/test/java/com/sincere/weigeng/WeigengApplicationTests.java
... ... @@ -1,570 +0,0 @@
1   -package com.sincere.weigeng;
2   -
3   -import com.drew.imaging.jpeg.JpegMetadataReader;
4   -import com.drew.imaging.jpeg.JpegProcessingException;
5   -import com.drew.metadata.Directory;
6   -import com.drew.metadata.Metadata;
7   -import com.drew.metadata.Tag;
8   -import com.drew.metadata.exif.ExifDirectory;
9   -import com.sincere.weigeng.dao.UserDao;
10   -import org.apache.poi.hssf.usermodel.HSSFCell;
11   -import org.apache.poi.hssf.usermodel.HSSFRow;
12   -import org.apache.poi.hssf.usermodel.HSSFSheet;
13   -import org.apache.poi.hssf.usermodel.HSSFWorkbook;
14   -import org.json.JSONArray;
15   -import org.json.JSONObject;
16   -import org.junit.Test;
17   -import org.junit.runner.RunWith;
18   -import org.springframework.beans.factory.annotation.Autowired;
19   -import org.springframework.boot.test.context.SpringBootTest;
20   -import org.springframework.http.HttpEntity;
21   -import org.springframework.http.HttpHeaders;
22   -import org.springframework.http.MediaType;
23   -import org.springframework.http.ResponseEntity;
24   -import org.springframework.test.context.junit4.SpringRunner;
25   -import org.springframework.util.LinkedMultiValueMap;
26   -import org.springframework.util.MultiValueMap;
27   -import org.springframework.web.client.RestTemplate;
28   -
29   -import javax.imageio.ImageIO;
30   -import java.awt.*;
31   -import java.awt.image.BufferedImage;
32   -import java.io.*;
33   -import java.text.SimpleDateFormat;
34   -import java.util.*;
35   -import java.util.List;
36   -
37   -@RunWith(SpringRunner.class)
38   -@SpringBootTest
39   -public class WeigengApplicationTests {
40   -
41   - @Autowired
42   - TestDao testDao;
43   -
44   - @Test
45   - public void contextLoads() {
46   -
47   - try {
48   - BufferedReader bufferedReader = new BufferedReader(new FileReader("C:\\Users\\taohandong\\Desktop\\json.txt"));
49   - String content = null;
50   - StringBuilder stringBuilder = new StringBuilder();
51   - while ((content = bufferedReader.readLine()) != null) {
52   - stringBuilder.append(content);
53   - }
54   -
55   - JSONObject jsonObject = new JSONObject(stringBuilder.toString());
56   - JSONObject data = jsonObject.optJSONObject("data");
57   - JSONArray questions = data.optJSONArray("questions");
58   - for (int i = 0; i < questions.length(); i++) {
59   - JSONObject question = questions.optJSONObject(i);
60   - String question_text = question.optString("question_text");
61   - String answer = question.optString("answer");//答案
62   - String explanation = question.optString("explanation");//解析
63   -// <p><img src="/Web/Assets/ueditor/asp/upload/image/20190916/15686369926495741.png" title="image.png" alt="image.png"/></p>
64   - explanation = "<p><img src=\"" + explanation + "\" title=\"image.png\" alt=\"image.png\"/></p>";
65   - answer = getAnswer(answer);
66   - System.out.println("question_text:" + question_text + "\r\nanswer:" + answer + "\r\nexplanation:" + explanation);
67   - List<QuestionBean> questionBeans = testDao.getQuestions(question_text);//获取题目
68   - for (int j = 0; j < questionBeans.size(); j++) {
69   - QuestionBean questionBean = questionBeans.get(j);
70   - testDao.updateQuestion(questionBean.getID(), answer, explanation);
71   - }
72   -// System.out.println(questionBeans.toString());
73   - }
74   -
75   - } catch (FileNotFoundException e) {
76   - e.printStackTrace();
77   - } catch (IOException e) {
78   - e.printStackTrace();
79   - }
80   -
81   - }
82   -
83   - private String url = "https://aip.baidubce.com/rest/2.0/ocr/v1/general_basic?access_token=24.26683b650b73b63e0b08afa7ac36e880.2592000.1571310480.282335-15990462";
84   -
85   - private String getAnswer(String imgUrl) {
86   - RestTemplate restTemplate = new RestTemplate();
87   -
88   - HttpHeaders headers = new HttpHeaders();
89   - headers.setContentType(MediaType.APPLICATION_FORM_URLENCODED);
90   -
91   - MultiValueMap<String, String> multiValueMap = new LinkedMultiValueMap<>();
92   -// multiValueMap.add("image", ImageUtils.ImageToBase64ByLocal("C:\\Users\\taohandong\\Desktop\\识别.png"));
93   - multiValueMap.add("url", imgUrl);
94   - HttpEntity<MultiValueMap> requestEntity = new HttpEntity<MultiValueMap>(multiValueMap,
95   -
96   - headers);
97   -
98   - ResponseEntity<String> result = restTemplate.postForEntity(url, requestEntity, String.class);
99   -
100   - JSONObject jsonObject = new JSONObject(result.getBody());
101   -// System.out.println("result:"+result.getBody());
102   - JSONArray words_result = jsonObject.optJSONArray("words_result");
103   -// System.out.println("words_result:"+words_result);
104   - StringBuilder stringBuilder = new StringBuilder();
105   - if (words_result != null) {
106   - for (int i = 0; i < words_result.length(); i++) {
107   - String words = words_result.optJSONObject(i).optString("words");
108   - stringBuilder.append(words + " ");
109   - }
110   - System.out.println("result:" + stringBuilder.toString());
111   - }
112   - return stringBuilder.toString().equals("") ? "B" : stringBuilder.toString();
113   - }
114   -
115   - @Test
116   - public void get() {
117   -
118   -// String url = "https://zujuan.21cnjy.com/api/question/list?xd=1&chid=3&categories=3877&knowledges=&question_channel_type=1&difficult_index=&exam_type=&kid_num=&grade_id=&sort_field=time&filterquestion=0&page=&_grade_id=&tree_type=category&version_id=&_=1568766250186";
119   -// RestTemplate restTemplate = new RestTemplate();
120   -// System.out.println(restTemplate.getForObject(url, String.class));
121   - /*String createrUserId = "zy273789", time = "2019-10-08";
122   - List<TestPaper> testPaperList = testDao.getTestPapers(createrUserId, time);
123   - for (int i = 0; i < testPaperList.size(); i++) {
124   - TestPaper testPaper = testPaperList.get(i);
125   - int schoolId = 11;
126   - testDao.addTestPaper("zy284782", testPaper.getQuestionIds(), testPaper.getStatus(), testPaper.getPublishTime(),
127   - testPaper.getName(), testPaper.getIsRecommend(), testPaper.getState(), testPaper.getIntime(), schoolId + "");
128   -
129   - }*/
130   -
131   - }
132   -
133   -
134   - /**
135   - * 创建试卷
136   - */
137   - @Test
138   - public void createTestPaper() {
139   - String createUserId = "zy309728";
140   - List<TestPaper> testPaperList = testDao.getTestPapers(createUserId, "2019-09-18 16:00:00");
141   - System.out.println("testPaperList:" + testPaperList.toString());
142   -
143   - String addCreateUserId = "zy411337", SchoolId = "885";
144   - /* for (int i = 1; i < testPaperList.size(); i++) {
145   - TestPaper testPaper = testPaperList.get(i);
146   - int ID = testPaper.getID();
147   - //添加试卷
148   - testDao.addTestPaper(addCreateUserId, testPaper.getQuestionIds(), testPaper.getStatus(), testPaper.getPublishTime()
149   - , testPaper.getName(), testPaper.getIsRecommend(), testPaper.getState(), testPaper.getIntime(), SchoolId);
150   -
151   - //发布作业
152   - testDao.addHomework(addCreateUserId, testPaper.getID(), testPaper.getName(), "50", "2019-09-20 18:00", "2", "2019-09-19 19:10", 1, 0, 1, "2019-09-19 19:10", 0, testPaper.getQuestionIds(), 0, 0);
153   - }*/
154   - /*String[] answers = new String[]{"A", "B", "C", "D"};
155   - String QuestionType = "1";
156   - String CorrectAnswer = "";
157   - List<Homework> homeworkList = testDao.getHomeWork(addCreateUserId);
158   - for (int i = 0; i < homeworkList.size(); i++) {
159   - Homework homework = homeworkList.get(i);
160   - String[] questionIds = homework.getQuestionIds().split(",");
161   - for (int j = 0; j < questionIds.length; j++) {
162   - String questionId = questionIds[j];
163   - QuestionBean questionBean = testDao.getQues(questionId);
164   - CorrectAnswer = questionBean.getCorrectAnswer();
165   - String answer = answers[new Random().nextInt(4)];
166   - String IsCorresct = answer.trim().equals(CorrectAnswer.trim()) ? "1" : "3";
167   - testDao.StudentAnswer(questionId, answer, CorrectAnswer, QuestionType, IsCorresct, homework.getID());
168   - }
169   -
170   - }*/
171   -// if (ID <= 4191 && ID >= 4187) {
172   - String classId = "36398";
173   - List<Homework> homeworkList = testDao.getHomeWork(addCreateUserId);
174   - for (int i = 0; i < homeworkList.size(); i++) {
175   - String workId = homeworkList.get(i).getID();
176   -// List<String> stuAnsIds = testDao.getStudentAnsIds(workId);
177   -// String stuAnIds = stuAnsIds.toString().replace("[", "");
178   -// stuAnIds = stuAnIds.replace("]", "");
179   -
180   - List<String> strings = testDao.getStudentIdsWithClassId(classId);
181   - String stuIds = strings.toString().replace("[", "");
182   - stuIds = stuIds.replace("]", "");
183   - String[] stuStrings = stuIds.split(",");//学生id
184   -
185   - for (int j = 0; j < stuStrings.length; j++) {
186   - String studentId = stuStrings[j];
187   -
188   - testDao.HomeworkReceive(workId, classId, studentId, "", "1", j + "", "2019-09-23 21:28:00", "2019-09-22 17:50:00", "1", j + "");
189   - }
190   -
191   - }
192   -
193   - }
194   -
195   - @Autowired
196   - UserDao userDao;
197   -
198   - @Test
199   - public void doHomeWork() {
200   - StudentBean studentBean = new StudentBean();
201   - studentBean.setCard("9A1229A9");
202   - studentBean.setSchool_id(110);
203   - studentBean.setStudentCode("140881200710270056");
204   - studentBean.setCustomerId("583912");
205   -
206   -// userDao.addStudentUpdate(studentBean.getCard(),studentBean.getSchool_id(),studentBean.getStudentCode(),studentBean.getCustomerId(),"1","2"
207   -// ,"55640","2014级(08)班","0","1","2019-09-22 16:26");
208   -
209   - /* String QuestionId = "21656, 21657, 21658, 21659, 21753, 21706, 21724, 21796, 21797, 21798";
210   - String Answer = "";
211   - String CorrectAnswer = "";
212   - String QuestionType = "1";
213   - String IsCorresct = "";
214   - String WorkID = "4198";
215   - String[] questionIds = QuestionId.split(",");
216   - for (int i = 0; i < questionIds.length; i++) {
217   - String questionId = questionIds[i];
218   - QuestionBean questionBean = testDao.getQues(questionId);
219   - CorrectAnswer = questionBean.getCorrectAnswer();
220   - Answer = "B";
221   - IsCorresct = Answer.trim().equals(CorrectAnswer.trim()) ? "1" : "3";
222   - testDao.StudentAnswer(questionId, Answer, CorrectAnswer, QuestionType, IsCorresct, WorkID);
223   - }*/
224   -
225   - }
226   -
227   -
228   - @Test
229   - public void HomeworkRec() {
230   - String WorkID = "4198";
231   - String ClassId = "";
232   - //查询学生id
233   - List<String> list = testDao.getStudentIds("4172");
234   - String StudentIds = list.toString().replace("[", "");
235   - StudentIds = StudentIds.replace("]", "");
236   - System.out.println("StudentIds:" + StudentIds);
237   - String StudnetAnswerIds = testDao.getStudentAnsIds(WorkID).toString().replace("[", "");
238   - StudnetAnswerIds = StudnetAnswerIds.replace("]", "");
239   - String[] studentIds = StudentIds.split(",");
240   - for (int i = 0; i < studentIds.length; i++) {
241   - String studentId = studentIds[i];
242   - String finishTime = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(new Date());
243   - testDao.HomeworkReceive(WorkID, ClassId, studentId, StudnetAnswerIds, "1", i + "", "2019-09-19 16:50", finishTime
244   - , "1", "" + i);
245   - }
246   - }
247   -
248   - @Test
249   - public void getQIds() {
250   -
251   - List<Knowledge> knowledges = userDao.getKnowledge();
252   - System.out.println("knowledges:" + knowledges.toString());
253   -
254   - List<JiaoCai> jiaoCais = userDao.getJiaoCai();
255   - System.out.println("jiaoCais:" + jiaoCais.toString());
256   -
257   - for (int i = 0; i < 1; i++) {
258   - JiaoCai jiaoCai = jiaoCais.get(i);
259   - String SubjectId = jiaoCai.getSubjectId();
260   - for (int j = 0; j < knowledges.size(); j++) {
261   - Knowledge knowledge = knowledges.get(j);
262   - if (SubjectId.equals(knowledge.getSubjectId())) {
263   - userDao.addKnowAndJicaoCai(jiaoCai.getID(), knowledge.getId(), 0, 1);
264   - }
265   - }
266   -
267   - }
268   -
269   - }
270   -
271   - @Test
272   - public void tongji() {
273   -
274   - String[] answers = new String[]{"A", "B", "C", "D", "A", "A"};
275   - String createUserId = "zy411337";
276   - List<Homework> homeworkList = testDao.getHomeWork(createUserId);//获取布置的作业
277   - System.out.println("homeworkList:" + homeworkList);
278   - for (int m = 0; m < homeworkList.size(); m++) {
279   - String WorkId = homeworkList.get(m).getID();
280   - Map<String, List<String>> mapRecIDs = new HashMap<>();
281   - System.out.println("workId:" + WorkId);
282   -// List<String> queIds = testDao.getStuAnsIds(WorkId);
283   -// String questionIds = queIds.toString().replace("[", "");
284   -// questionIds = questionIds.replace("]", "");
285   -
286   - //获取正确答案
287   -// List<String> correct = testDao.correctAns(WorkId);
288   -// String corrStr = correct.toString().replace("[", "");
289   -// corrStr = corrStr.replace("]", "");
290   -// String[] correctAnser = corrStr.split(",");
291   -
292   - String questionIds = testDao.getQuestionIds(WorkId);
293   -
294   - //获取答题学生数量
295   - List<String> homeworkReceiveIds = testDao.get_HomeworkReceive(WorkId, "12012");
296   - System.out.println("homeworkReceiveIds:" + homeworkReceiveIds.size());
297   - for (int j = 0; j < homeworkReceiveIds.size(); j++) {//接收学生数量
298   -
299   - String[] quesStirngs = questionIds.split(",");
300   - System.out.println("quesStirngs:" + quesStirngs.length);
301   - for (int i = 0; i < quesStirngs.length; i++) {
302   - String questionId = quesStirngs[i];
303   - String CorrectAnswer = testDao.getCorrectAnswer(questionId);
304   - int randow = new Random().nextInt(6);
305   - String answer = null;
306   - String isCorrsct = "";
307   - if (randow == 0 || randow == 1 || randow == 2 || randow == 3 || randow == 4) {
308   - answer = CorrectAnswer.trim();
309   - isCorrsct = "1";
310   - } else {
311   - answer = answers[randow];
312   - isCorrsct = "3";
313   - }
314   - //插入一条新的记录
315   - testDao.addStudentAnswer(quesStirngs[i], answer.trim(), "", CorrectAnswer.trim(), "1", "", isCorrsct, "", "", WorkId);
316   - }
317   - //获取最新的十条记录
318   - List<String> idLists = testDao.getTopIDs(WorkId, questionIds.split(",").length);
319   - System.out.println("idLists:" + idLists.toString());
320   - mapRecIDs.put(j + "", idLists);
321   - }
322   -// System.out.println("mapRecIDs:" + mapRecIDs.toString() + " 0:" + mapRecIDs.get("0").toString().replace("[", ""));
323   -
324   - for (int i = 0; i < homeworkReceiveIds.size(); i++) {
325   - String homeRecId = homeworkReceiveIds.get(i);
326   - System.out.println("i:" + i);
327   - String ansIds = mapRecIDs.get(i + "").toString().replace("[", "");
328   - ansIds = ansIds.replace("]", "");
329   - testDao.updateHomeWork(ansIds, homeRecId);
330   - }
331   -
332   - List<HomeworkReceive> homRecIDs = testDao.get_HomeworkRec(WorkId);
333   -
334   - Map<String, String> stuMap = new HashMap<>();
335   - for (int i = 0; i < homRecIDs.size(); i++) {
336   - HomeworkReceive homeworkReceive = homRecIDs.get(i);
337   -
338   - String studentId = homeworkReceive.getStudentId();
339   -
340   - String studentName = testDao.getStudentName(studentId);
341   -
342   - String studnetAnswerIds = homeworkReceive.getStudnetAnswerIds();
343   -
344   - String[] stuIds = studnetAnswerIds.split(",");
345   -
346   - String isC = "";
347   - for (int j = 0; j < stuIds.length; j++) {
348   - String id = stuIds[j];
349   - int idCorrect = testDao.getIsCorrect(id);
350   - if (idCorrect == 1) {
351   - isC += "1 ";
352   - } else if (idCorrect == 3) {
353   - isC += "0 ";
354   - }
355   - }
356   - stuMap.put(studentName, isC);
357   - System.out.println("" + studentName + " " + isC);
358   -
359   - }
360   -
361   - }
362   - }
363   -
364   - private void writeToExcel(HSSFWorkbook workbook, String HomeworkTitle, Map<String, String[]> correctAns, String[] names, String title) {
365   - //第二部,在workbook中创建一个sheet对应excel中的sheet
366   - HSSFSheet sheet = workbook.createSheet(HomeworkTitle);
367   - //第三部,在sheet表中添加表头第0行,老版本的poi对sheet的行列有限制
368   - HSSFRow row = sheet.createRow(0);
369   - //第四步,创建单元格,设置表头
370   - HSSFCell cell = null;
371   - for (int i = 0; i < correctAns.get(names[0]).length; i++) {
372   - cell = row.createCell(i);
373   - cell.setCellValue("第" + (i + 1) + "");
374   - }
375   -
376   - //第五步,写入数据
377   - for (int i = 0; i < names.length; i++) {
378   -
379   -// String oneData =correctAns[i];//姓名对应的正确率
380   - HSSFRow row1 = sheet.createRow(i + 1);
381   - String[] corrects = correctAns.get(names[i]);
382   - System.out.println("names:" + names[i]);
383   - for (int j = 0; j < corrects.length; j++) {
384   - //创建单元格设值
385   - row1.createCell(j).setCellValue(corrects[j]);
386   - }
387   - row1.createCell(corrects.length).setCellValue(names[i]);
388   - }
389   -
390   - //将文件保存到指定的位置
391   - try {
392   - File file = new File("C:\\Users\\taohandong\\Desktop\\文澜\\"+title+".xls");
393   - if (!file.exists())file.createNewFile();
394   - FileOutputStream fos = new FileOutputStream(file);
395   - workbook.write(fos);
396   - System.out.println("写入成功");
397   - fos.close();
398   - } catch (IOException e) {
399   - e.printStackTrace();
400   - }
401   -
402   - }
403   -
404   -
405   - @Test
406   - public void getStu() {
407   - //第一步,创建一个workbook对应一个excel文件
408   - HSSFWorkbook workbook = new HSSFWorkbook();
409   -
410   - String createUserId = "zy595910";
411   - String title="作业";
412   - //ZY_Homework表取出要统计的作业
413   - String WorkId = "4408";
414   - String workName = testDao.getWorkName(WorkId);
415   -
416   - //ZY_HomeworkReceive 表获取学生作业答题情况;
417   - List<HomeworkReceive> homRecIDs = testDao.get_HomeworkRec(WorkId);
418   -
419   - Map<String, String[]> stuMap = new HashMap<>();
420   - String[] names = new String[homRecIDs.size()];
421   - String[] isCorrect = null;
422   - for (int i = 0; i < homRecIDs.size(); i++) {
423   - HomeworkReceive homeworkReceive = homRecIDs.get(i);
424   -
425   - String studentId = homeworkReceive.getStudentId();
426   -
427   - String studentName = testDao.getStudentName(studentId);
428   -
429   - String studnetAnswerIds = homeworkReceive.getStudnetAnswerIds();
430   -// System.out.println("studnetAnswerIds:"+studnetAnswerIds+" WorkId:"+WorkId + " StudentId:"+studentId);
431   - if (null != studnetAnswerIds) {
432   - names[i] = studentName;
433   - String[] stuIds = studnetAnswerIds.split(",");
434   - isCorrect = new String[stuIds.length];
435   - String isC = "";
436   - for (int j = 0; j < stuIds.length; j++) {
437   - String id = stuIds[j];
438   - System.out.println("IsCorrectId:" + id);
439   - //ZY_StudentAnswer表获取题目是否正确
440   - int idCorrect = testDao.getIsCorrect(id);
441   - if (idCorrect == 1) {
442   - isC += "1 ";
443   - isCorrect[j] = "1";
444   - } else if (idCorrect == 3) {
445   - isC += "0 ";
446   - isCorrect[j] = "0";
447   - }
448   - }
449   - stuMap.put(studentName, isCorrect);
450   - System.out.println("" + studentName + " " + isC);
451   - }
452   - }
453   - if (names!=null&&stuMap.size()>0)
454   - writeToExcel(workbook, workName, stuMap, names,title);
455   -// System.out.println("stuMap:" + stuMap.toString());
456   - }
457   -
458   -
459   - /**
460   - * 旋转图片
461   - */
462   - @Test
463   - public void trnImgs() {
464   -
465   - File file = new File("C:\\TaoHandong\\copy\\school479\\StudentCompressed");
466   - File[] files = file.listFiles();
467   -
468   - List<StudentInfo> studentInfos = testDao.getStudents(479);
469   -
470   - List<StudentInfo> studentInfoList = new ArrayList<>();
471   -
472   - for (int i = 0; i < studentInfos.size(); i++) {
473   - StudentInfo studentInfo = studentInfos.get(i);
474   -
475   - boolean isHas = false;
476   - for (int j = 0; j < files.length; j++) {
477   - File img = files[j];
478   - String imgName = img.getName().split("\\.")[0];
479   -
480   - if (imgName.equals(studentInfo.getStudentcode())) {
481   - isHas = true;
482   - break;
483   - }
484   -
485   - }
486   -
487   - if (!isHas) {
488   - studentInfoList.add(studentInfo);
489   - }
490   -
491   - }
492   -
493   - System.out.println("studentInfoList:" + studentInfoList);
494   - //第一步,创建一个workbook对应一个excel文件
495   - HSSFWorkbook workbook = new HSSFWorkbook();
496   - //第二部,在workbook中创建一个sheet对应excel中的sheet
497   - HSSFSheet sheet = workbook.createSheet("缺少的学生人脸");
498   - //第三部,在sheet表中添加表头第0行,老版本的poi对sheet的行列有限制
499   - HSSFRow row = sheet.createRow(0);
500   -
501   - String[] titles = new String[]{"姓名", "班级", "学籍号", "号码"};
502   - //第四步,创建单元格,设置表头
503   - HSSFCell cell = null;
504   - for (int i = 0; i < titles.length; i++) {
505   - cell = row.createCell(i);
506   - cell.setCellValue(titles[i]);
507   - }
508   -
509   - //第五步,写入数据
510   - for (int i = 0; i < studentInfoList.size(); i++) {
511   - HSSFRow row1 = sheet.createRow(i + 1);
512   - for (int j = 0; j < titles.length; j++) {
513   - String value = studentInfoList.get(i).getClass_name();
514   - switch (j) {
515   - case 0:
516   - value = studentInfoList.get(i).getName();
517   - break;
518   - case 1:
519   - value = studentInfoList.get(i).getClass_name();
520   - break;
521   - case 2:
522   - value = studentInfoList.get(i).getStudentcode();
523   - break;
524   - case 3:
525   - value = studentInfoList.get(i).getParentMobile();
526   - break;
527   - }
528   - //创建单元格设值
529   - row1.createCell(j).setCellValue(value);
530   - }
531   - }
532   -
533   - //将文件保存到指定的位置
534   - try {
535   - FileOutputStream fos = new FileOutputStream("C:\\Users\\taohandong\\Desktop\\result.xls");
536   - workbook.write(fos);
537   - System.out.println("写入成功");
538   - fos.close();
539   - } catch (IOException e) {
540   - e.printStackTrace();
541   - }
542   -
543   - /* File file = new File("C:\\TaoHandong\\copy\\School1030\\Student");
544   -
545   - File outFile = new File("C:\\TaoHandong\\copy\\School1030\\Student1");
546   -
547   - if (!outFile.exists()) outFile.mkdirs();
548   -
549   - File[] files = file.listFiles();
550   - System.out.println("files:" + files.length);
551   - BufferedImage bufferedImage;
552   - for (int i = 0; i < files.length; i++) {
553   - File img = files[i];
554   - int ang = ImageUtils.getImgRotateAngle(img.getAbsolutePath());
555   - System.out.println(img.getName() + " ang:" + ang);
556   -// try {
557   -// bufferedImage = ImageIO.read(img);
558   -// moveImg(bufferedImage,img,outFile);
559   -// } catch (IOException e) {
560   -// e.printStackTrace();
561   -// }
562   -
563   - }*/
564   -
565   - }
566   -
567   - private List<String> name = new ArrayList<>();
568   -
569   -
570   -}