From 53777df214264641a4dd6e81e5c8c49664310406 Mon Sep 17 00:00:00 2001
From: Yuan <1450637472@qq.com>
Date: Mon, 15 Sep 2025 18:52:59 +0800
Subject: [PATCH] =?UTF-8?q?init:=E5=AE=81=E5=A4=8F=E6=AD=A6=E8=AD=A6?=
=?UTF-8?q?=E8=B7=B3=E8=BD=AC=E5=88=9D=E5=A7=8B=E5=8C=96?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.gitignore | 33 +
mvnw | 310 +++++
mvnw.cmd | 182 +++
pom.xml | 114 ++
.../com/saye/hgddmz/HgdDmzApplication.java | 13 +
.../com/saye/hgddmz/ServletInitializer.java | 13 +
.../com/saye/hgddmz/commons/JsonResult.java | 120 ++
.../hgddmz/commons/TokenGenerateUtil.java | 95 ++
.../saye/hgddmz/commons/date/DateDUtil.java | 296 +++++
.../hgddmz/commons/encrypt/EncryptUtil.java | 31 +
.../hgddmz/commons/entity/DepartEntity.java | 37 +
.../hgddmz/commons/entity/RoleEntity.java | 37 +
.../saye/hgddmz/commons/excel/ExportXLS.java | 785 ++++++++++++
.../saye/hgddmz/commons/excel/ExportXLSX.java | 790 ++++++++++++
.../commons/excel/HashMapConversionImpl.java | 27 +
.../commons/excel/IConversionByExport.java | 6 +
.../saye/hgddmz/commons/excel/IExport.java | 53 +
.../saye/hgddmz/commons/excel/ISetExport.java | 58 +
.../commons/exprot/HashMapConversionImpl.java | 27 +
.../commons/exprot/IConversionByExport.java | 6 +
.../saye/hgddmz/commons/file/FileDUtil.java | 36 +
.../hgddmz/commons/getBean/GetBeanUtil.java | 29 +
.../commons/image/ImageBase64DUtil.java | 149 +++
.../hgddmz/commons/log/ExceptionDUtil.java | 27 +
.../hgddmz/commons/string/StringDUtil.java | 415 ++++++
.../hgddmz/commons/uuid/UUIDGenerator.java | 24 +
.../hgddmz/controller/GetDateController.java | 1112 +++++++++++++++++
.../saye/hgddmz/entity/BankbillHistory.java | 143 +++
.../java/com/saye/hgddmz/testController.java | 25 +
.../com/saye/hgddmz/util/DownloadFtpUtil.java | 301 +++++
src/main/resources/application.yml | 11 +
src/main/resources/templates/index.html | 10 +
.../com/saye/hgddmz/FtpConnectionTest.java | 312 +++++
.../saye/hgddmz/HgdDmzApplicationTests.java | 13 +
34 files changed, 5640 insertions(+)
create mode 100644 .gitignore
create mode 100644 mvnw
create mode 100644 mvnw.cmd
create mode 100644 pom.xml
create mode 100644 src/main/java/com/saye/hgddmz/HgdDmzApplication.java
create mode 100644 src/main/java/com/saye/hgddmz/ServletInitializer.java
create mode 100644 src/main/java/com/saye/hgddmz/commons/JsonResult.java
create mode 100644 src/main/java/com/saye/hgddmz/commons/TokenGenerateUtil.java
create mode 100644 src/main/java/com/saye/hgddmz/commons/date/DateDUtil.java
create mode 100644 src/main/java/com/saye/hgddmz/commons/encrypt/EncryptUtil.java
create mode 100644 src/main/java/com/saye/hgddmz/commons/entity/DepartEntity.java
create mode 100644 src/main/java/com/saye/hgddmz/commons/entity/RoleEntity.java
create mode 100644 src/main/java/com/saye/hgddmz/commons/excel/ExportXLS.java
create mode 100644 src/main/java/com/saye/hgddmz/commons/excel/ExportXLSX.java
create mode 100644 src/main/java/com/saye/hgddmz/commons/excel/HashMapConversionImpl.java
create mode 100644 src/main/java/com/saye/hgddmz/commons/excel/IConversionByExport.java
create mode 100644 src/main/java/com/saye/hgddmz/commons/excel/IExport.java
create mode 100644 src/main/java/com/saye/hgddmz/commons/excel/ISetExport.java
create mode 100644 src/main/java/com/saye/hgddmz/commons/exprot/HashMapConversionImpl.java
create mode 100644 src/main/java/com/saye/hgddmz/commons/exprot/IConversionByExport.java
create mode 100644 src/main/java/com/saye/hgddmz/commons/file/FileDUtil.java
create mode 100644 src/main/java/com/saye/hgddmz/commons/getBean/GetBeanUtil.java
create mode 100644 src/main/java/com/saye/hgddmz/commons/image/ImageBase64DUtil.java
create mode 100644 src/main/java/com/saye/hgddmz/commons/log/ExceptionDUtil.java
create mode 100644 src/main/java/com/saye/hgddmz/commons/string/StringDUtil.java
create mode 100644 src/main/java/com/saye/hgddmz/commons/uuid/UUIDGenerator.java
create mode 100644 src/main/java/com/saye/hgddmz/controller/GetDateController.java
create mode 100644 src/main/java/com/saye/hgddmz/entity/BankbillHistory.java
create mode 100644 src/main/java/com/saye/hgddmz/testController.java
create mode 100644 src/main/java/com/saye/hgddmz/util/DownloadFtpUtil.java
create mode 100644 src/main/resources/application.yml
create mode 100644 src/main/resources/templates/index.html
create mode 100644 src/test/java/com/saye/hgddmz/FtpConnectionTest.java
create mode 100644 src/test/java/com/saye/hgddmz/HgdDmzApplicationTests.java
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..549e00a
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,33 @@
+HELP.md
+target/
+!.mvn/wrapper/maven-wrapper.jar
+!**/src/main/**/target/
+!**/src/test/**/target/
+
+### STS ###
+.apt_generated
+.classpath
+.factorypath
+.project
+.settings
+.springBeans
+.sts4-cache
+
+### IntelliJ IDEA ###
+.idea
+*.iws
+*.iml
+*.ipr
+
+### NetBeans ###
+/nbproject/private/
+/nbbuild/
+/dist/
+/nbdist/
+/.nb-gradle/
+build/
+!**/src/main/**/build/
+!**/src/test/**/build/
+
+### VS Code ###
+.vscode/
diff --git a/mvnw b/mvnw
new file mode 100644
index 0000000..a16b543
--- /dev/null
+++ b/mvnw
@@ -0,0 +1,310 @@
+#!/bin/sh
+# ----------------------------------------------------------------------------
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# https://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+# ----------------------------------------------------------------------------
+
+# ----------------------------------------------------------------------------
+# Maven Start Up Batch script
+#
+# Required ENV vars:
+# ------------------
+# JAVA_HOME - location of a JDK home dir
+#
+# Optional ENV vars
+# -----------------
+# M2_HOME - location of maven2's installed home dir
+# MAVEN_OPTS - parameters passed to the Java VM when running Maven
+# e.g. to debug Maven itself, use
+# set MAVEN_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000
+# MAVEN_SKIP_RC - flag to disable loading of mavenrc files
+# ----------------------------------------------------------------------------
+
+if [ -z "$MAVEN_SKIP_RC" ] ; then
+
+ if [ -f /etc/mavenrc ] ; then
+ . /etc/mavenrc
+ fi
+
+ if [ -f "$HOME/.mavenrc" ] ; then
+ . "$HOME/.mavenrc"
+ fi
+
+fi
+
+# OS specific support. $var _must_ be set to either true or false.
+cygwin=false;
+darwin=false;
+mingw=false
+case "`uname`" in
+ CYGWIN*) cygwin=true ;;
+ MINGW*) mingw=true;;
+ Darwin*) darwin=true
+ # Use /usr/libexec/java_home if available, otherwise fall back to /Library/Java/Home
+ # See https://developer.apple.com/library/mac/qa/qa1170/_index.html
+ if [ -z "$JAVA_HOME" ]; then
+ if [ -x "/usr/libexec/java_home" ]; then
+ export JAVA_HOME="`/usr/libexec/java_home`"
+ else
+ export JAVA_HOME="/Library/Java/Home"
+ fi
+ fi
+ ;;
+esac
+
+if [ -z "$JAVA_HOME" ] ; then
+ if [ -r /etc/gentoo-release ] ; then
+ JAVA_HOME=`java-config --jre-home`
+ fi
+fi
+
+if [ -z "$M2_HOME" ] ; then
+ ## resolve links - $0 may be a link to maven's home
+ PRG="$0"
+
+ # need this for relative symlinks
+ while [ -h "$PRG" ] ; do
+ ls=`ls -ld "$PRG"`
+ link=`expr "$ls" : '.*-> \(.*\)$'`
+ if expr "$link" : '/.*' > /dev/null; then
+ PRG="$link"
+ else
+ PRG="`dirname "$PRG"`/$link"
+ fi
+ done
+
+ saveddir=`pwd`
+
+ M2_HOME=`dirname "$PRG"`/..
+
+ # make it fully qualified
+ M2_HOME=`cd "$M2_HOME" && pwd`
+
+ cd "$saveddir"
+ # echo Using m2 at $M2_HOME
+fi
+
+# For Cygwin, ensure paths are in UNIX format before anything is touched
+if $cygwin ; then
+ [ -n "$M2_HOME" ] &&
+ M2_HOME=`cygpath --unix "$M2_HOME"`
+ [ -n "$JAVA_HOME" ] &&
+ JAVA_HOME=`cygpath --unix "$JAVA_HOME"`
+ [ -n "$CLASSPATH" ] &&
+ CLASSPATH=`cygpath --path --unix "$CLASSPATH"`
+fi
+
+# For Mingw, ensure paths are in UNIX format before anything is touched
+if $mingw ; then
+ [ -n "$M2_HOME" ] &&
+ M2_HOME="`(cd "$M2_HOME"; pwd)`"
+ [ -n "$JAVA_HOME" ] &&
+ JAVA_HOME="`(cd "$JAVA_HOME"; pwd)`"
+fi
+
+if [ -z "$JAVA_HOME" ]; then
+ javaExecutable="`which javac`"
+ if [ -n "$javaExecutable" ] && ! [ "`expr \"$javaExecutable\" : '\([^ ]*\)'`" = "no" ]; then
+ # readlink(1) is not available as standard on Solaris 10.
+ readLink=`which readlink`
+ if [ ! `expr "$readLink" : '\([^ ]*\)'` = "no" ]; then
+ if $darwin ; then
+ javaHome="`dirname \"$javaExecutable\"`"
+ javaExecutable="`cd \"$javaHome\" && pwd -P`/javac"
+ else
+ javaExecutable="`readlink -f \"$javaExecutable\"`"
+ fi
+ javaHome="`dirname \"$javaExecutable\"`"
+ javaHome=`expr "$javaHome" : '\(.*\)/bin'`
+ JAVA_HOME="$javaHome"
+ export JAVA_HOME
+ fi
+ fi
+fi
+
+if [ -z "$JAVACMD" ] ; then
+ if [ -n "$JAVA_HOME" ] ; then
+ if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
+ # IBM's JDK on AIX uses strange locations for the executables
+ JAVACMD="$JAVA_HOME/jre/sh/java"
+ else
+ JAVACMD="$JAVA_HOME/bin/java"
+ fi
+ else
+ JAVACMD="`which java`"
+ fi
+fi
+
+if [ ! -x "$JAVACMD" ] ; then
+ echo "Error: JAVA_HOME is not defined correctly." >&2
+ echo " We cannot execute $JAVACMD" >&2
+ exit 1
+fi
+
+if [ -z "$JAVA_HOME" ] ; then
+ echo "Warning: JAVA_HOME environment variable is not set."
+fi
+
+CLASSWORLDS_LAUNCHER=org.codehaus.plexus.classworlds.launcher.Launcher
+
+# traverses directory structure from process work directory to filesystem root
+# first directory with .mvn subdirectory is considered project base directory
+find_maven_basedir() {
+
+ if [ -z "$1" ]
+ then
+ echo "Path not specified to find_maven_basedir"
+ return 1
+ fi
+
+ basedir="$1"
+ wdir="$1"
+ while [ "$wdir" != '/' ] ; do
+ if [ -d "$wdir"/.mvn ] ; then
+ basedir=$wdir
+ break
+ fi
+ # workaround for JBEAP-8937 (on Solaris 10/Sparc)
+ if [ -d "${wdir}" ]; then
+ wdir=`cd "$wdir/.."; pwd`
+ fi
+ # end of workaround
+ done
+ echo "${basedir}"
+}
+
+# concatenates all lines of a file
+concat_lines() {
+ if [ -f "$1" ]; then
+ echo "$(tr -s '\n' ' ' < "$1")"
+ fi
+}
+
+BASE_DIR=`find_maven_basedir "$(pwd)"`
+if [ -z "$BASE_DIR" ]; then
+ exit 1;
+fi
+
+##########################################################################################
+# Extension to allow automatically downloading the maven-wrapper.jar from Maven-central
+# This allows using the maven wrapper in projects that prohibit checking in binary data.
+##########################################################################################
+if [ -r "$BASE_DIR/.mvn/wrapper/maven-wrapper.jar" ]; then
+ if [ "$MVNW_VERBOSE" = true ]; then
+ echo "Found .mvn/wrapper/maven-wrapper.jar"
+ fi
+else
+ if [ "$MVNW_VERBOSE" = true ]; then
+ echo "Couldn't find .mvn/wrapper/maven-wrapper.jar, downloading it ..."
+ fi
+ if [ -n "$MVNW_REPOURL" ]; then
+ jarUrl="$MVNW_REPOURL/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar"
+ else
+ jarUrl="https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar"
+ fi
+ while IFS="=" read key value; do
+ case "$key" in (wrapperUrl) jarUrl="$value"; break ;;
+ esac
+ done < "$BASE_DIR/.mvn/wrapper/maven-wrapper.properties"
+ if [ "$MVNW_VERBOSE" = true ]; then
+ echo "Downloading from: $jarUrl"
+ fi
+ wrapperJarPath="$BASE_DIR/.mvn/wrapper/maven-wrapper.jar"
+ if $cygwin; then
+ wrapperJarPath=`cygpath --path --windows "$wrapperJarPath"`
+ fi
+
+ if command -v wget > /dev/null; then
+ if [ "$MVNW_VERBOSE" = true ]; then
+ echo "Found wget ... using wget"
+ fi
+ if [ -z "$MVNW_USERNAME" ] || [ -z "$MVNW_PASSWORD" ]; then
+ wget "$jarUrl" -O "$wrapperJarPath"
+ else
+ wget --http-user=$MVNW_USERNAME --http-password=$MVNW_PASSWORD "$jarUrl" -O "$wrapperJarPath"
+ fi
+ elif command -v curl > /dev/null; then
+ if [ "$MVNW_VERBOSE" = true ]; then
+ echo "Found curl ... using curl"
+ fi
+ if [ -z "$MVNW_USERNAME" ] || [ -z "$MVNW_PASSWORD" ]; then
+ curl -o "$wrapperJarPath" "$jarUrl" -f
+ else
+ curl --user $MVNW_USERNAME:$MVNW_PASSWORD -o "$wrapperJarPath" "$jarUrl" -f
+ fi
+
+ else
+ if [ "$MVNW_VERBOSE" = true ]; then
+ echo "Falling back to using Java to download"
+ fi
+ javaClass="$BASE_DIR/.mvn/wrapper/MavenWrapperDownloader.java"
+ # For Cygwin, switch paths to Windows format before running javac
+ if $cygwin; then
+ javaClass=`cygpath --path --windows "$javaClass"`
+ fi
+ if [ -e "$javaClass" ]; then
+ if [ ! -e "$BASE_DIR/.mvn/wrapper/MavenWrapperDownloader.class" ]; then
+ if [ "$MVNW_VERBOSE" = true ]; then
+ echo " - Compiling MavenWrapperDownloader.java ..."
+ fi
+ # Compiling the Java class
+ ("$JAVA_HOME/bin/javac" "$javaClass")
+ fi
+ if [ -e "$BASE_DIR/.mvn/wrapper/MavenWrapperDownloader.class" ]; then
+ # Running the downloader
+ if [ "$MVNW_VERBOSE" = true ]; then
+ echo " - Running MavenWrapperDownloader.java ..."
+ fi
+ ("$JAVA_HOME/bin/java" -cp .mvn/wrapper MavenWrapperDownloader "$MAVEN_PROJECTBASEDIR")
+ fi
+ fi
+ fi
+fi
+##########################################################################################
+# End of extension
+##########################################################################################
+
+export MAVEN_PROJECTBASEDIR=${MAVEN_BASEDIR:-"$BASE_DIR"}
+if [ "$MVNW_VERBOSE" = true ]; then
+ echo $MAVEN_PROJECTBASEDIR
+fi
+MAVEN_OPTS="$(concat_lines "$MAVEN_PROJECTBASEDIR/.mvn/jvm.config") $MAVEN_OPTS"
+
+# For Cygwin, switch paths to Windows format before running java
+if $cygwin; then
+ [ -n "$M2_HOME" ] &&
+ M2_HOME=`cygpath --path --windows "$M2_HOME"`
+ [ -n "$JAVA_HOME" ] &&
+ JAVA_HOME=`cygpath --path --windows "$JAVA_HOME"`
+ [ -n "$CLASSPATH" ] &&
+ CLASSPATH=`cygpath --path --windows "$CLASSPATH"`
+ [ -n "$MAVEN_PROJECTBASEDIR" ] &&
+ MAVEN_PROJECTBASEDIR=`cygpath --path --windows "$MAVEN_PROJECTBASEDIR"`
+fi
+
+# Provide a "standardized" way to retrieve the CLI args that will
+# work with both Windows and non-Windows executions.
+MAVEN_CMD_LINE_ARGS="$MAVEN_CONFIG $@"
+export MAVEN_CMD_LINE_ARGS
+
+WRAPPER_LAUNCHER=org.apache.maven.wrapper.MavenWrapperMain
+
+exec "$JAVACMD" \
+ $MAVEN_OPTS \
+ -classpath "$MAVEN_PROJECTBASEDIR/.mvn/wrapper/maven-wrapper.jar" \
+ "-Dmaven.home=${M2_HOME}" "-Dmaven.multiModuleProjectDirectory=${MAVEN_PROJECTBASEDIR}" \
+ ${WRAPPER_LAUNCHER} $MAVEN_CONFIG "$@"
diff --git a/mvnw.cmd b/mvnw.cmd
new file mode 100644
index 0000000..c8d4337
--- /dev/null
+++ b/mvnw.cmd
@@ -0,0 +1,182 @@
+@REM ----------------------------------------------------------------------------
+@REM Licensed to the Apache Software Foundation (ASF) under one
+@REM or more contributor license agreements. See the NOTICE file
+@REM distributed with this work for additional information
+@REM regarding copyright ownership. The ASF licenses this file
+@REM to you under the Apache License, Version 2.0 (the
+@REM "License"); you may not use this file except in compliance
+@REM with the License. You may obtain a copy of the License at
+@REM
+@REM https://www.apache.org/licenses/LICENSE-2.0
+@REM
+@REM Unless required by applicable law or agreed to in writing,
+@REM software distributed under the License is distributed on an
+@REM "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+@REM KIND, either express or implied. See the License for the
+@REM specific language governing permissions and limitations
+@REM under the License.
+@REM ----------------------------------------------------------------------------
+
+@REM ----------------------------------------------------------------------------
+@REM Maven Start Up Batch script
+@REM
+@REM Required ENV vars:
+@REM JAVA_HOME - location of a JDK home dir
+@REM
+@REM Optional ENV vars
+@REM M2_HOME - location of maven2's installed home dir
+@REM MAVEN_BATCH_ECHO - set to 'on' to enable the echoing of the batch commands
+@REM MAVEN_BATCH_PAUSE - set to 'on' to wait for a keystroke before ending
+@REM MAVEN_OPTS - parameters passed to the Java VM when running Maven
+@REM e.g. to debug Maven itself, use
+@REM set MAVEN_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000
+@REM MAVEN_SKIP_RC - flag to disable loading of mavenrc files
+@REM ----------------------------------------------------------------------------
+
+@REM Begin all REM lines with '@' in case MAVEN_BATCH_ECHO is 'on'
+@echo off
+@REM set title of command window
+title %0
+@REM enable echoing by setting MAVEN_BATCH_ECHO to 'on'
+@if "%MAVEN_BATCH_ECHO%" == "on" echo %MAVEN_BATCH_ECHO%
+
+@REM set %HOME% to equivalent of $HOME
+if "%HOME%" == "" (set "HOME=%HOMEDRIVE%%HOMEPATH%")
+
+@REM Execute a user defined script before this one
+if not "%MAVEN_SKIP_RC%" == "" goto skipRcPre
+@REM check for pre script, once with legacy .bat ending and once with .cmd ending
+if exist "%HOME%\mavenrc_pre.bat" call "%HOME%\mavenrc_pre.bat"
+if exist "%HOME%\mavenrc_pre.cmd" call "%HOME%\mavenrc_pre.cmd"
+:skipRcPre
+
+@setlocal
+
+set ERROR_CODE=0
+
+@REM To isolate internal variables from possible post scripts, we use another setlocal
+@setlocal
+
+@REM ==== START VALIDATION ====
+if not "%JAVA_HOME%" == "" goto OkJHome
+
+echo.
+echo Error: JAVA_HOME not found in your environment. >&2
+echo Please set the JAVA_HOME variable in your environment to match the >&2
+echo location of your Java installation. >&2
+echo.
+goto error
+
+:OkJHome
+if exist "%JAVA_HOME%\bin\java.exe" goto init
+
+echo.
+echo Error: JAVA_HOME is set to an invalid directory. >&2
+echo JAVA_HOME = "%JAVA_HOME%" >&2
+echo Please set the JAVA_HOME variable in your environment to match the >&2
+echo location of your Java installation. >&2
+echo.
+goto error
+
+@REM ==== END VALIDATION ====
+
+:init
+
+@REM Find the project base dir, i.e. the directory that contains the folder ".mvn".
+@REM Fallback to current working directory if not found.
+
+set MAVEN_PROJECTBASEDIR=%MAVEN_BASEDIR%
+IF NOT "%MAVEN_PROJECTBASEDIR%"=="" goto endDetectBaseDir
+
+set EXEC_DIR=%CD%
+set WDIR=%EXEC_DIR%
+:findBaseDir
+IF EXIST "%WDIR%"\.mvn goto baseDirFound
+cd ..
+IF "%WDIR%"=="%CD%" goto baseDirNotFound
+set WDIR=%CD%
+goto findBaseDir
+
+:baseDirFound
+set MAVEN_PROJECTBASEDIR=%WDIR%
+cd "%EXEC_DIR%"
+goto endDetectBaseDir
+
+:baseDirNotFound
+set MAVEN_PROJECTBASEDIR=%EXEC_DIR%
+cd "%EXEC_DIR%"
+
+:endDetectBaseDir
+
+IF NOT EXIST "%MAVEN_PROJECTBASEDIR%\.mvn\jvm.config" goto endReadAdditionalConfig
+
+@setlocal EnableExtensions EnableDelayedExpansion
+for /F "usebackq delims=" %%a in ("%MAVEN_PROJECTBASEDIR%\.mvn\jvm.config") do set JVM_CONFIG_MAVEN_PROPS=!JVM_CONFIG_MAVEN_PROPS! %%a
+@endlocal & set JVM_CONFIG_MAVEN_PROPS=%JVM_CONFIG_MAVEN_PROPS%
+
+:endReadAdditionalConfig
+
+SET MAVEN_JAVA_EXE="%JAVA_HOME%\bin\java.exe"
+set WRAPPER_JAR="%MAVEN_PROJECTBASEDIR%\.mvn\wrapper\maven-wrapper.jar"
+set WRAPPER_LAUNCHER=org.apache.maven.wrapper.MavenWrapperMain
+
+set DOWNLOAD_URL="https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar"
+
+FOR /F "tokens=1,2 delims==" %%A IN ("%MAVEN_PROJECTBASEDIR%\.mvn\wrapper\maven-wrapper.properties") DO (
+ IF "%%A"=="wrapperUrl" SET DOWNLOAD_URL=%%B
+)
+
+@REM Extension to allow automatically downloading the maven-wrapper.jar from Maven-central
+@REM This allows using the maven wrapper in projects that prohibit checking in binary data.
+if exist %WRAPPER_JAR% (
+ if "%MVNW_VERBOSE%" == "true" (
+ echo Found %WRAPPER_JAR%
+ )
+) else (
+ if not "%MVNW_REPOURL%" == "" (
+ SET DOWNLOAD_URL="%MVNW_REPOURL%/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar"
+ )
+ if "%MVNW_VERBOSE%" == "true" (
+ echo Couldn't find %WRAPPER_JAR%, downloading it ...
+ echo Downloading from: %DOWNLOAD_URL%
+ )
+
+ powershell -Command "&{"^
+ "$webclient = new-object System.Net.WebClient;"^
+ "if (-not ([string]::IsNullOrEmpty('%MVNW_USERNAME%') -and [string]::IsNullOrEmpty('%MVNW_PASSWORD%'))) {"^
+ "$webclient.Credentials = new-object System.Net.NetworkCredential('%MVNW_USERNAME%', '%MVNW_PASSWORD%');"^
+ "}"^
+ "[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; $webclient.DownloadFile('%DOWNLOAD_URL%', '%WRAPPER_JAR%')"^
+ "}"
+ if "%MVNW_VERBOSE%" == "true" (
+ echo Finished downloading %WRAPPER_JAR%
+ )
+)
+@REM End of extension
+
+@REM Provide a "standardized" way to retrieve the CLI args that will
+@REM work with both Windows and non-Windows executions.
+set MAVEN_CMD_LINE_ARGS=%*
+
+%MAVEN_JAVA_EXE% %JVM_CONFIG_MAVEN_PROPS% %MAVEN_OPTS% %MAVEN_DEBUG_OPTS% -classpath %WRAPPER_JAR% "-Dmaven.multiModuleProjectDirectory=%MAVEN_PROJECTBASEDIR%" %WRAPPER_LAUNCHER% %MAVEN_CONFIG% %*
+if ERRORLEVEL 1 goto error
+goto end
+
+:error
+set ERROR_CODE=1
+
+:end
+@endlocal & set ERROR_CODE=%ERROR_CODE%
+
+if not "%MAVEN_SKIP_RC%" == "" goto skipRcPost
+@REM check for post script, once with legacy .bat ending and once with .cmd ending
+if exist "%HOME%\mavenrc_post.bat" call "%HOME%\mavenrc_post.bat"
+if exist "%HOME%\mavenrc_post.cmd" call "%HOME%\mavenrc_post.cmd"
+:skipRcPost
+
+@REM pause the script if MAVEN_BATCH_PAUSE is set to 'on'
+if "%MAVEN_BATCH_PAUSE%" == "on" pause
+
+if "%MAVEN_TERMINATE_CMD%" == "on" exit %ERROR_CODE%
+
+exit /B %ERROR_CODE%
diff --git a/pom.xml b/pom.xml
new file mode 100644
index 0000000..e7f81ec
--- /dev/null
+++ b/pom.xml
@@ -0,0 +1,114 @@
+
+
+ 4.0.0
+
+ org.springframework.boot
+ spring-boot-starter-parent
+ 2.5.3
+
+
+ com.saye
+ hgd-dmz
+ 0.0.1-SNAPSHOT
+ war
+ hgd-dmz
+ Demo project for Spring Boot
+
+ 1.8
+ UTF-8
+ UTF-8
+
+
+
+
+ org.springframework.boot
+ spring-boot-starter-web
+
+
+
+ org.springframework.boot
+ spring-boot-starter-tomcat
+ provided
+
+
+ org.springframework.boot
+ spring-boot-starter-test
+ test
+
+
+ org.springframework.boot
+ spring-boot-starter-thymeleaf
+
+
+ org.apache.commons
+ commons-pool2
+
+
+ com.alibaba
+ fastjson
+ 1.2.73
+
+
+
+ org.projectlombok
+ lombok
+
+
+
+ commons-net
+ commons-net
+ 3.8.0
+
+
+
+ com.alipay.sdk
+ alipay-sdk-java
+ 4.16.2.ALL
+
+
+
+ com.github.wechatpay-apiv3
+ wechatpay-apache-httpclient
+ 0.2.2
+
+
+
+ org.apache.httpcomponents
+ httpasyncclient
+
+
+
+ org.apache.poi
+ poi
+ 3.14
+
+
+ org.apache.poi
+ poi-ooxml
+ 3.14
+
+
+ commons-io
+ commons-io
+ 2.6
+
+
+ cn.hutool
+ hutool-all
+ 5.8.28
+
+
+
+
+
+ ROOT
+
+
+ org.springframework.boot
+ spring-boot-maven-plugin
+
+
+
+
+
diff --git a/src/main/java/com/saye/hgddmz/HgdDmzApplication.java b/src/main/java/com/saye/hgddmz/HgdDmzApplication.java
new file mode 100644
index 0000000..2fe0e28
--- /dev/null
+++ b/src/main/java/com/saye/hgddmz/HgdDmzApplication.java
@@ -0,0 +1,13 @@
+package com.saye.hgddmz;
+
+import org.springframework.boot.SpringApplication;
+import org.springframework.boot.autoconfigure.SpringBootApplication;
+
+@SpringBootApplication
+public class HgdDmzApplication {
+
+ public static void main(String[] args) {
+ SpringApplication.run(HgdDmzApplication.class, args);
+ }
+
+}
diff --git a/src/main/java/com/saye/hgddmz/ServletInitializer.java b/src/main/java/com/saye/hgddmz/ServletInitializer.java
new file mode 100644
index 0000000..e71caf9
--- /dev/null
+++ b/src/main/java/com/saye/hgddmz/ServletInitializer.java
@@ -0,0 +1,13 @@
+package com.saye.hgddmz;
+
+import org.springframework.boot.builder.SpringApplicationBuilder;
+import org.springframework.boot.web.servlet.support.SpringBootServletInitializer;
+
+public class ServletInitializer extends SpringBootServletInitializer {
+
+ @Override
+ protected SpringApplicationBuilder configure(SpringApplicationBuilder application) {
+ return application.sources(HgdDmzApplication.class);
+ }
+
+}
diff --git a/src/main/java/com/saye/hgddmz/commons/JsonResult.java b/src/main/java/com/saye/hgddmz/commons/JsonResult.java
new file mode 100644
index 0000000..424bba4
--- /dev/null
+++ b/src/main/java/com/saye/hgddmz/commons/JsonResult.java
@@ -0,0 +1,120 @@
+package com.saye.hgddmz.commons;
+
+import com.fasterxml.jackson.core.JsonProcessingException;
+import com.fasterxml.jackson.databind.ObjectMapper;
+
+import java.io.Serializable;
+
+/**
+ * 用于封装AJAX调用以后的JSON返回值
+ * 其中正确返回值:
+ * {state:0, data:返回数据, message:错误消息}
+ * 错误返回值:
+ * {state:1, data:null, message:错误消息}
+ **/
+public class JsonResult implements Serializable {
+
+ private static final long serialVersionUID = -3644950655568598241L;
+ //定义jackson对象
+ private static final ObjectMapper MAPPER = new ObjectMapper();
+
+
+ /**
+ * 返回是否成功的状态, 0表示成功,
+ * 1或其他值 表示失败
+ */
+ private boolean state;
+ /**
+ * 成功时候,返回的JSON数据
+ */
+ private Object data;
+ /**
+ * 是错误时候的错误消息
+ */
+ private String message;
+
+
+ public JsonResult() {
+ }
+
+ public JsonResult(boolean state, Object data, String message) {
+ this.state = state;
+ this.data = data;
+ this.message = message;
+ }
+
+ public JsonResult(Throwable e){
+ state = false;
+ data=null;
+ message=e.getMessage();
+ }
+
+ public JsonResult(Object data){
+ state = true;
+ this.data=data;
+ message="";
+ }
+
+ public boolean isState() {
+ return state;
+ }
+
+ public void setState(boolean state) {
+ this.state = state;
+ }
+
+ public Object getData() {
+ return data;
+ }
+
+
+ public void setData(Object data) {
+ this.data = data;
+ }
+
+
+ public String getMessage() {
+ return message;
+ }
+
+
+ public void setMessage(String message) {
+ this.message = message;
+ }
+
+ public static String jsonResultSuccess(Object data, String message){
+ JsonResult jsonResult=new JsonResult();
+ jsonResult.setState(true);
+ jsonResult.setMessage(message);
+ jsonResult.setData(data);
+ return ObjectToJson(jsonResult);
+ }
+
+
+ public static String jsonResultFalse(String message){
+ JsonResult jsonResult=new JsonResult();
+ jsonResult.setState(false);
+ jsonResult.setMessage(message);
+ return ObjectToJson(jsonResult);
+ }
+
+ /**
+ * 将对象转化为json字符串
+ * @param data
+ * @return
+ */
+ public static String ObjectToJson(Object data){
+ try{
+ String string = MAPPER.writeValueAsString(data);
+ return string;
+ } catch (JsonProcessingException e) {
+ e.printStackTrace();
+ }
+ return null;
+ }
+
+ @Override
+ public String toString() {
+ return "JsonResult [state=" + state + ", data=" + data + ", message=" + message + "]";
+ }
+}
\ No newline at end of file
diff --git a/src/main/java/com/saye/hgddmz/commons/TokenGenerateUtil.java b/src/main/java/com/saye/hgddmz/commons/TokenGenerateUtil.java
new file mode 100644
index 0000000..489f62b
--- /dev/null
+++ b/src/main/java/com/saye/hgddmz/commons/TokenGenerateUtil.java
@@ -0,0 +1,95 @@
+package com.saye.hgddmz.commons;
+
+import org.apache.commons.codec.CharEncoding;
+
+import java.io.UnsupportedEncodingException;
+import java.security.MessageDigest;
+
+/**
+ *
+ * token生成工具类
+ *
+ *
+ * @author caoshiyan
+ * @version V1.0
+ * @date 2015年12月29日 上午10:16:14
+ * @modificationHistory=========================逻辑或功能性重大变更记录
+ * @modify by user: {修改人} 2015年12月29日
+ * @since
+ */
+public class TokenGenerateUtil {
+
+ /**
+ *
+ * MD5加密工具类
+ *
+ * @author caoshiyan
+ * @version V1.0
+ * @date 2015年11月30日 下午4:40:16
+ * @param s
+ * @return
+ *
+ * @modificationHistory=========================逻辑或功能性重大变更记录
+ * @modify by user: {修改人} 2015年11月30日
+ * @modify by reason:{方法名}:{原因}
+ * @since
+ */
+ public final static String md5(String s) {
+ char hexDigits[] = {'0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'a', 'b', 'c', 'd', 'e', 'f'};
+ try {
+ MessageDigest mdTemp = MessageDigest.getInstance("MD5");
+ try {
+ // 最重要的是这句,需要加上编码类型
+ mdTemp.update(s.getBytes(CharEncoding.UTF_8));
+ } catch (UnsupportedEncodingException e) {
+ mdTemp.update(s.getBytes());
+ }
+ byte[] md = mdTemp.digest();
+ int j = md.length;
+ char str[] = new char[j * 2];
+ int k = 0;
+ for (int i = 0; i < j; i++) {
+ byte byte0 = md[i];
+ str[k++] = hexDigits[byte0 >>> 4 & 0xf];
+ str[k++] = hexDigits[byte0 & 0xf];
+ }
+ return new String(str).toUpperCase();
+ } catch (Exception e) {
+ return null;
+ }
+ }
+
+ /**
+ *
+ * 生成token
+ *
+ * @author caoshiyan
+ * @version V1.0
+ * @date 2015年11月18日 下午6:28:01
+ * @param url GET请求URL带参数串;POST请求URL不带参数串,参数以JSON格式传入paramJson
+ * @param paramJson POST参数JSON格式
+ * @param secret 加密secret
+ * @return String 生成的token值
+ *
+ * @modificationHistory=========================逻辑或功能性重大变更记录
+ * @modify by user: {修改人} 2015年11月18日
+ * @modify by reason:{方法名}:{原因}
+ * @since
+ */
+ public final static String buildToken(String url, String paramJson, String secret) {
+ String tempUrl = null;
+ tempUrl = url.substring("http://".length());
+ int index = tempUrl.indexOf("/");
+ String URI = tempUrl.substring(index);
+ String[] ss = URI.split("\\?");
+ if (ss.length > 1) {
+ return md5(ss[0] + ss[1] + secret);
+ } else {
+ return md5(ss[0] + paramJson + secret);
+ }
+ }
+ public static void main(String[] args) {
+ System.out.println(md5("/webapi/service/vss/getPlatEncodeDeviceResList{\"pageNo\":1,\"pageSize\":1000,\"appkey\":\"8a3018ac\",\"time\":1610594097178}69befa1eca0644af8000fd23d7b8c0f7"));
+ }
+}
+///webapi/service/vss/getPlatEncodeDeviceResList{"pageNo":1,"pageSize":1000,"appkey":"8a3018ac","time":1610594044620}69befa1eca0644af8000fd23d7b8c0f7
diff --git a/src/main/java/com/saye/hgddmz/commons/date/DateDUtil.java b/src/main/java/com/saye/hgddmz/commons/date/DateDUtil.java
new file mode 100644
index 0000000..48acf42
--- /dev/null
+++ b/src/main/java/com/saye/hgddmz/commons/date/DateDUtil.java
@@ -0,0 +1,296 @@
+package com.saye.hgddmz.commons.date;
+
+import java.text.ParseException;
+import java.text.SimpleDateFormat;
+import java.util.Calendar;
+import java.util.Date;
+
+public class DateDUtil {
+
+
+ public static String yyyy_MM_dd = "yyyy-MM-dd";
+ public static String yyyyMMdd = "yyyyMMdd";
+ public static String yyyyMM = "yyyyMM";
+ public static String yyyy_MM = "yyyy-MM";
+ public static String yyyy_MM_dd_HH_00 = "yyyy-MM-dd HH:00";
+ public static String yyyy_MM_dd_HH_mm = "yyyy-MM-dd HH:mm";
+ public static String yyyy_MM_dd_HH_mm_ss = "yyyy-MM-dd HH:mm:ss";
+ public static String yyyy_MM_dd_HH_mm_ss_SS = "yyyy-MM-dd HH:mm:ss.SS";
+ public static String yyyyMMddHHmm = "yyyyMMddHHmm";
+ public static String yyyyMMddHHmmss = "yyyyMMddHHmmss";
+ public static String yyyyMMddHHmmssSS = "yyyyMMddHHmmssSS";
+ public static String yyMMdd = "yyMMdd";
+ public static String yyyy_MM_dd_00_00 = "yyyy-MM-dd 00:00";
+
+ /**
+ * 将字符串时间改成Date类型
+ * @param format
+ * @param dateStr
+ * @return
+ */
+ public static Date strToDate(String format,String dateStr) {
+
+ Date date = null;
+
+ try {
+ SimpleDateFormat simpleDateFormat = new SimpleDateFormat(format);
+ date = simpleDateFormat.parse(dateStr);
+ } catch (ParseException e) {
+ e.printStackTrace();
+ }
+
+ return date;
+ }
+
+
+ /**
+ * 将Date时间转成字符串
+ * @param format
+ * @param date
+ * @return
+ */
+ public static String DateToStr(String format,Date date){
+
+ SimpleDateFormat simpleDateFormat = new SimpleDateFormat(format);
+
+ return simpleDateFormat.format(date);
+ }
+
+
+
+ /**
+ * 获取2个字符日期的天数差
+ * @param p_startDate
+ * @param p_endDate
+ * @return 天数差
+ */
+ public static long getDaysOfTowDiffDate( String p_startDate, String p_endDate ){
+
+ Date l_startDate = DateDUtil.strToDate(DateDUtil.yyyy_MM_dd, p_startDate);
+ Date l_endDate = DateDUtil.strToDate(DateDUtil.yyyy_MM_dd, p_endDate);
+ long l_startTime = l_startDate.getTime();
+ long l_endTime = l_endDate.getTime();
+ long betweenDays = (long) ( ( l_endTime - l_startTime ) / ( 1000 * 60 * 60 * 24 ) );
+ return betweenDays;
+ }
+
+
+ /**
+ * 获取2个字符日期的天数差
+ * @param l_startDate
+ * @param l_endDate
+ * @return 天数差
+ */
+ public static long getDaysOfTowDiffDate( Date l_startDate, Date l_endDate ){
+
+ long l_startTime = l_startDate.getTime();
+ long l_endTime = l_endDate.getTime();
+ long betweenDays = (long) ( ( l_endTime - l_startTime ) / ( 1000 * 60 * 60 * 24 ) );
+ return betweenDays;
+ }
+
+
+ /**
+ * 给出日期添加一段时间后的日期
+ * @param dateStr
+ * @param plus
+ * @return
+ */
+ public static String getPlusDays(String format,String dateStr,long plus){
+
+ Date date = DateDUtil.strToDate(format, dateStr);
+
+ long time = date.getTime()+ plus*24*60*60*1000;
+
+
+ return DateDUtil.DateToStr(format,new Date(time));
+ }
+
+
+ /**
+ * 给出日期添加一段时间后的日期
+ * @param format
+ * @param date
+ * @param plus
+ * @return
+ */
+ public static String getPlusDays(String format,Date date,long plus){
+
+
+ long time = date.getTime()+ plus*24*60*60*1000;
+
+
+ return DateDUtil.DateToStr(format,new Date(time));
+ }
+
+ /**
+ * 给出日期添加一段时间前的日期
+ * @param format
+ * @param date
+ * @param forth
+ * @return
+ */
+ public static String getForthDays(String format,Date date,long forth){
+
+
+ long time = date.getTime()- forth*24*60*60*1000;
+
+
+ return DateDUtil.DateToStr(format,new Date(time));
+ }
+
+ /**
+ * 给出时间添加几个小时后的时间
+ * @param format
+ * @param dateStr
+ * @param plus
+ * @return
+ */
+ public static String getPlusHours(String format,String dateStr,long plus){
+
+ Date date = DateDUtil.strToDate(format, dateStr);
+
+ long time = date.getTime()+ plus*60*60*1000;
+
+
+ return DateDUtil.DateToStr(format,new Date(time));
+ }
+
+ /**
+ * 给出时间添加几个分钟后的时间
+ * @param format
+ * @param dateStr
+ * @param plus
+ * @return
+ */
+ public static String getPlusMinutes(String format,String dateStr,long plus){
+
+ Date date = DateDUtil.strToDate(format, dateStr);
+
+ long time = date.getTime()+ plus*60*1000;
+
+
+ return DateDUtil.DateToStr(format,new Date(time));
+ }
+
+ /**
+ * 得到当前时间,格式如:yyyy-MM-dd HH:mm:ss:SS
+ * @return
+ */
+ public static String getCurrentTime(){
+
+ String nowTime = DateDUtil.DateToStr(DateDUtil.yyyy_MM_dd_HH_mm_ss_SS, new Date());
+ return nowTime;
+ }
+
+ /**
+ * 得到当前时间,格式如:yyyy-MM-dd HH:mm:ss
+ * @return
+ */
+ public static String getTheCurrentTime(){
+
+ String nowTime = DateDUtil.DateToStr(DateDUtil.yyyy_MM_dd_HH_mm_ss, new Date());
+ return nowTime;
+ }
+
+ /**
+ * 得到当前日期,格式如:yyyyMMdd
+ * @return
+ */
+ public static String getCurrentDate(){
+
+ String nowDate = DateDUtil.DateToStr(DateDUtil.yyyyMMdd, new Date());
+ return nowDate;
+ }
+
+ /**
+ * 得到当前日期,格式如:yyyyMMdd
+ * @return
+ */
+ public static String getCurrentDate(String format){
+
+ String nowDate = DateDUtil.DateToStr(format, new Date());
+ return nowDate;
+ }
+
+ /**
+ * 获取2个字符日期的分钟数差
+ * @param p_startDate
+ * @param p_endDate
+ * @return 相差的分钟
+ */
+ public static long getMinutesOfTowDiffDate(String p_startDate, String p_endDate ){
+
+ Date l_startDate = DateDUtil.strToDate(DateDUtil.yyyy_MM_dd_HH_mm_ss_SS, p_startDate);
+ Date l_endDate = DateDUtil.strToDate(DateDUtil.yyyy_MM_dd_HH_mm_ss_SS, p_endDate);
+ long l_startTime = l_startDate.getTime();
+ long l_endTime = l_endDate.getTime();
+ long betweenMinutes = (long) ( ( l_endTime - l_startTime ) / ( 1000 * 60) );
+ return betweenMinutes;
+ }
+
+ /**
+ * 获取2个字符日期的分钟数差
+ * @param p_startDate
+ * @param p_endDate
+ * @return 相差的分钟
+ */
+ public static long getMinutesOfTowDiffDateMin(String format,String p_startDate, String p_endDate ){
+
+ Date l_startDate = DateDUtil.strToDate(format, p_startDate);
+ Date l_endDate = DateDUtil.strToDate(format, p_endDate);
+ long l_startTime = l_startDate.getTime();
+ long l_endTime = l_endDate.getTime();
+ long betweenMinutes = (long) ( ( l_endTime - l_startTime ) / ( 1000 * 60) );
+ return betweenMinutes;
+ }
+ public static long getMonthIntervalOfTowDiffDate(String p_startMonth, String p_endMonth){
+
+ Date l_startDate = DateDUtil.strToDate(DateDUtil.yyyy_MM, p_startMonth);
+ Date l_endDate = DateDUtil.strToDate(DateDUtil.yyyy_MM, p_endMonth);
+
+
+ Calendar calender = Calendar.getInstance();
+ calender.setTime(l_startDate);
+
+ long l_startMonth = calender.get(Calendar.MONTH)+1;
+ long l_startYear = calender.get(Calendar.YEAR);
+
+ calender.setTime(l_endDate);
+
+ long l_endMonth =calender.get(Calendar.MONTH)+1;
+ long l_endYear = calender.get(Calendar.YEAR);
+
+ long betweenYear = l_endYear - l_startYear;
+ long betweenMonth = (long) ( l_endMonth - l_startMonth ) ;
+
+ return betweenYear * 12 + betweenMonth;
+ }
+
+ /**
+ * 将字符串日期转为cron表达式
+ */
+ public static String getCron(String execute_time) throws Exception{
+
+ SimpleDateFormat simpleDateFormat = new SimpleDateFormat(yyyy_MM_dd_HH_mm_ss);
+ Date date = simpleDateFormat.parse(execute_time);
+ SimpleDateFormat dateFormat = new SimpleDateFormat("ss mm HH dd MM ? yyyy");
+ return dateFormat.format(date);
+ }
+ /**
+ * 获取当前年月日日期
+ */
+
+ public static String getCDate(){
+ Calendar now = Calendar.getInstance();
+ String year=now.get(Calendar.YEAR)+"";
+ String month=(now.get(Calendar.MONTH) + 1) + "";
+ String day=now.get(Calendar.DAY_OF_MONTH)+"";
+ if ((now.get(Calendar.MONTH) + 1) < 10) month = "0" + month;
+ if (now.get(Calendar.DAY_OF_MONTH) < 10) day= "0" + day;
+ String nowDate = year+"年"+month+"月"+day+"日";
+ return nowDate;
+ }
+
+
+}
diff --git a/src/main/java/com/saye/hgddmz/commons/encrypt/EncryptUtil.java b/src/main/java/com/saye/hgddmz/commons/encrypt/EncryptUtil.java
new file mode 100644
index 0000000..429157a
--- /dev/null
+++ b/src/main/java/com/saye/hgddmz/commons/encrypt/EncryptUtil.java
@@ -0,0 +1,31 @@
+package com.saye.hgddmz.commons.encrypt;
+
+import org.apache.commons.codec.binary.Base64;
+
+import javax.crypto.Cipher;
+import javax.crypto.spec.IvParameterSpec;
+import javax.crypto.spec.SecretKeySpec;
+
+public class EncryptUtil {
+
+ // AES ecb模式解密 key:秘钥 initVector:偏移量 encrypted:加密内容
+ public static String decrypt(String key,String initVector,String encrypted) {
+ try {
+ IvParameterSpec iv = new IvParameterSpec(initVector.getBytes("UTF-8"));
+ SecretKeySpec skeySpec = new SecretKeySpec(key.getBytes("UTF-8"), "AES");
+
+ Cipher cipher = Cipher.getInstance("AES/CBC/PKCS5PADDING");
+ cipher.init(Cipher.DECRYPT_MODE, skeySpec, iv);
+ byte[] original = cipher.doFinal(Base64.decodeBase64(encrypted));
+
+ return new String(original);
+ } catch (Exception ex) {
+ ex.printStackTrace();
+ }
+ return null;
+ }
+
+ public static void main(String[] args) throws Exception {
+ System.out.println(decrypt("a6xdabhysfescfbu","encryptionIntVec","oYzamqnnyJ8GG6646PDYBQ=="));
+ }
+}
\ No newline at end of file
diff --git a/src/main/java/com/saye/hgddmz/commons/entity/DepartEntity.java b/src/main/java/com/saye/hgddmz/commons/entity/DepartEntity.java
new file mode 100644
index 0000000..fd44b44
--- /dev/null
+++ b/src/main/java/com/saye/hgddmz/commons/entity/DepartEntity.java
@@ -0,0 +1,37 @@
+package com.saye.hgddmz.commons.entity;
+
+import java.util.List;
+
+public class DepartEntity {
+
+ private String id;
+ private String title;
+ private boolean spread;
+ private List children;
+ public String getId() {
+ return id;
+ }
+ public void setId(String id) {
+ this.id = id;
+ }
+ public String getTitle() {
+ return title;
+ }
+ public void setTitle(String title) {
+ this.title = title;
+ }
+ public boolean isSpread() {
+ return spread;
+ }
+ public void setSpread(boolean spread) {
+ this.spread = spread;
+ }
+ public List getChildren() {
+ return children;
+ }
+ public void setChildren(List children) {
+ this.children = children;
+ }
+
+
+}
diff --git a/src/main/java/com/saye/hgddmz/commons/entity/RoleEntity.java b/src/main/java/com/saye/hgddmz/commons/entity/RoleEntity.java
new file mode 100644
index 0000000..fbf933f
--- /dev/null
+++ b/src/main/java/com/saye/hgddmz/commons/entity/RoleEntity.java
@@ -0,0 +1,37 @@
+package com.saye.hgddmz.commons.entity;
+
+import java.util.List;
+
+public class RoleEntity {
+
+ private String id;
+ private String title;
+ private boolean spread;
+ private List children;
+ public String getId() {
+ return id;
+ }
+ public void setId(String id) {
+ this.id = id;
+ }
+ public String getTitle() {
+ return title;
+ }
+ public void setTitle(String title) {
+ this.title = title;
+ }
+ public boolean isSpread() {
+ return spread;
+ }
+ public void setSpread(boolean spread) {
+ this.spread = spread;
+ }
+ public List getChildren() {
+ return children;
+ }
+ public void setChildren(List children) {
+ this.children = children;
+ }
+
+
+}
diff --git a/src/main/java/com/saye/hgddmz/commons/excel/ExportXLS.java b/src/main/java/com/saye/hgddmz/commons/excel/ExportXLS.java
new file mode 100644
index 0000000..0d6e621
--- /dev/null
+++ b/src/main/java/com/saye/hgddmz/commons/excel/ExportXLS.java
@@ -0,0 +1,785 @@
+package com.saye.hgddmz.commons.excel;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.apache.poi.hssf.usermodel.*;
+import org.apache.poi.hssf.util.HSSFColor;
+import org.apache.poi.ss.util.CellRangeAddress;
+
+import javax.servlet.http.HttpServletResponse;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.io.OutputStream;
+import java.math.BigDecimal;
+import java.sql.Date;
+import java.sql.SQLException;
+import java.sql.Timestamp;
+import java.text.DateFormat;
+import java.text.SimpleDateFormat;
+import java.util.*;
+
+
+public class ExportXLS implements IExport ,ISetExport{
+
+ Log logger = LogFactory.getLog(this.getClass());
+
+
+ public final static short ROWHEIGHT = 20; /*行高*/
+ public final static double PAGEMARGIN = 0.1;/*页边距*/
+ public final static short TITLESIZE = 16;/*标题文字大小*/
+ public final static short HEADERSIZE = 12;/*列头文字大小*/
+ public final static short DATA_CHARACTERSIZE = 9;/*汉字大小*/
+ public final static short DATA_NUMSIZE = 9;/*数字大小*/
+ public final static short DATA_DATESIZE = 9;/*日期大小*/
+ public final static String ALIGN_LEFT = "LEFT";/*水平居左*/
+ public final static String ALIGN_RIGHT = "RIGHT";/*水平居右*/
+ public final static String ALIGN_CENTER = "CENTER";/*水平居右*/
+ public final static String VERTICAL_TOP = "TOP";/*垂直居上*/
+ public final static String VERTICAL_CENTER = "MIDDLE";/*垂直居中*/
+ public final static String VERTICAL_BOTTOM = "BOTTOM";/*垂直居下*/
+ public final static short A4 = HSSFPrintSetup.A4_PAPERSIZE;
+ public final static short A5 = HSSFPrintSetup.A5_PAPERSIZE;
+ public final static short A3 = 8;
+
+
+
+ public final static String MERGEDEND = "_mergedend_";//表示合并次单元格
+
+
+
+
+
+ private List