浏览代码

first commit

bc_zhang 4 年之前
当前提交
7ff604b061
共有 100 个文件被更改,包括 7437 次插入0 次删除
  1. 二进制
      .DS_Store
  2. 34 0
      .gitignore
  3. 118 0
      .mvn/wrapper/MavenWrapperDownloader.java
  4. 二进制
      .mvn/wrapper/maven-wrapper.jar
  5. 2 0
      .mvn/wrapper/maven-wrapper.properties
  6. 6 0
      Dockerfile
  7. 6 0
      docker-compose.yml
  8. 二进制
      lib/aspose-cells-18.9.jar
  9. 二进制
      lib/aspose-slides.jar
  10. 二进制
      lib/aspose-words-16.1.0-jdk16.jar
  11. 二进制
      lib/com.lowagie.text-2.1.jar
  12. 二进制
      lib/itext-asian.jar
  13. 二进制
      lib/itextpdf-5.5.0.jar
  14. 310 0
      mvnw
  15. 182 0
      mvnw.cmd
  16. 247 0
      pom.xml
  17. 二进制
      src/.DS_Store
  18. 二进制
      src/main/.DS_Store
  19. 22 0
      src/main/java/com/zglc/fm/FaultManagemnetApplication.java
  20. 13 0
      src/main/java/com/zglc/fm/anno/PassToken.java
  21. 12 0
      src/main/java/com/zglc/fm/anno/UserLoginToken.java
  22. 159 0
      src/main/java/com/zglc/fm/aop/GlobalLog.java
  23. 72 0
      src/main/java/com/zglc/fm/base/Result.java
  24. 65 0
      src/main/java/com/zglc/fm/conf/AuthConfigurer.java
  25. 65 0
      src/main/java/com/zglc/fm/conf/Swagger2Config.java
  26. 11 0
      src/main/java/com/zglc/fm/constant/Constant.java
  27. 33 0
      src/main/java/com/zglc/fm/constant/ErrorCode.java
  28. 84 0
      src/main/java/com/zglc/fm/controller/AircraftTypeController.java
  29. 138 0
      src/main/java/com/zglc/fm/controller/BookController.java
  30. 139 0
      src/main/java/com/zglc/fm/controller/CardController.java
  31. 104 0
      src/main/java/com/zglc/fm/controller/CommonController.java
  32. 108 0
      src/main/java/com/zglc/fm/controller/DepartmentController.java
  33. 139 0
      src/main/java/com/zglc/fm/controller/FaultController.java
  34. 87 0
      src/main/java/com/zglc/fm/controller/LogController.java
  35. 87 0
      src/main/java/com/zglc/fm/controller/MajorController.java
  36. 141 0
      src/main/java/com/zglc/fm/controller/ManuelController.java
  37. 140 0
      src/main/java/com/zglc/fm/controller/OutlineController.java
  38. 101 0
      src/main/java/com/zglc/fm/controller/RightsController.java
  39. 136 0
      src/main/java/com/zglc/fm/controller/RoleController.java
  40. 134 0
      src/main/java/com/zglc/fm/controller/UserController.java
  41. 20 0
      src/main/java/com/zglc/fm/dao/AircraftTypeDao.java
  42. 18 0
      src/main/java/com/zglc/fm/dao/BookDao.java
  43. 18 0
      src/main/java/com/zglc/fm/dao/CardDao.java
  44. 25 0
      src/main/java/com/zglc/fm/dao/DepartmentDao.java
  45. 18 0
      src/main/java/com/zglc/fm/dao/FaultDao.java
  46. 20 0
      src/main/java/com/zglc/fm/dao/FloatValueDao.java
  47. 20 0
      src/main/java/com/zglc/fm/dao/IntValueDao.java
  48. 23 0
      src/main/java/com/zglc/fm/dao/LogDao.java
  49. 18 0
      src/main/java/com/zglc/fm/dao/MajorDao.java
  50. 18 0
      src/main/java/com/zglc/fm/dao/ManuelDao.java
  51. 18 0
      src/main/java/com/zglc/fm/dao/OutlineDao.java
  52. 23 0
      src/main/java/com/zglc/fm/dao/RightsDao.java
  53. 23 0
      src/main/java/com/zglc/fm/dao/RoleDao.java
  54. 21 0
      src/main/java/com/zglc/fm/dao/StrValueDao.java
  55. 28 0
      src/main/java/com/zglc/fm/dao/UserDao.java
  56. 22 0
      src/main/java/com/zglc/fm/entity/AircraftTypeEntity.java
  57. 64 0
      src/main/java/com/zglc/fm/entity/BookEntity.java
  58. 64 0
      src/main/java/com/zglc/fm/entity/CardEntity.java
  59. 19 0
      src/main/java/com/zglc/fm/entity/DeleteEntity.java
  60. 64 0
      src/main/java/com/zglc/fm/entity/DepartmentEntity.java
  61. 85 0
      src/main/java/com/zglc/fm/entity/FaultEntity.java
  62. 23 0
      src/main/java/com/zglc/fm/entity/FaultFind.java
  63. 23 0
      src/main/java/com/zglc/fm/entity/FaultRecordStatistics.java
  64. 26 0
      src/main/java/com/zglc/fm/entity/FloatValue.java
  65. 26 0
      src/main/java/com/zglc/fm/entity/IntValue.java
  66. 84 0
      src/main/java/com/zglc/fm/entity/LogEntity.java
  67. 19 0
      src/main/java/com/zglc/fm/entity/LoginVO.java
  68. 32 0
      src/main/java/com/zglc/fm/entity/MajorEntity.java
  69. 64 0
      src/main/java/com/zglc/fm/entity/ManuelEntity.java
  70. 62 0
      src/main/java/com/zglc/fm/entity/OutlineEntity.java
  71. 14 0
      src/main/java/com/zglc/fm/entity/RecordVO.java
  72. 52 0
      src/main/java/com/zglc/fm/entity/RightsEntity.java
  73. 49 0
      src/main/java/com/zglc/fm/entity/RoleEntity.java
  74. 24 0
      src/main/java/com/zglc/fm/entity/StrValue.java
  75. 102 0
      src/main/java/com/zglc/fm/entity/UserEntity.java
  76. 13 0
      src/main/java/com/zglc/fm/exceptions/BusinessException.java
  77. 119 0
      src/main/java/com/zglc/fm/intercepter/AuthInterceptor.java
  78. 205 0
      src/main/java/com/zglc/fm/schedule/ScheduleTasks.java
  79. 91 0
      src/main/java/com/zglc/fm/service/AircraftTypeService.java
  80. 102 0
      src/main/java/com/zglc/fm/service/BookService.java
  81. 102 0
      src/main/java/com/zglc/fm/service/CardService.java
  82. 37 0
      src/main/java/com/zglc/fm/service/CommonService.java
  83. 121 0
      src/main/java/com/zglc/fm/service/DepartmentService.java
  84. 100 0
      src/main/java/com/zglc/fm/service/FaultService.java
  85. 70 0
      src/main/java/com/zglc/fm/service/FloatValueService.java
  86. 70 0
      src/main/java/com/zglc/fm/service/IntValueService.java
  87. 110 0
      src/main/java/com/zglc/fm/service/LogService.java
  88. 101 0
      src/main/java/com/zglc/fm/service/MajorService.java
  89. 101 0
      src/main/java/com/zglc/fm/service/ManuelService.java
  90. 101 0
      src/main/java/com/zglc/fm/service/OutlineService.java
  91. 152 0
      src/main/java/com/zglc/fm/service/RightsService.java
  92. 127 0
      src/main/java/com/zglc/fm/service/RoleService.java
  93. 60 0
      src/main/java/com/zglc/fm/service/StrValueService.java
  94. 180 0
      src/main/java/com/zglc/fm/service/UserService.java
  95. 80 0
      src/main/java/com/zglc/fm/utils/CollectionUtil.java
  96. 223 0
      src/main/java/com/zglc/fm/utils/DateTool.java
  97. 21 0
      src/main/java/com/zglc/fm/utils/DigestUtil.java
  98. 45 0
      src/main/java/com/zglc/fm/utils/DocToPdf.java
  99. 883 0
      src/main/java/com/zglc/fm/utils/EncodingDetect.java
  100. 99 0
      src/main/java/com/zglc/fm/utils/ExcelUtils.java

二进制
.DS_Store


+ 34 - 0
.gitignore

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

+ 118 - 0
.mvn/wrapper/MavenWrapperDownloader.java

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

二进制
.mvn/wrapper/maven-wrapper.jar


+ 2 - 0
.mvn/wrapper/maven-wrapper.properties

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

+ 6 - 0
Dockerfile

@@ -0,0 +1,6 @@
+FROM java:openjdk-8-jre
+RUN echo "Asia/Shanghai" > /etc/timezone
+ARG JAR_FILE
+ADD ${JAR_FILE} app.jar
+EXPOSE 11081
+CMD ["java","-jar","-Xms256m", "-Xmx512m","/app.jar"]

+ 6 - 0
docker-compose.yml

@@ -0,0 +1,6 @@
+version: '1.0'
+services:
+  project:
+    image: trouble-research:1.0
+    ports:
+      - "11081:11081/tcp"

二进制
lib/aspose-cells-18.9.jar


二进制
lib/aspose-slides.jar


二进制
lib/aspose-words-16.1.0-jdk16.jar


二进制
lib/com.lowagie.text-2.1.jar


二进制
lib/itext-asian.jar


二进制
lib/itextpdf-5.5.0.jar


+ 310 - 0
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 "$@"

+ 182 - 0
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%

+ 247 - 0
pom.xml

@@ -0,0 +1,247 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
+    <modelVersion>4.0.0</modelVersion>
+    <parent>
+        <groupId>org.springframework.boot</groupId>
+        <artifactId>spring-boot-starter-parent</artifactId>
+        <version>2.3.3.RELEASE</version>
+        <relativePath/> <!-- lookup parent from repository -->
+    </parent>
+    <groupId>com.zglc</groupId>
+    <artifactId>tr</artifactId>
+    <version>1.0</version>
+    <name>TroubleResearch</name>
+    <description>Trouble research system based on Spring Boot</description>
+
+    <properties>
+        <java.version>1.8</java.version>
+    </properties>
+
+    <dependencies>
+        <dependency>
+            <groupId>org.springframework.boot</groupId>
+            <artifactId>spring-boot-starter-web</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.mybatis.spring.boot</groupId>
+            <artifactId>mybatis-spring-boot-starter</artifactId>
+            <version>2.1.3</version>
+        </dependency>
+        <dependency>
+            <groupId>com.alibaba</groupId>
+            <artifactId>druid-spring-boot-starter</artifactId>
+            <version>1.1.10</version>
+        </dependency>
+        <dependency>
+            <groupId>mysql</groupId>
+            <artifactId>mysql-connector-java</artifactId>
+            <scope>runtime</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.springframework.boot</groupId>
+            <artifactId>spring-boot-starter-test</artifactId>
+            <scope>test</scope>
+            <exclusions>
+                <exclusion>
+                    <groupId>org.junit.vintage</groupId>
+                    <artifactId>junit-vintage-engine</artifactId>
+                </exclusion>
+            </exclusions>
+        </dependency>
+
+        <dependency>
+            <groupId>tk.mybatis</groupId>
+            <artifactId>mapper-spring-boot-starter</artifactId>
+            <version>2.0.4</version>
+            <scope>compile</scope>
+        </dependency>
+        <dependency>
+            <groupId>com.github.pagehelper</groupId>
+            <artifactId>pagehelper</artifactId>
+            <version>RELEASE</version>
+        </dependency>
+        <dependency>
+            <groupId>com.github.pagehelper</groupId>
+            <artifactId>pagehelper-spring-boot-starter</artifactId>
+            <version>RELEASE</version>
+        </dependency>
+        <dependency>
+            <groupId>com.spring4all</groupId>
+            <artifactId>swagger-spring-boot-starter</artifactId>
+            <version>1.6.0.RELEASE</version>
+        </dependency>
+        <dependency>
+            <groupId>org.projectlombok</groupId>
+            <artifactId>lombok</artifactId>
+        </dependency>
+        <!-- https://mvnrepository.com/artifact/com.google.zxing/javase -->
+        <dependency>
+            <groupId>io.springfox</groupId>
+            <artifactId>springfox-swagger2</artifactId>
+            <version>2.7.0</version>
+        </dependency>
+        <dependency>
+            <groupId>io.springfox</groupId>
+            <artifactId>springfox-swagger-ui</artifactId>
+            <version>2.7.0</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.commons</groupId>
+            <artifactId>commons-collections4</artifactId>
+            <version>4.0</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.commons</groupId>
+            <artifactId>commons-pool2</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>commons-beanutils</groupId>
+            <artifactId>commons-beanutils</artifactId>
+            <version>1.9.2</version>
+        </dependency>
+        <dependency>
+            <groupId>com.auth0</groupId>
+            <artifactId>java-jwt</artifactId>
+            <version>3.4.0</version>
+        </dependency>
+        <dependency>
+            <groupId>commons-io</groupId>
+            <artifactId>commons-io</artifactId>
+            <version>2.6</version>
+        </dependency>
+        <dependency>
+            <groupId>org.springframework.boot</groupId>
+            <artifactId>spring-boot-starter-data-redis</artifactId>
+            <exclusions>
+                <exclusion>
+                    <groupId>io.lettuce</groupId>
+                    <artifactId>lettuce-core</artifactId>
+                </exclusion>
+            </exclusions>
+        </dependency>
+
+
+        <!--解析html包-->
+        <dependency>
+            <groupId>org.springframework.boot</groupId>
+            <artifactId>spring-boot-starter-thymeleaf</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.springframework</groupId>
+            <artifactId>spring-test</artifactId>
+            <version>5.0.5.RELEASE</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.commons</groupId>
+            <artifactId>commons-collections4</artifactId>
+            <version>4.1</version>
+        </dependency>
+
+        <!-- https://mvnrepository.com/artifact/redis.clients/jedis -->
+        <dependency>
+            <groupId>redis.clients</groupId>
+            <artifactId>jedis</artifactId>
+        </dependency>
+        <!--        <dependency>-->
+        <!--            <groupId>com.alibaba</groupId>-->
+        <!--            <artifactId>easyexcel</artifactId>-->
+        <!--            <version>1.1.2-beta4</version>-->
+        <!--        </dependency>-->
+        <dependency>
+            <groupId>org.aspectj</groupId>
+            <artifactId>aspectjweaver</artifactId>
+            <version>1.8.13</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.poi</groupId>
+            <artifactId>poi</artifactId>
+            <version>3.17</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.poi</groupId>
+            <artifactId>poi-ooxml</artifactId>
+            <version>3.17</version>
+        </dependency>
+
+        <dependency>
+            <groupId>com.aspose</groupId>
+            <artifactId>aspose-words</artifactId>
+            <version>16.1.0</version>
+            <scope>system</scope>
+            <systemPath>${project.basedir}/lib/aspose-words-16.1.0-jdk16.jar</systemPath>
+        </dependency>
+
+        <dependency>
+            <groupId>com.aspose</groupId>
+            <artifactId>aspose-cells</artifactId>
+            <version>18.9.0</version>
+            <scope>system</scope>
+            <systemPath>${project.basedir}/lib/aspose-cells-18.9.jar</systemPath>
+        </dependency>
+
+        <dependency>
+            <groupId>com.aspose</groupId>
+            <artifactId>aspose-slides</artifactId>
+            <version>16.7.0</version>
+            <scope>system</scope>
+            <systemPath>${project.basedir}/lib/aspose-slides.jar</systemPath>
+        </dependency>
+
+
+    </dependencies>
+
+    <build>
+        <plugins>
+            <plugin>
+                <groupId>org.springframework.boot</groupId>
+                <artifactId>spring-boot-maven-plugin</artifactId>
+                <configuration>
+                    <includeSystemScope>true</includeSystemScope>
+                </configuration>
+            </plugin>
+            <plugin>
+                <groupId>org.mybatis.generator</groupId>
+                <artifactId>mybatis-generator-maven-plugin</artifactId>
+                <version>1.3.7</version>
+                <configuration>
+                    <configurationFile>${basedir}/src/main/resources/generatorConfig.xml</configurationFile>
+                    <overwrite>true</overwrite>
+                    <verbose>true</verbose>
+                </configuration>
+            </plugin>
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-compiler-plugin</artifactId>
+                <version>3.8.1</version>
+                <configuration>
+                    <source>1.8</source>
+                    <target>1.8</target>
+                </configuration>
+            </plugin>
+            <plugin>
+                <groupId>com.spotify</groupId>
+                <artifactId>dockerfile-maven-plugin</artifactId>
+                <version>1.4.10</version>
+                <executions>
+                    <execution>
+                        <id>default</id>
+                        <goals>
+                            <goal>build</goal>
+                        </goals>
+                    </execution>
+                </executions>
+                <configuration>
+                    <repository>${project.artifactId}</repository>
+                    <tag>${project.version}</tag>
+                    <useMavenSettingsForAuth>true</useMavenSettingsForAuth>
+                    <buildArgs>
+                        <JAR_FILE>target/${project.build.finalName}.jar</JAR_FILE>
+                    </buildArgs>
+
+                </configuration>
+            </plugin>
+        </plugins>
+    </build>
+
+</project>

二进制
src/.DS_Store


二进制
src/main/.DS_Store


+ 22 - 0
src/main/java/com/zglc/fm/FaultManagemnetApplication.java

@@ -0,0 +1,22 @@
+package com.zglc.fm;
+import org.springframework.boot.web.servlet.ServletComponentScan;
+import tk.mybatis.spring.annotation.MapperScan;
+import org.springframework.boot.SpringApplication;
+import org.springframework.boot.autoconfigure.SpringBootApplication;
+import com.zglc.fm.utils.DocToPdf;
+import com.zglc.fm.utils.Ppt2ToPdf;
+
+
+@SpringBootApplication
+@ServletComponentScan
+@MapperScan("com.zglc.fm.dao")
+public class FaultManagemnetApplication {
+
+    public static void main(String[] args) {
+        SpringApplication.run(FaultManagemnetApplication.class, args);
+        DocToPdf.loadLicense();
+        Ppt2ToPdf.loadLicense();
+
+    }
+
+}

+ 13 - 0
src/main/java/com/zglc/fm/anno/PassToken.java

@@ -0,0 +1,13 @@
+package com.zglc.fm.anno;
+
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+
+@Target({ElementType.METHOD, ElementType.TYPE})
+@Retention(RetentionPolicy.RUNTIME)
+public @interface PassToken {
+    boolean required() default true;
+}
+

+ 12 - 0
src/main/java/com/zglc/fm/anno/UserLoginToken.java

@@ -0,0 +1,12 @@
+package com.zglc.fm.anno;
+
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+
+@Target({ElementType.METHOD, ElementType.TYPE})
+@Retention(RetentionPolicy.RUNTIME)
+@interface UserLoginToken {
+    boolean required() default true;
+}

+ 159 - 0
src/main/java/com/zglc/fm/aop/GlobalLog.java

@@ -0,0 +1,159 @@
+package com.zglc.fm.aop;
+
+import com.auth0.jwt.JWT;
+import com.auth0.jwt.exceptions.JWTDecodeException;
+import com.zglc.fm.base.Result;
+import com.zglc.fm.constant.Constant;
+import com.zglc.fm.entity.LogEntity;
+import com.zglc.fm.entity.RightsEntity;
+import com.zglc.fm.entity.UserEntity;
+import com.zglc.fm.service.LogService;
+import com.zglc.fm.service.RightsService;
+import com.zglc.fm.service.UserService;
+import com.zglc.fm.utils.DateTool;
+import com.zglc.fm.utils.Tools;
+import org.apache.juli.logging.Log;
+import org.apache.juli.logging.LogFactory;
+import org.aspectj.lang.ProceedingJoinPoint;
+import org.aspectj.lang.annotation.Around;
+import org.aspectj.lang.annotation.Aspect;
+import org.aspectj.lang.annotation.Pointcut;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Component;
+import org.springframework.web.context.request.RequestContextHolder;
+import org.springframework.web.context.request.ServletRequestAttributes;
+
+import javax.servlet.http.HttpServletRequest;
+import java.io.IOException;
+import java.util.*;
+
+@Aspect
+@Component
+public class GlobalLog {
+
+    static private Log log = LogFactory.getLog(GlobalLog.class);
+    private final LogService logService;
+    private final UserService userService;
+    private final RightsService rightsService;
+
+    @Autowired
+    public GlobalLog(LogService logService,UserService userService,RightsService rightsService) {
+        this.logService = logService;
+        this.userService = userService;
+        this.rightsService = rightsService;
+    }
+
+    @Pointcut(value = "execution(public * com.zglc.tr.controller.*.get*(..)) || " +
+            "execution(public * com.zglc.tr.controller.*.add*(..)) || " +
+            "execution(public * com.zglc.tr.controller.*.edit*(..)) || " +
+            "execution(public * com.zglc.tr.controller.*.listpage*(..)) || " +
+            "execution(public * com.zglc.tr.controller.*.log*(..)) || " +
+            "execution(public * com.zglc.tr.controller.*.delete(..)) "  )
+    //@Pointcut(value = "execution(public * *(..))")
+    public void globalLog() {
+    }
+
+    @Around("globalLog()")
+    public Object log(final ProceedingJoinPoint pjp) throws IOException {
+        // 操作开始时刻
+        String endTime = "";
+        int execStatus = 0;
+        LogEntity logEntity = new LogEntity();
+        // 操作用户
+        HttpServletRequest request =
+                ((ServletRequestAttributes) Objects.requireNonNull(RequestContextHolder.getRequestAttributes())).getRequest();
+        String token = request.getHeader("token");// 从 http 请求头中取出 token
+        if (token != null)
+        {
+            if (token.compareTo("undefined") == 0) token = null;
+            if (token.compareTo("") == 0) token = null;
+            if (token.compareTo("null") == 0) token = null;
+        }
+
+        UserEntity user = null;
+        logEntity.setBeginTime(DateTool.getFormatedDateString());
+        logEntity.setUserIp(request.getRemoteAddr());
+        logEntity.setRequestUrl(request.getRequestURI());
+
+        RightsEntity rightsEntity = rightsService.getRightsByPath(Tools.cleanFilePath(request.getRequestURI()));
+        if (rightsEntity != null) {
+            logEntity.setRequestDescription(rightsEntity.getRightsName());
+        } else
+            logEntity.setRequestDescription("未知请求!");
+
+        String params = "";
+
+        if (pjp.getArgs().length > 0) {
+            params = pjp.getArgs()[0].toString();
+            int index = params.indexOf('[');
+            if (index > 0) {
+                params = params.substring(index + 1, params.indexOf(']'));
+            }
+            logEntity.setArguments(params);
+        }
+        if (token != null && token.length() > 4)
+        {
+            try {
+                Integer userId = Integer.parseInt(JWT.decode(token).getAudience().get(0));
+                if (userId > 0)
+                {
+                    if (userId > Constant.APPOFFSET)
+                        user = userService.getUser(userId - Constant.APPOFFSET);
+                    else
+                        user = userService.getUser(userId);
+                    if (user != null) {
+                        logEntity.setUserId(user.getId());
+                        logEntity.setRealName(user.getRealName());
+                    }
+                    else
+                    {
+                        logEntity.setUserId(userId);
+                        logEntity.setRealName("未知用户");
+                    }
+                }
+            } catch (JWTDecodeException j) {
+                return false;
+            }
+        }
+
+        if (user == null) {
+            if (params.length() > 8) {
+                UserEntity userEntity = (UserEntity)pjp.getArgs()[0];
+                if (userEntity != null) {
+                    userEntity = userService.getUserByName(userEntity.getUserName());
+                    logEntity.setUserId(userEntity.getId());
+                    logEntity.setRealName(userEntity.getRealName());
+                } else {
+                    logEntity.setUserId(-1);
+                    logEntity.setRealName("无用户");
+                }
+            } else {
+                logEntity.setUserId(-1);
+                logEntity.setRealName("无效用户");
+            }
+
+        }
+
+        Object ret = null;
+        try {
+            ret = pjp.proceed();
+            Result re = (Result) ret;
+            if (re.getStatus() != 0)
+                execStatus = 1;
+            else
+                execStatus = 0;
+            endTime = DateTool.getFormatedDateString();
+
+            return ret;
+        } catch (Throwable e) {
+            endTime = DateTool.getFormatedDateString();
+            execStatus = 1;
+            e.printStackTrace();
+            return ret;
+        } finally {
+            logEntity.setFinishTime(endTime);
+            logEntity.setExecStatus(execStatus);
+            logService.add(logEntity);
+        }
+    }
+}

+ 72 - 0
src/main/java/com/zglc/fm/base/Result.java

@@ -0,0 +1,72 @@
+package com.zglc.fm.base;
+
+import com.fasterxml.jackson.annotation.JsonIgnore;
+import com.zglc.fm.constant.ErrorCode;
+import lombok.Data;
+import lombok.experimental.Accessors;
+/**
+ * @author wcf
+ */
+@Accessors(chain = true)
+@Data
+public class Result<T> {
+    /**
+     * 返回数据
+     */
+    private T data;
+    /**
+     * 消息内容
+     */
+    private String msg = "";
+    /**
+     * 状态
+     */
+    private Integer status = 0;
+
+
+    @JsonIgnore
+    public boolean isSuccess() {
+        return status == ErrorCode.RET_SUCCESS.code;
+    }
+
+    public Result(Integer status) {
+        this.status = status;
+    }
+
+    public Result(ErrorCode ec) {
+        this.status = ec.code;
+        this.msg = ec.msg;
+    }
+
+    public static <T> Result<T> result(boolean flag,String msg,T data) {
+        return flag? success(data):fail(msg);
+    }
+
+    public static <T> Result<T> success(String msg) {
+        return new Result<T>(ErrorCode.RET_SUCCESS.code).setMsg(msg);
+    }
+
+    public static <T> Result<T> success() {
+        return new Result<>(ErrorCode.RET_SUCCESS.code);
+    }
+
+    public static <T> Result<T> success(T data) {
+        return new Result<T>(ErrorCode.RET_SUCCESS.code).setData(data);
+    }
+
+    public static <T> Result<T> fail(String msg) {
+        return new Result<T>(ErrorCode.RET_API_ERROR.code).setMsg(msg);
+    }
+
+    public static <T> Result<T> fail() {
+        return new Result(ErrorCode.RET_API_ERROR);
+    }
+
+    public static <T> Result<T> fail(ErrorCode ec) {
+        return new Result<T>(ec);
+    }
+
+    public static <T> Result<T> fail(ErrorCode ec,T data) {
+        return new Result<T>(ec).setData(data);
+    }
+}

+ 65 - 0
src/main/java/com/zglc/fm/conf/AuthConfigurer.java

@@ -0,0 +1,65 @@
+package com.zglc.fm.conf;
+
+import com.zglc.fm.intercepter.AuthInterceptor;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.context.annotation.Configuration;
+import org.springframework.web.servlet.config.annotation.CorsRegistry;
+import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
+import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
+import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
+
+/**
+ * 身份验证配置
+ */
+@Configuration
+public class AuthConfigurer implements WebMvcConfigurer {
+    private final AuthInterceptor authInterceptor;
+
+    @Autowired
+    public AuthConfigurer(AuthInterceptor authInterceptor) {
+        this.authInterceptor = authInterceptor;
+    }
+
+    // API拦截配置
+    @Override
+    public void addInterceptors(InterceptorRegistry registry) {
+        // 开放/api/query下api 其他全部拦截
+        registry.addInterceptor(authInterceptor)
+                .addPathPatterns("/api/**").excludePathPatterns("/api/common/login", "/api/common/signin","/api/common/logout");
+
+    }
+
+    // 静态资源
+    @Override
+    public void addResourceHandlers(ResourceHandlerRegistry registry) {
+        String os = System.getProperty("os.name");
+
+        if (os.toLowerCase().startsWith("win")) {  //如果是Windows系统
+            registry.addResourceHandler("/source/**")
+                    // /apple/**表示在磁盘apple目录下的所有资源会被解析为以下的路径
+                    .addResourceLocations("file:d:/source/");//媒体资源
+
+        } else {  //linux 和mac
+            registry.addResourceHandler("/source/**")
+                    .addResourceLocations("file:///source/");  //媒体资源
+        }
+
+        registry.addResourceHandler("swagger-ui.html")
+                .addResourceLocations("classpath:/META-INF/resources/");
+
+        registry.addResourceHandler("/webjars/**")
+                .addResourceLocations("classpath:/META-INF/resources/webjars/");
+
+        // 指定静态资源文件
+        registry.addResourceHandler("/**").addResourceLocations("classpath:/");
+        registry.addResourceHandler("/**").addResourceLocations("classpath:/static/");
+    }
+    static final String ORIGINS[] = new String[]{"GET", "POST"};
+
+    @Override
+    public void addCorsMappings(CorsRegistry registry) {
+        registry.addMapping("/datas/**").allowedOrigins("*").allowCredentials(true).allowedMethods(ORIGINS)
+                .maxAge(3600);
+
+    }
+}

+ 65 - 0
src/main/java/com/zglc/fm/conf/Swagger2Config.java

@@ -0,0 +1,65 @@
+package com.zglc.fm.conf;
+
+import org.springframework.beans.factory.annotation.Value;
+import org.springframework.context.annotation.Bean;
+import org.springframework.context.annotation.Configuration;
+import org.springframework.web.bind.annotation.RestController;
+import springfox.documentation.builders.ApiInfoBuilder;
+import springfox.documentation.builders.ParameterBuilder;
+import springfox.documentation.builders.PathSelectors;
+import springfox.documentation.builders.RequestHandlerSelectors;
+import springfox.documentation.schema.ModelRef;
+import springfox.documentation.service.ApiInfo;
+import springfox.documentation.service.Parameter;
+import springfox.documentation.spi.DocumentationType;
+import springfox.documentation.spring.web.plugins.Docket;
+import springfox.documentation.swagger2.annotations.EnableSwagger2;
+
+import java.util.ArrayList;
+import java.util.List;
+
+@Configuration
+@EnableSwagger2
+public class Swagger2Config {
+    @Value("${server.port}")
+    Integer serverPort;
+    /*
+        @Bean
+        public MultipartConfigElement multipartConfigElement() {
+            MultipartConfigFactory factory = new MultipartConfigFactory();
+            factory.setMaxFileSize(DataSize.parse("50MB")); //KB,MB
+            factory.setMaxRequestSize(DataSize.parse("50MB"));
+            return factory.createMultipartConfig();
+        }
+
+    */
+
+    @Bean
+    public Docket createRestApi() {
+        //添加head参数start
+        ParameterBuilder tokenPar = new ParameterBuilder();
+        List<Parameter> pars = new ArrayList<Parameter>();
+        tokenPar.name("token").description("令牌").modelRef(new ModelRef("string")).parameterType("header").required(false).build();
+        pars.add(tokenPar.build());
+        //添加head参数end
+
+        return new Docket(DocumentationType.SWAGGER_2)
+                .apiInfo(apiInfo())
+                .select()
+                .apis(RequestHandlerSelectors.withClassAnnotation(RestController.class))
+                .paths(PathSelectors.any())
+                .build()
+                .globalOperationParameters(pars)
+                .apiInfo(apiInfo());
+    }
+
+    private ApiInfo apiInfo() {
+        return new ApiInfoBuilder()
+                .title("外场资源系统API文档")
+                .description("后端API接口")
+                .version("1.0")
+               //.contact(new Contact("王超飞", "http://127.0.0.1:" + serverPort, "mnhwa@163.com"))
+                .build();
+    }
+
+}

+ 11 - 0
src/main/java/com/zglc/fm/constant/Constant.java

@@ -0,0 +1,11 @@
+package com.zglc.fm.constant;
+
+
+public class Constant {
+    public static final String FWATERM = "static/FWATERM.txt";		//文字水印配置路径
+    public static final String IWATERM = "static/IWATERM.txt";		//图片水印配置路径
+    public static final String FILEPATHIMG = "item/uploadImgs/";		//图片上传路径
+    public static final String FILEPATHFILE = "item/files/";			//文件上传路径
+    public static final Integer APPOFFSET = 111222333;              //app端用户ID偏移
+
+}

+ 33 - 0
src/main/java/com/zglc/fm/constant/ErrorCode.java

@@ -0,0 +1,33 @@
+package com.zglc.fm.constant;
+
+import java.io.Serializable;
+
+/**
+ * 错误码
+ */
+public enum ErrorCode implements Serializable {
+    RET_SUCCESS(0, "成功"),
+    RET_ACCOUNT_ERROR(1, "账户错误"),
+    RET_PASSWORD_ERROR(2, "密码错误"),
+    RET_API_ERROR(3, "API错误"),
+    RET_PARAMETER_ERROR(4, "参数错误"),
+    RET_NOT_FOUND(5, "未发现指定项目"),
+    RET_ACCOUNT_EXISTS(6, "用户已存在"),
+    RET_PERMISSION_DENIED(7, "越权"),
+    RET_DATA_CHECKING(8, "有正在进行的数据完整性检查"),
+    RET_ACCOUNT_NOT_ENABLE(9, "用户未启用"),
+    RET_ACCOUNT_ERROR_TOKEN(10, "无效token,请重新登录"),
+    RET_ACCOUNT_ERROR_NO_USER(11, "用户不存在,请重新登录!"),
+    RET_ACCOUNT_ERROR_TOKEN_EXPERIED(12, "过期token,请重新登录"),
+    RET_ACCOUNT_ERROR_IP_ERROR(13, "IP地址变化,请重新登录!")    ,
+    RET_NO_LOGIN(14, "未登录"),
+    RET_REDIS_ERROR(15, "reid无法连接!"),
+    RET_RELOGIN(16, "用户变化,请重登陆!") ;
+    public int code;
+    public String msg;
+
+    ErrorCode(int code, String msg) {
+        this.code = code;
+        this.msg = msg;
+    }
+}

+ 84 - 0
src/main/java/com/zglc/fm/controller/AircraftTypeController.java

@@ -0,0 +1,84 @@
+package com.zglc.fm.controller;
+
+import com.zglc.fm.base.Result;
+import com.github.pagehelper.PageHelper;
+import com.github.pagehelper.PageInfo;
+import com.zglc.fm.entity.AircraftTypeEntity;
+import com.zglc.fm.service.AircraftTypeService;
+import com.zglc.fm.entity.DeleteEntity;
+import java.util.List;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import io.swagger.annotations.ApiResponse;
+import io.swagger.annotations.ApiResponses;
+import org.springframework.web.bind.annotation.CrossOrigin;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestParam;
+import org.springframework.web.bind.annotation.RestController;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+
+@Api(tags = "机型接口")
+@RequestMapping("api/aircraft")
+@CrossOrigin(allowCredentials = "true")
+@RestController
+public class AircraftTypeController {
+
+    @Autowired
+    private AircraftTypeService AircraftTypeService;
+
+    @ApiOperation("分页列出所有")
+    @ApiResponses({
+            @ApiResponse(code = 0, message = "成功")
+    })
+    @GetMapping("listpage")
+    public Result<PageInfo<AircraftTypeEntity>> listpage(Integer page, Integer size) {
+        PageHelper.startPage(page, size, "id desc");
+        return Result.success(new PageInfo<>(AircraftTypeService.getAllRecord()));
+    }
+
+    @ApiOperation("列出所有")
+    @ApiResponses({
+            @ApiResponse(code = 0, message = "成功")
+    })
+    @GetMapping("listAll")
+    public Result<List<AircraftTypeEntity>> listpage() {
+       return Result.success(AircraftTypeService.listAll());
+    }
+
+    @ApiOperation("按名称查询")
+    @GetMapping("getByName")
+    public Result<List<AircraftTypeEntity>> findByName(@RequestParam("name") String name){
+        return AircraftTypeService.findByName(name);
+    }
+
+    @ApiOperation("ID查找")
+    @ApiResponses({
+            @ApiResponse(code = 0, message = "成功")
+    })
+    @GetMapping("get")
+    public  Result<AircraftTypeEntity> get(@RequestParam Integer id){return  Result.success(AircraftTypeService.getAircraftType(id));}
+
+    @ApiOperation("增添")
+    @ApiResponses({
+            @ApiResponse(code = 0, message = "成功")
+    })
+    @PostMapping("add")
+    public Result<String> add(@RequestBody AircraftTypeEntity data){return  AircraftTypeService.add(data);}
+
+    @ApiOperation("删除")
+    @ApiResponses({
+            @ApiResponse(code = 0, message = "成功")
+    })
+    @PostMapping("delete")
+    public Result<String> delete(@RequestBody DeleteEntity deleteEntity){
+        return  AircraftTypeService.delete(deleteEntity.getIds());}
+
+    @ApiOperation("修改")
+    @ApiResponses({
+            @ApiResponse(code = 0, message = "成功")
+    })
+    @PostMapping("edit")
+    public Result<String> edit( @RequestBody AircraftTypeEntity data){return  AircraftTypeService.edit(data);}
+
+}

+ 138 - 0
src/main/java/com/zglc/fm/controller/BookController.java

@@ -0,0 +1,138 @@
+package com.zglc.fm.controller;
+
+
+import com.github.pagehelper.PageHelper;
+import com.github.pagehelper.PageInfo;
+import com.zglc.fm.base.Result;
+import com.zglc.fm.entity.DeleteEntity;
+import com.zglc.fm.entity.BookEntity;
+import com.zglc.fm.service.BookService;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import io.swagger.annotations.ApiResponse;
+import io.swagger.annotations.ApiResponses;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.annotation.Value;
+import org.springframework.web.bind.annotation.*;
+import org.springframework.web.multipart.MultipartFile;
+import com.zglc.fm.utils.FileTool;
+import com.zglc.fm.utils.*;
+import com.zglc.fm.utils.FileTypeUtil.Type;
+import javax.annotation.Resource;
+import javax.servlet.http.HttpServletRequest;
+import java.util.Date;
+import java.util.List;
+
+@Api(tags = "教材接口")
+@RequestMapping("api/book")
+@CrossOrigin(allowCredentials = "true")
+@RestController
+public class BookController {
+
+    @Resource
+    private final BookService bookService;
+    @Autowired(required = false)
+    public BookController(BookService bookService){
+        this.bookService = bookService;
+    }
+
+    @Value("${spring.article.sourcePath}")
+    private String sourcePath;
+
+    @ApiOperation("导入")
+    @ApiResponses({
+            @ApiResponse(code = 0, message = "成功")
+    })
+    @PostMapping("import")
+    public Result<Object> importFile(HttpServletRequest request, @RequestParam("file") MultipartFile file){
+        Date date = new Date();
+        String sourcePath1;
+
+        sourcePath1 = "d:\\sourcefm";
+        String filePath = FileTool.fileUp(file, sourcePath1, date.getTime() + file.getOriginalFilename());
+
+        Type fileType = FileTypeUtil.getFileType(file.getOriginalFilename());
+        if (fileType == Type.DOC || fileType == Type.DOCX ||  fileType == Type.RTF ) {
+            DocToPdf.convertDoc2Pdf(filePath, sourcePath1);
+        }
+        if (fileType == Type.PPT || fileType == Type.PPTX) {
+            Ppt2ToPdf.convertPpt2Pdf(filePath, sourcePath1);
+        }
+        if (fileType == Type.DOC) {
+            filePath = filePath.replaceAll( "doc","pdf");
+            filePath = filePath.replaceAll( "d:","");
+        }
+        if (fileType == Type.DOCX) {
+            filePath = filePath.replaceAll( "docx","pdf");
+            filePath = filePath.replaceAll( "d:","");
+        }
+        if (fileType == Type.RTF) {
+            filePath = filePath.replaceAll( "rtf","pdf");
+            filePath = filePath.replaceAll( "d:","");
+        }
+        if (fileType == Type.PPT) {
+            filePath = filePath.replaceAll( "ppt","pdf");
+            filePath = filePath.replaceAll( "d:","");
+        }
+        if (fileType == Type.PPTX) {
+            filePath = filePath.replaceAll( "pptx","pdf");
+            filePath = filePath.replaceAll( "d:","");
+        }
+        return Result.success(filePath);
+    }
+
+
+    @ApiOperation("列出所有")
+    @ApiResponses({
+            @ApiResponse(code = 0, message = "成功")
+    })
+    @GetMapping("listAll")
+    public Result<List<BookEntity>> listAll() {
+        return Result.success(bookService.listAll());
+    }
+
+    @ApiOperation("ID查找")
+    @ApiResponses({
+            @ApiResponse(code = 0, message = "成功")
+    })
+    @GetMapping("get")
+    public  Result<BookEntity> get(@RequestParam Integer id){return  Result.success(bookService.getOutline(id));}
+
+    @ApiOperation("按名称查询")
+    @GetMapping("getByName")
+    public Result<List<BookEntity>> findByName(@RequestParam("name") String name){
+        return bookService.findByName(name);
+    }
+
+    @ApiOperation("增添")
+    @ApiResponses({
+            @ApiResponse(code = 0, message = "成功")
+    })
+    @PostMapping("add")
+    public Result<String> add(@RequestBody BookEntity data){return  bookService.add(data);}
+
+    @ApiOperation("删除")
+    @ApiResponses({
+            @ApiResponse(code = 0, message = "成功")
+    })
+    @PostMapping("delete")
+    public Result<String> delete(@RequestBody DeleteEntity deleteEntity){return  bookService.delete(deleteEntity.getIds());}
+
+    @ApiOperation("修改")
+    @ApiResponses({
+            @ApiResponse(code = 0, message = "成功")
+    })
+    @PostMapping("edit")
+    public Result<String> edit( @RequestBody BookEntity data){return  bookService.edit(data);}
+
+    @ApiOperation("分页列出所有")
+    @ApiResponses({
+            @ApiResponse(code = 0, message = "成功")
+    })
+    @GetMapping("listpage")
+    public Result<PageInfo<BookEntity>> listpage(Integer page, Integer size) {
+        PageHelper.startPage(page, size, "id desc");
+        return Result.success(new PageInfo<>(bookService.getAllBook()));
+    }
+
+}

+ 139 - 0
src/main/java/com/zglc/fm/controller/CardController.java

@@ -0,0 +1,139 @@
+package com.zglc.fm.controller;
+
+
+import com.github.pagehelper.PageHelper;
+import com.github.pagehelper.PageInfo;
+import com.zglc.fm.base.Result;
+import com.zglc.fm.entity.DeleteEntity;
+import com.zglc.fm.entity.CardEntity;
+import com.zglc.fm.service.CardService;
+import com.zglc.fm.utils.DocToPdf;
+import com.zglc.fm.utils.FileTool;
+import com.zglc.fm.utils.FileTypeUtil;
+import com.zglc.fm.utils.Ppt2ToPdf;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import io.swagger.annotations.ApiResponse;
+import io.swagger.annotations.ApiResponses;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.annotation.Value;
+import org.springframework.web.bind.annotation.*;
+import org.springframework.web.multipart.MultipartFile;
+
+import javax.annotation.Resource;
+import javax.servlet.http.HttpServletRequest;
+import java.util.Date;
+import java.util.List;
+
+@Api(tags = "工艺卡片接口")
+@RequestMapping("api/card")
+@CrossOrigin(allowCredentials = "true")
+@RestController
+public class CardController {
+
+    @Resource
+    private final CardService cardService;
+    @Autowired(required = false)
+    public CardController(CardService cardService){
+        this.cardService = cardService;
+    }
+
+    @Value("${spring.article.sourcePath}")
+    private String sourcePath;
+
+    @ApiOperation("导入")
+    @ApiResponses({
+            @ApiResponse(code = 0, message = "成功")
+    })
+    @PostMapping("import")
+    public Result<Object> importFile(HttpServletRequest request, @RequestParam("file") MultipartFile file){
+        Date date = new Date();
+        String sourcePath1;
+
+        sourcePath1 = "d:\\sourcefm";
+        String filePath = FileTool.fileUp(file, sourcePath1, date.getTime() + file.getOriginalFilename());
+
+        FileTypeUtil.Type fileType = FileTypeUtil.getFileType(file.getOriginalFilename());
+        if (fileType == FileTypeUtil.Type.DOC || fileType == FileTypeUtil.Type.DOCX ||  fileType == FileTypeUtil.Type.RTF ) {
+            DocToPdf.convertDoc2Pdf(filePath, sourcePath1);
+        }
+        if (fileType == FileTypeUtil.Type.PPT || fileType == FileTypeUtil.Type.PPTX) {
+            Ppt2ToPdf.convertPpt2Pdf(filePath, sourcePath1);
+        }
+        if (fileType == FileTypeUtil.Type.DOC) {
+            filePath = filePath.replaceAll( "doc","pdf");
+            filePath = filePath.replaceAll( "d:","");
+        }
+        if (fileType == FileTypeUtil.Type.DOCX) {
+            filePath = filePath.replaceAll( "docx","pdf");
+            filePath = filePath.replaceAll( "d:","");
+        }
+        if (fileType == FileTypeUtil.Type.RTF) {
+            filePath = filePath.replaceAll( "rtf","pdf");
+            filePath = filePath.replaceAll( "d:","");
+        }
+        if (fileType == FileTypeUtil.Type.PPT) {
+            filePath = filePath.replaceAll( "ppt","pdf");
+            filePath = filePath.replaceAll( "d:","");
+        }
+        if (fileType == FileTypeUtil.Type.PPTX) {
+            filePath = filePath.replaceAll( "pptx","pdf");
+            filePath = filePath.replaceAll( "d:","");
+        }
+        return Result.success(filePath);
+    }
+
+    @ApiOperation("列出所有")
+    @ApiResponses({
+            @ApiResponse(code = 0, message = "成功")
+    })
+    @GetMapping("listAll")
+    public Result<List<CardEntity>> listAll() {
+        return Result.success(cardService.listAll());
+    }
+
+    @ApiOperation("ID查找")
+    @ApiResponses({
+            @ApiResponse(code = 0, message = "成功")
+    })
+    @GetMapping("get")
+    public  Result<CardEntity> get(@RequestParam Integer id){return  Result.success(cardService.getOutline(id));}
+
+    @ApiOperation("按名称查询")
+    @GetMapping("getByName")
+    public Result<List<CardEntity>> findByName(@RequestParam("name") String name){
+        return cardService.findByName(name);
+    }
+
+    @ApiOperation("增添")
+    @ApiResponses({
+            @ApiResponse(code = 0, message = "成功")
+    })
+    @PostMapping("add")
+    public Result<String> add(@RequestBody CardEntity data){return  cardService.add(data);}
+
+    @ApiOperation("删除")
+    @ApiResponses({
+            @ApiResponse(code = 0, message = "成功")
+    })
+    @PostMapping("delete")
+    public Result<String> delete(@RequestBody DeleteEntity deleteEntity){return  cardService.delete(deleteEntity.getIds());}
+
+    @ApiOperation("修改")
+    @ApiResponses({
+            @ApiResponse(code = 0, message = "成功")
+    })
+    @PostMapping("edit")
+    public Result<String> edit( @RequestBody CardEntity data){return  cardService.edit(data);}
+
+    @ApiOperation("分页列出所有")
+    @ApiResponses({
+            @ApiResponse(code = 0, message = "成功")
+    })
+    @GetMapping("listpage")
+    public Result<PageInfo<CardEntity>> listpage(Integer page, Integer size) {
+        PageHelper.startPage(page, size, "id desc");
+        return Result.success(new PageInfo<>(cardService.getAllCard()));
+    }
+
+}

+ 104 - 0
src/main/java/com/zglc/fm/controller/CommonController.java

@@ -0,0 +1,104 @@
+package com.zglc.fm.controller;
+
+import com.zglc.fm.anno.PassToken;
+import com.zglc.fm.base.Result;
+import com.zglc.fm.constant.ErrorCode;
+import com.zglc.fm.entity.LoginVO;
+import com.zglc.fm.entity.UserEntity;
+import com.zglc.fm.service.CommonService;
+import com.zglc.fm.service.UserService;
+import com.zglc.fm.utils.TokenTool;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import io.swagger.annotations.ApiResponse;
+import io.swagger.annotations.ApiResponses;
+
+import org.springframework.web.bind.annotation.*;
+
+import javax.annotation.Resource;
+
+import org.springframework.beans.factory.annotation.Autowired;
+import java.util.Map;
+
+/**
+ * 通用接口
+ *
+ * @author wcf
+ * @email mnhwa@163.com
+ * @date 2020-02-14 14:42:47
+ * @description Refactoring 1st
+ *
+ */
+
+@Api(tags = "通用接口")
+@RequestMapping("api/common")
+@CrossOrigin(allowCredentials = "true")
+@RestController
+public class CommonController {
+
+    @Resource
+    private final UserService userService;
+
+    @Autowired
+    private CommonService commonService;
+
+    public CommonController(UserService userService){
+
+        this.userService = userService;
+    }
+
+    @ApiOperation("服务器状态检测")
+    @ApiResponses({
+            @ApiResponse(code = 0, message = "成功")
+    })
+    @PostMapping("statusTest")
+    public Result<String> statusTest(){return Result.success("服务器正常");}
+
+    @ApiOperation("登陆")
+    @ApiResponses({
+            @ApiResponse(code = 0, message = "成功")
+    })
+    @PassToken
+    @PostMapping("login")
+    public Result<LoginVO> login(@RequestParam String userName,@RequestParam String password) {
+        LoginVO login = new LoginVO();
+        if (userName.isEmpty() || password.isEmpty())
+            return Result.success(login);
+        UserEntity user = userService.getUserByName(userName);
+        if (user == null) {
+            return Result.fail(ErrorCode.RET_ACCOUNT_ERROR_NO_USER);
+        }
+        if (user.getPassword().compareTo(password) != 0) {
+            return Result.fail(ErrorCode.RET_PASSWORD_ERROR);
+        }
+        if (user.getIsEnable() == 1)
+            return Result.fail(ErrorCode.RET_ACCOUNT_NOT_ENABLE);
+
+        login.setId(user.getId());
+        login.setRealName(user.getRealName());
+        login.setUserName(user.getUserName());
+        login.setRole(user.getRoleId());
+        login.setToken(TokenTool.getToken(user.getId()));
+        return Result.success(login);
+    }
+
+    @ApiOperation("登出")
+    @ApiResponses({
+            @ApiResponse(code = 0, message = "成功")
+    })
+    @PostMapping("logout")
+    public Result<String> logout(@RequestParam Integer id) {
+        return Result.success("success!");
+    }
+
+//    @ApiOperation("搜索")
+//    @ApiResponses({
+//            @ApiResponse(code = 0, message = "成功")
+//    })
+//    @GetMapping("find")
+//    public Result<Map<String, Object>> find(String keyword,String type){
+//        return commonService.find(keyword, type);
+//    }
+
+
+}

+ 108 - 0
src/main/java/com/zglc/fm/controller/DepartmentController.java

@@ -0,0 +1,108 @@
+package com.zglc.fm.controller;
+
+import javax.annotation.Resource;
+import java.util.List;
+import com.github.pagehelper.PageHelper;
+import com.github.pagehelper.PageInfo;
+import com.zglc.fm.entity.DeleteEntity;
+import org.springframework.web.bind.annotation.*;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import io.swagger.annotations.ApiResponse;
+import io.swagger.annotations.ApiResponses;
+import com.zglc.fm.base.Result;
+import com.zglc.fm.entity.DepartmentEntity;
+import com.zglc.fm.service.DepartmentService;
+
+
+
+/**
+ * 部门
+ *
+ * @author wcf
+ * @email mnhwa@163.com
+ * @date 2020-02-14 14:42:47
+ * @description Refactoring 1st
+ *
+ */
+ 
+@Api(tags = "部门接口")
+@RequestMapping("api/department")
+@CrossOrigin(allowCredentials = "true")
+@RestController
+public class DepartmentController {
+
+	@Resource
+    private final DepartmentService departmentService;
+
+	public DepartmentController(DepartmentService departmentService){this.departmentService = departmentService;}
+
+
+    @ApiOperation("列出所有")
+    @ApiResponses({
+            @ApiResponse(code = 0, message = "成功")
+    })
+    @GetMapping("listAll")
+    public Result<List<DepartmentEntity>> listAll() {
+	    List<DepartmentEntity> lst = departmentService.listAll();
+        String msg = "无数据";
+        return Result.result(lst != null ,msg,lst);
+    }
+
+	@ApiOperation("分页列出所有")    
+	@ApiResponses({
+            @ApiResponse(code = 0, message = "成功")
+    })
+    @GetMapping("listpage")
+    public Result<PageInfo<DepartmentEntity>> listpage(Integer page, Integer size) {
+        PageHelper.startPage(page, size, "id desc");
+        return Result.success(new PageInfo<>(departmentService.getAllDepartment()));
+    }
+	
+    @ApiOperation("ID查找")    
+	@ApiResponses({
+            @ApiResponse(code = 0, message = "成功")
+    })
+    @GetMapping("get")
+    public  Result<DepartmentEntity> get(@RequestParam Integer id){return  Result.success(departmentService.getDepartment(id));}
+
+    @ApiOperation("按名称查询")
+    @GetMapping("getByName")
+    public Result<List<DepartmentEntity>> getByName(@RequestParam("name") String name){
+	    return departmentService.findByName(name);
+    }
+
+    @ApiOperation("增添")    
+	@ApiResponses({
+            @ApiResponse(code = 0, message = "成功")
+    })
+    @PostMapping("add")
+    public Result<String> add( @RequestBody DepartmentEntity data){return  departmentService.add(data);}
+
+    @ApiOperation("删除")    
+	@ApiResponses({
+            @ApiResponse(code = 0, message = "成功")
+    })
+    @PostMapping("delete")
+    public Result<String> delete(@RequestBody DeleteEntity deleteEntity){return  departmentService.delete(deleteEntity.getIds());}
+
+    @ApiOperation("修改")    
+	@ApiResponses({
+            @ApiResponse(code = 0, message = "成功")
+    })
+    @PostMapping("edit")
+    public Result<String> edit( @RequestBody DepartmentEntity data){return  departmentService.edit(data);}
+
+    @ApiOperation("子部门查找")
+    @ApiResponses({
+            @ApiResponse(code = 0, message = "成功")
+    })
+    @GetMapping("listSub")
+    public  Result<List<DepartmentEntity>> listSub(@RequestParam Integer id){
+        List<DepartmentEntity> lst = departmentService.listsubDepartment(id);
+        String msg = "无数据";
+        return Result.result(lst != null ,msg,lst);
+	}
+
+
+}

+ 139 - 0
src/main/java/com/zglc/fm/controller/FaultController.java

@@ -0,0 +1,139 @@
+package com.zglc.fm.controller;
+
+
+import com.github.pagehelper.PageHelper;
+import com.github.pagehelper.PageInfo;
+import com.zglc.fm.base.Result;
+import com.zglc.fm.entity.DeleteEntity;
+import com.zglc.fm.entity.FaultEntity;
+import com.zglc.fm.service.FaultService;
+import com.zglc.fm.utils.DocToPdf;
+import com.zglc.fm.utils.FileTool;
+import com.zglc.fm.utils.FileTypeUtil;
+import com.zglc.fm.utils.Ppt2ToPdf;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import io.swagger.annotations.ApiResponse;
+import io.swagger.annotations.ApiResponses;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.annotation.Value;
+import org.springframework.web.bind.annotation.*;
+import org.springframework.web.multipart.MultipartFile;
+
+import javax.annotation.Resource;
+import javax.servlet.http.HttpServletRequest;
+import java.util.Date;
+import java.util.List;
+
+@Api(tags = "故障案例接口")
+@RequestMapping("api/fault")
+@CrossOrigin(allowCredentials = "true")
+@RestController
+public class FaultController {
+
+    @Resource
+    private final FaultService faultService;
+    @Autowired(required = false)
+    public FaultController(FaultService faultService){
+        this.faultService = faultService;
+    }
+
+    @Value("${spring.article.sourcePath}")
+    private String sourcePath;
+
+    @ApiOperation("导入")
+    @ApiResponses({
+            @ApiResponse(code = 0, message = "成功")
+    })
+    @PostMapping("import")
+    public Result<Object> importFile(HttpServletRequest request, @RequestParam("file") MultipartFile file){
+        Date date = new Date();
+        String sourcePath1;
+
+        sourcePath1 = "d:\\sourcefm";
+        String filePath = FileTool.fileUp(file, sourcePath1, date.getTime() + file.getOriginalFilename());
+
+        FileTypeUtil.Type fileType = FileTypeUtil.getFileType(file.getOriginalFilename());
+        if (fileType == FileTypeUtil.Type.DOC || fileType == FileTypeUtil.Type.DOCX ||  fileType == FileTypeUtil.Type.RTF ) {
+            DocToPdf.convertDoc2Pdf(filePath, sourcePath1);
+        }
+        if (fileType == FileTypeUtil.Type.PPT || fileType == FileTypeUtil.Type.PPTX) {
+            Ppt2ToPdf.convertPpt2Pdf(filePath, sourcePath1);
+        }
+        if (fileType == FileTypeUtil.Type.DOC) {
+            filePath = filePath.replaceAll( "doc","pdf");
+            filePath = filePath.replaceAll( "d:","");
+        }
+        if (fileType == FileTypeUtil.Type.DOCX) {
+            filePath = filePath.replaceAll( "docx","pdf");
+            filePath = filePath.replaceAll( "d:","");
+        }
+        if (fileType == FileTypeUtil.Type.RTF) {
+            filePath = filePath.replaceAll( "rtf","pdf");
+            filePath = filePath.replaceAll( "d:","");
+        }
+        if (fileType == FileTypeUtil.Type.PPT) {
+            filePath = filePath.replaceAll( "ppt","pdf");
+            filePath = filePath.replaceAll( "d:","");
+        }
+        if (fileType == FileTypeUtil.Type.PPTX) {
+            filePath = filePath.replaceAll( "pptx","pdf");
+            filePath = filePath.replaceAll( "d:","");
+        }
+        return Result.success(filePath);
+    }
+
+    @ApiOperation("列出所有")
+    @ApiResponses({
+            @ApiResponse(code = 0, message = "成功")
+    })
+    @GetMapping("listAll")
+    public Result<List<FaultEntity>> listAll() {
+        return Result.success(faultService.listAll());
+    }
+
+    @ApiOperation("ID查找")
+    @ApiResponses({
+            @ApiResponse(code = 0, message = "成功")
+    })
+    @GetMapping("get")
+    public  Result<FaultEntity> get(@RequestParam Integer id){return  Result.success(faultService.getOutline(id));}
+
+    @ApiOperation("按名称查询")
+    @GetMapping("getByName")
+    public Result<List<FaultEntity>> findByName(@RequestParam("name") String name){
+        return faultService.findByName(name);
+    }
+
+    @ApiOperation("增添")
+    @ApiResponses({
+            @ApiResponse(code = 0, message = "成功")
+    })
+    @PostMapping("add")
+    public Result<String> add(@RequestBody FaultEntity data){return  faultService.add(data);}
+
+    @ApiOperation("删除")
+    @ApiResponses({
+            @ApiResponse(code = 0, message = "成功")
+    })
+    @PostMapping("delete")
+    public Result<String> delete(@RequestBody DeleteEntity deleteEntity){return  faultService.delete(deleteEntity.getIds());}
+
+    @ApiOperation("修改")
+    @ApiResponses({
+            @ApiResponse(code = 0, message = "成功")
+    })
+    @PostMapping("edit")
+    public Result<String> edit( @RequestBody FaultEntity data){return  faultService.edit(data);}
+
+    @ApiOperation("分页列出所有")
+    @ApiResponses({
+            @ApiResponse(code = 0, message = "成功")
+    })
+    @GetMapping("listpage")
+    public Result<PageInfo<FaultEntity>> listpage(Integer page, Integer size) {
+        PageHelper.startPage(page, size, "id desc");
+        return Result.success(new PageInfo<>(faultService.getAllFault()));
+    }
+
+}

+ 87 - 0
src/main/java/com/zglc/fm/controller/LogController.java

@@ -0,0 +1,87 @@
+package com.zglc.fm.controller;
+
+import javax.annotation.Resource;
+import java.util.List;
+import com.github.pagehelper.PageHelper;
+import com.github.pagehelper.PageInfo;
+import com.zglc.fm.entity.DeleteEntity;
+import org.springframework.web.bind.annotation.*;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import io.swagger.annotations.ApiResponse;
+import io.swagger.annotations.ApiResponses;
+import com.zglc.fm.base.Result;
+import com.zglc.fm.entity.LogEntity;
+import com.zglc.fm.service.LogService;
+
+
+
+/**
+ * 日志
+ *
+ * @author wcf
+ * @email mnhwa@163.com
+ * @date 2020-02-17 02:23:39
+ * @description Refactoring 1st
+ *
+ */
+ 
+@Api(tags = "日志接口")
+@RequestMapping("api/log")
+@CrossOrigin(allowCredentials = "true")
+@RestController
+public class LogController {
+
+	@Resource
+    private final LogService logService;
+
+	public LogController(LogService logService){this.logService = logService;}
+	
+	@ApiOperation("分页列出所有")    
+	@ApiResponses({
+            @ApiResponse(code = 0, message = "成功")
+    })
+    @GetMapping("listpage")
+    public Result<PageInfo<LogEntity>> listpage(Integer page, Integer size) {
+        PageHelper.startPage(page, size, "id desc");
+        return Result.success(new PageInfo<>(logService.getAllLog()));
+    }
+	
+    @ApiOperation("ID查找")    
+	@ApiResponses({
+            @ApiResponse(code = 0, message = "成功")
+    })
+    @GetMapping("get")
+    public  Result<LogEntity> get(@RequestParam Integer id){return  Result.success(logService.getLog(id));}
+
+    @ApiOperation("增添")    
+	@ApiResponses({
+            @ApiResponse(code = 0, message = "成功")
+    })
+    @PostMapping("add")
+    public Result<String> add( @RequestBody LogEntity data){return  logService.add(data);}
+
+    @ApiOperation("删除")    
+	@ApiResponses({
+            @ApiResponse(code = 0, message = "成功")
+    })
+    @PostMapping("delete")
+    public Result<String> delete(@RequestBody DeleteEntity deleteEntity){return  logService.delete(deleteEntity.getIds());}
+
+    @ApiOperation("修改")    
+	@ApiResponses({
+            @ApiResponse(code = 0, message = "成功")
+    })
+    @PostMapping("edit")
+    public Result<String> edit( @RequestBody LogEntity data){return  logService.edit(data);}
+
+    @ApiOperation("查")
+    @ApiResponses({
+            @ApiResponse(code = 0, message = "成功")
+    })
+    @PostMapping("findByLog")
+    public Result<List<LogEntity>> findByLog(@RequestBody LogEntity log){
+	    return logService.findByLog(log);
+    }
+
+}

+ 87 - 0
src/main/java/com/zglc/fm/controller/MajorController.java

@@ -0,0 +1,87 @@
+package com.zglc.fm.controller;
+
+
+import com.github.pagehelper.PageHelper;
+import com.github.pagehelper.PageInfo;
+import com.zglc.fm.base.Result;
+import com.zglc.fm.entity.DeleteEntity;
+import com.zglc.fm.entity.MajorEntity;
+import com.zglc.fm.entity.OutlineEntity;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import io.swagger.annotations.ApiResponse;
+import io.swagger.annotations.ApiResponses;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+import com.zglc.fm.service.MajorService;
+import javax.annotation.Resource;
+import java.util.List;
+
+@Api(tags = "专业接口")
+@RequestMapping("api/major")
+@CrossOrigin(allowCredentials = "true")
+@RestController
+public class MajorController {
+
+    @Resource
+    private final MajorService majorService;
+    @Autowired(required = false)
+    public MajorController(MajorService majorService){
+        this.majorService = majorService;
+    }
+
+
+    @ApiOperation("列出所有")
+    @ApiResponses({
+            @ApiResponse(code = 0, message = "成功")
+    })
+    @GetMapping("listAll")
+    public Result<List<MajorEntity>> listAll() {
+        return Result.success(majorService.listAll());
+    }
+
+    @ApiOperation("ID查找")
+    @ApiResponses({
+            @ApiResponse(code = 0, message = "成功")
+    })
+    @GetMapping("get")
+    public  Result<MajorEntity> get(@RequestParam Integer id){return  Result.success(majorService.getMajor(id));}
+
+    @ApiOperation("按名称查询")
+    @GetMapping("getByName")
+    public Result<List<MajorEntity>> findByName(@RequestParam("name") String name){
+        return majorService.findByName(name);
+    }
+
+    @ApiOperation("增添")
+    @ApiResponses({
+            @ApiResponse(code = 0, message = "成功")
+    })
+    @PostMapping("add")
+    public Result<String> add(@RequestBody MajorEntity data){return  majorService.add(data);}
+
+    @ApiOperation("删除")
+    @ApiResponses({
+            @ApiResponse(code = 0, message = "成功")
+    })
+    @PostMapping("delete")
+    public Result<String> delete(@RequestBody DeleteEntity deleteEntity){return  majorService.delete(deleteEntity.getIds());}
+
+    @ApiOperation("修改")
+    @ApiResponses({
+            @ApiResponse(code = 0, message = "成功")
+    })
+    @PostMapping("edit")
+    public Result<String> edit( @RequestBody MajorEntity data){return  majorService.edit(data);}
+
+    @ApiOperation("分页列出所有")
+    @ApiResponses({
+            @ApiResponse(code = 0, message = "成功")
+    })
+    @GetMapping("listpage")
+    public Result<PageInfo<MajorEntity>> listpage(Integer page, Integer size) {
+        PageHelper.startPage(page, size, "id desc");
+        return Result.success(new PageInfo<>(majorService.getAllMajor()));
+    }
+
+}

+ 141 - 0
src/main/java/com/zglc/fm/controller/ManuelController.java

@@ -0,0 +1,141 @@
+package com.zglc.fm.controller;
+
+
+import com.github.pagehelper.PageHelper;
+import com.github.pagehelper.PageInfo;
+import com.zglc.fm.base.Result;
+import com.zglc.fm.entity.DeleteEntity;
+import com.zglc.fm.entity.ManuelEntity;
+import com.zglc.fm.service.ManuelService;
+import com.zglc.fm.utils.DocToPdf;
+import com.zglc.fm.utils.FileTool;
+import com.zglc.fm.utils.FileTypeUtil;
+import com.zglc.fm.utils.Ppt2ToPdf;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import io.swagger.annotations.ApiResponse;
+import io.swagger.annotations.ApiResponses;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.annotation.Value;
+import org.springframework.web.bind.annotation.*;
+import org.springframework.web.multipart.MultipartFile;
+
+import javax.annotation.Resource;
+import javax.servlet.http.HttpServletRequest;
+import java.util.Date;
+import java.util.List;
+
+@Api(tags = "维修手册接口")
+@RequestMapping("api/manuel")
+@CrossOrigin(allowCredentials = "true")
+@RestController
+public class ManuelController {
+
+    @Resource
+    private final ManuelService manuelService;
+    @Autowired(required = false)
+    public ManuelController(ManuelService manuelService){
+        this.manuelService = manuelService;
+    }
+
+    @Value("${spring.article.sourcePath}")
+    private String sourcePath;
+
+    @ApiOperation("导入")
+    @ApiResponses({
+            @ApiResponse(code = 0, message = "成功")
+    })
+    @PostMapping("import")
+    public Result<Object> importFile(HttpServletRequest request, @RequestParam("file") MultipartFile file){
+        Date date = new Date();
+        String sourcePath1;
+
+        sourcePath1 = "d:\\sourcefm";
+        String filePath = FileTool.fileUp(file, sourcePath1, date.getTime() + file.getOriginalFilename());
+
+        FileTypeUtil.Type fileType = FileTypeUtil.getFileType(file.getOriginalFilename());
+        if (fileType == FileTypeUtil.Type.DOC || fileType == FileTypeUtil.Type.DOCX ||  fileType == FileTypeUtil.Type.RTF ) {
+            DocToPdf.convertDoc2Pdf(filePath, sourcePath1);
+        }
+        if (fileType == FileTypeUtil.Type.PPT || fileType == FileTypeUtil.Type.PPTX) {
+            Ppt2ToPdf.convertPpt2Pdf(filePath, sourcePath1);
+        }
+        if (fileType == FileTypeUtil.Type.DOC) {
+            filePath = filePath.replaceAll( "doc","pdf");
+            filePath = filePath.replaceAll( "d:","");
+        }
+        if (fileType == FileTypeUtil.Type.DOCX) {
+            filePath = filePath.replaceAll( "docx","pdf");
+            filePath = filePath.replaceAll( "d:","");
+        }
+        if (fileType == FileTypeUtil.Type.RTF) {
+            filePath = filePath.replaceAll( "rtf","pdf");
+            filePath = filePath.replaceAll( "d:","");
+        }
+        if (fileType == FileTypeUtil.Type.PPT) {
+            filePath = filePath.replaceAll( "ppt","pdf");
+            filePath = filePath.replaceAll( "d:","");
+        }
+        if (fileType == FileTypeUtil.Type.PPTX) {
+            filePath = filePath.replaceAll( "pptx","pdf");
+            filePath = filePath.replaceAll( "d:","");
+        }
+        return Result.success(filePath);
+    }
+
+
+    @ApiOperation("列出所有")
+    @ApiResponses({
+            @ApiResponse(code = 0, message = "成功")
+    })
+    @GetMapping("listAll")
+    public Result<List<ManuelEntity>> listAll() {
+        return Result.success(manuelService.listAll());
+    }
+
+    @ApiOperation("ID查找")
+    @ApiResponses({
+            @ApiResponse(code = 0, message = "成功")
+    })
+    @GetMapping("get")
+    public  Result<ManuelEntity> get(@RequestParam Integer id){return  Result.success(manuelService.getOutline(id));}
+
+    @ApiOperation("按名称查询")
+    @GetMapping("getByName")
+    public Result<List<ManuelEntity>> findByName(@RequestParam("name") String name){
+        return manuelService.findByName(name);
+    }
+
+    @ApiOperation("增添")
+    @ApiResponses({
+            @ApiResponse(code = 0, message = "成功")
+    })
+    @PostMapping("add")
+    public Result<String> add(@RequestBody ManuelEntity data){return  manuelService.add(data);}
+
+    @ApiOperation("删除")
+    @ApiResponses({
+            @ApiResponse(code = 0, message = "成功")
+    })
+    @PostMapping("delete")
+    public Result<String> delete(@RequestBody DeleteEntity deleteEntity){return  manuelService.delete(deleteEntity.getIds());}
+
+    @ApiOperation("修改")
+    @ApiResponses({
+            @ApiResponse(code = 0, message = "成功")
+    })
+    @PostMapping("edit")
+    public Result<String> edit( @RequestBody ManuelEntity data){return  manuelService.edit(data);}
+
+
+    @ApiOperation("分页列出所有")
+    @ApiResponses({
+            @ApiResponse(code = 0, message = "成功")
+    })
+    @GetMapping("listpage")
+    public Result<PageInfo<ManuelEntity>> listpage(Integer page, Integer size) {
+        PageHelper.startPage(page, size, "id desc");
+        return Result.success(new PageInfo<>(manuelService.getAllManuel()));
+    }
+
+}

+ 140 - 0
src/main/java/com/zglc/fm/controller/OutlineController.java

@@ -0,0 +1,140 @@
+package com.zglc.fm.controller;
+
+
+import com.github.pagehelper.PageHelper;
+import com.github.pagehelper.PageInfo;
+import com.zglc.fm.base.Result;
+import com.zglc.fm.entity.DeleteEntity;
+import com.zglc.fm.entity.FaultEntity;
+import com.zglc.fm.entity.OutlineEntity;
+import com.zglc.fm.service.OutlineService;
+import com.zglc.fm.utils.DocToPdf;
+import com.zglc.fm.utils.FileTool;
+import com.zglc.fm.utils.FileTypeUtil;
+import com.zglc.fm.utils.Ppt2ToPdf;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import io.swagger.annotations.ApiResponse;
+import io.swagger.annotations.ApiResponses;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.annotation.Value;
+import org.springframework.web.bind.annotation.*;
+import org.springframework.web.multipart.MultipartFile;
+
+import javax.annotation.Resource;
+import javax.servlet.http.HttpServletRequest;
+import java.util.Date;
+import java.util.List;
+
+@Api(tags = "大纲接口")
+@RequestMapping("api/outline")
+@CrossOrigin(allowCredentials = "true")
+@RestController
+public class OutlineController {
+
+    @Resource
+    private final OutlineService outlineService;
+    @Autowired(required = false)
+    public OutlineController(OutlineService outlineService){
+        this.outlineService = outlineService;
+    }
+
+    @Value("${spring.article.sourcePath}")
+    private String sourcePath;
+
+    @ApiOperation("导入")
+    @ApiResponses({
+            @ApiResponse(code = 0, message = "成功")
+    })
+    @PostMapping("import")
+    public Result<Object> importFile(HttpServletRequest request, @RequestParam("file") MultipartFile file){
+        Date date = new Date();
+        String sourcePath1;
+
+        sourcePath1 = "d:\\sourcefm";
+        String filePath = FileTool.fileUp(file, sourcePath1, date.getTime() + file.getOriginalFilename());
+
+        FileTypeUtil.Type fileType = FileTypeUtil.getFileType(file.getOriginalFilename());
+        if (fileType == FileTypeUtil.Type.DOC || fileType == FileTypeUtil.Type.DOCX ||  fileType == FileTypeUtil.Type.RTF ) {
+            DocToPdf.convertDoc2Pdf(filePath, sourcePath1);
+        }
+        if (fileType == FileTypeUtil.Type.PPT || fileType == FileTypeUtil.Type.PPTX) {
+            Ppt2ToPdf.convertPpt2Pdf(filePath, sourcePath1);
+        }
+        if (fileType == FileTypeUtil.Type.DOC) {
+            filePath = filePath.replaceAll( "doc","pdf");
+            filePath = filePath.replaceAll( "d:","");
+        }
+        if (fileType == FileTypeUtil.Type.DOCX) {
+            filePath = filePath.replaceAll( "docx","pdf");
+            filePath = filePath.replaceAll( "d:","");
+        }
+        if (fileType == FileTypeUtil.Type.RTF) {
+            filePath = filePath.replaceAll( "rtf","pdf");
+            filePath = filePath.replaceAll( "d:","");
+        }
+        if (fileType == FileTypeUtil.Type.PPT) {
+            filePath = filePath.replaceAll( "ppt","pdf");
+            filePath = filePath.replaceAll( "d:","");
+        }
+        if (fileType == FileTypeUtil.Type.PPTX) {
+            filePath = filePath.replaceAll( "pptx","pdf");
+            filePath = filePath.replaceAll( "d:","");
+        }
+        return Result.success(filePath);
+    }
+
+    @ApiOperation("列出所有")
+    @ApiResponses({
+            @ApiResponse(code = 0, message = "成功")
+    })
+    @GetMapping("listAll")
+    public Result<List<OutlineEntity>> listAll() {
+        return Result.success(outlineService.listAll());
+    }
+
+    @ApiOperation("ID查找")
+    @ApiResponses({
+            @ApiResponse(code = 0, message = "成功")
+    })
+    @GetMapping("get")
+    public  Result<OutlineEntity> get(@RequestParam Integer id){return  Result.success(outlineService.getOutline(id));}
+
+    @ApiOperation("按名称查询")
+    @GetMapping("getByName")
+    public Result<List<OutlineEntity>> findByName(@RequestParam("name") String name){
+        return outlineService.findByName(name);
+    }
+
+    @ApiOperation("增添")
+    @ApiResponses({
+            @ApiResponse(code = 0, message = "成功")
+    })
+    @PostMapping("add")
+    public Result<String> add(@RequestBody OutlineEntity data){return  outlineService.add(data);}
+
+    @ApiOperation("删除")
+    @ApiResponses({
+            @ApiResponse(code = 0, message = "成功")
+    })
+    @PostMapping("delete")
+    public Result<String> delete(@RequestBody DeleteEntity deleteEntity){return  outlineService.delete(deleteEntity.getIds());}
+
+    @ApiOperation("修改")
+    @ApiResponses({
+            @ApiResponse(code = 0, message = "成功")
+    })
+    @PostMapping("edit")
+    public Result<String> edit( @RequestBody OutlineEntity data){return  outlineService.edit(data);}
+
+    @ApiOperation("分页列出所有")
+    @ApiResponses({
+            @ApiResponse(code = 0, message = "成功")
+    })
+    @GetMapping("listpage")
+    public Result<PageInfo<OutlineEntity>> listpage(Integer page, Integer size) {
+        PageHelper.startPage(page, size, "id desc");
+        return Result.success(new PageInfo<>(outlineService.getAllOutline()));
+    }
+
+}

+ 101 - 0
src/main/java/com/zglc/fm/controller/RightsController.java

@@ -0,0 +1,101 @@
+package com.zglc.fm.controller;
+
+import javax.annotation.Resource;
+import java.util.List;
+import com.github.pagehelper.PageHelper;
+import com.github.pagehelper.PageInfo;
+import com.zglc.fm.entity.DeleteEntity;
+import org.springframework.web.bind.annotation.*;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import io.swagger.annotations.ApiResponse;
+import io.swagger.annotations.ApiResponses;
+import com.zglc.fm.base.Result;
+import com.zglc.fm.entity.RightsEntity;
+import com.zglc.fm.service.RightsService;
+
+
+
+/**
+ * 权限
+ *
+ * @author wcf
+ * @email mnhwa@163.com
+ * @date 2020-02-14 14:42:47
+ * @description Refactoring 1st
+ *
+ */
+ 
+@Api(tags = "权限接口")
+@RequestMapping("api/rights")
+@CrossOrigin(allowCredentials = "true")
+@RestController
+public class RightsController {
+
+	@Resource
+    private final RightsService rightsService;
+
+	public RightsController(RightsService rightsService){this.rightsService = rightsService;}
+	
+	@ApiOperation("分页列出所有")    
+	@ApiResponses({
+            @ApiResponse(code = 0, message = "成功")
+    })
+    @GetMapping("listpage")
+    public Result<PageInfo<RightsEntity>> listpage(Integer page, Integer size) {
+        PageHelper.startPage(page, size, "id desc");
+        return Result.success(new PageInfo<>(rightsService.getAllRights()));
+    }
+	
+    @ApiOperation("ID查找")    
+	@ApiResponses({
+            @ApiResponse(code = 0, message = "成功")
+    })
+    @GetMapping("get")
+    public  Result<RightsEntity> get(@RequestParam Integer id){return  Result.success(rightsService.getRights(id));}
+
+    @ApiOperation("增添")    
+	@ApiResponses({
+            @ApiResponse(code = 0, message = "成功")
+    })
+    @PostMapping("add")
+    public Result<String> add( @RequestBody RightsEntity data){return  rightsService.add(data);}
+
+    @ApiOperation("删除")    
+	@ApiResponses({
+            @ApiResponse(code = 0, message = "成功")
+    })
+    @PostMapping("delete")
+    public Result<String> delete(@RequestBody DeleteEntity deleteEntity){return  rightsService.delete(deleteEntity.getIds());}
+
+    @ApiOperation("修改")    
+	@ApiResponses({
+            @ApiResponse(code = 0, message = "成功")
+    })
+    @PostMapping("edit")
+    public Result<String> edit( @RequestBody RightsEntity data){return  rightsService.edit(data);}
+
+    @ApiOperation("测试权限")
+    @ApiResponses({
+            @ApiResponse(code = 0, message = "成功")
+    })
+    @PostMapping("haveRights")
+    public Result haveRights( @RequestParam String rights,@RequestParam Integer roleId){
+	    if (rightsService.haveRights(rights,roleId))
+	        return Result.success();
+	    else
+	        return Result.fail();
+	}
+
+    @ApiOperation("按名称列出所有")
+    @ApiResponses({
+            @ApiResponse(code = 0, message = "成功")
+    })
+    @GetMapping("listByRole")
+    public Result<List<RightsEntity>> listByRole(@RequestParam Integer roleId) {
+        List<RightsEntity> lst = rightsService.listAllByRole(roleId);
+        String msg = "无数据";
+        return Result.result(lst != null ,msg,lst);
+    }
+
+}

+ 136 - 0
src/main/java/com/zglc/fm/controller/RoleController.java

@@ -0,0 +1,136 @@
+package com.zglc.fm.controller;
+
+import javax.annotation.Resource;
+import java.util.List;
+import com.github.pagehelper.PageHelper;
+import com.github.pagehelper.PageInfo;
+import com.zglc.fm.entity.DeleteEntity;
+import com.zglc.fm.utils.RightsTool;
+import org.springframework.web.bind.annotation.*;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import io.swagger.annotations.ApiResponse;
+import io.swagger.annotations.ApiResponses;
+import com.zglc.fm.base.Result;
+import com.zglc.fm.entity.RoleEntity;
+import com.zglc.fm.service.RoleService;
+
+
+/**
+ * 角色
+ *
+ * @author wcf
+ * @email mnhwa@163.com
+ * @date 2020-02-14 14:42:47
+ * @description Refactoring 1st
+ *
+ */
+ 
+@Api(tags = "角色接口")
+@RequestMapping("api/role")
+@CrossOrigin(allowCredentials = "true")
+@RestController
+public class RoleController {
+
+	@Resource
+    private final RoleService roleService;
+
+	public RoleController(RoleService roleService){this.roleService = roleService;}
+	
+	@ApiOperation("分页列出所有")    
+	@ApiResponses({
+            @ApiResponse(code = 0, message = "成功")
+    })
+    @GetMapping("listpage")
+    public Result<PageInfo<RoleEntity>> listpage(Integer page, Integer size) {
+        PageHelper.startPage(page, size, "id desc");
+        return Result.success(new PageInfo<>(roleService.getAllRole()));
+    }
+
+    @ApiOperation("列出所有")
+    @ApiResponses({
+            @ApiResponse(code = 0, message = "成功")
+    })
+    @GetMapping("listAll")
+    public Result<List<RoleEntity>> listAll() {
+	    List<RoleEntity> lst = roleService.listAll();
+	    String msg = "无数据";
+        return Result.result(lst != null ,msg,lst);
+    }
+
+    @ApiOperation("ID查找")    
+	@ApiResponses({
+            @ApiResponse(code = 0, message = "成功")
+    })
+    @GetMapping("get")
+    public  Result<RoleEntity> get(@RequestParam Integer id){return  Result.success(roleService.getRole(id));}
+
+    @ApiOperation("增添")    
+	@ApiResponses({
+            @ApiResponse(code = 0, message = "成功")
+    })
+    @PostMapping("add")
+    public Result<String> add( @RequestBody RoleEntity data){return  roleService.add(data);}
+
+
+    @ApiOperation("增加权限")
+    @ApiResponses({
+            @ApiResponse(code = 0, message = "成功")
+    })
+    @PostMapping("addRights")
+    public Result<String> addRight( @RequestBody DeleteEntity data){
+	    RoleEntity roleEntity = roleService.getRole(data.getId());
+	    if (roleEntity != null){
+	        for (Integer id:data.getIds()){
+                roleEntity.setRights(RightsTool.setRights(roleEntity.getRights(),id,true));
+            }
+            return roleService.edit(roleEntity);
+        }
+        return Result.success("角色不存在!");
+	}
+
+
+    @ApiOperation("删除权限")
+    @ApiResponses({
+            @ApiResponse(code = 0, message = "成功")
+    })
+    @PostMapping("deleteRights")
+    public Result<String> deleteRight( @RequestBody DeleteEntity data){
+	    RoleEntity roleEntity = roleService.getRole(data.getId());
+        if (roleEntity != null){
+            for (Integer id:data.getIds()){
+                roleEntity.setRights(RightsTool.setRights(roleEntity.getRights(),id,false));
+            }
+            return roleService.edit(roleEntity);
+        }
+        return Result.success("角色不存在!");
+	}
+
+
+    @ApiOperation("删除")    
+	@ApiResponses({
+            @ApiResponse(code = 0, message = "成功")
+    })
+    @PostMapping("delete")
+    public Result<String> delete(@RequestBody DeleteEntity deleteEntity){
+	    return  roleService.delete(deleteEntity.getIds());
+	}
+
+    @ApiOperation("修改")    
+	@ApiResponses({
+            @ApiResponse(code = 0, message = "成功")
+    })
+    @PostMapping("edit")
+    public Result<String> edit( @RequestBody RoleEntity data){return  roleService.edit(data);}
+
+    @ApiOperation("按名称列出所有")
+    @ApiResponses({
+            @ApiResponse(code = 0, message = "成功")
+    })
+    @GetMapping("searchData")
+    public Result<PageInfo<RoleEntity>> searchData(@RequestParam String roleName,Integer page, Integer size) {
+        PageHelper.startPage(page, size, "id desc");
+        return Result.success(new PageInfo<>(roleService.listByName(roleName)));
+    }
+
+}

+ 134 - 0
src/main/java/com/zglc/fm/controller/UserController.java

@@ -0,0 +1,134 @@
+package com.zglc.fm.controller;
+
+import javax.annotation.Resource;
+import java.util.List;
+import com.github.pagehelper.PageHelper;
+import com.github.pagehelper.PageInfo;
+import com.zglc.fm.entity.DeleteEntity;
+import org.springframework.web.bind.annotation.*;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import io.swagger.annotations.ApiResponse;
+import io.swagger.annotations.ApiResponses;
+import com.zglc.fm.base.Result;
+import com.zglc.fm.entity.UserEntity;
+import com.zglc.fm.service.UserService;
+
+
+
+/**
+ * 用户
+ *
+ * @author wcf
+ * @email mnhwa@163.com
+ * @date 2020-02-14 14:42:47
+ * @description Refactoring 1st
+ *
+ */
+ 
+@Api(tags = "用户接口")
+@RequestMapping("api/user")
+@CrossOrigin(allowCredentials = "true")
+@RestController
+public class UserController {
+
+	@Resource
+    private final UserService userService;
+
+	public UserController(UserService userService){
+	    this.userService = userService;
+	}
+
+	@ApiOperation("分页列出所有")    
+	@ApiResponses({
+            @ApiResponse(code = 0, message = "成功")
+    })
+    @GetMapping("listpage")
+    public Result<PageInfo<UserEntity>> listpage(Integer page, Integer size) {
+        PageHelper.startPage(page, size, "id desc");
+        return Result.success(new PageInfo<>(userService.getAllUser()));
+    }
+
+    @ApiOperation("列出所有")
+    @ApiResponses({
+            @ApiResponse(code = 0, message = "成功")
+    })
+    @GetMapping("listAll")
+    public Result<List<UserEntity>> listAll(Integer departmentId,Integer roleId) {
+        return Result.success(userService.listAll());
+    }
+
+    @ApiOperation("按参数列出所有")
+    @ApiResponses({
+            @ApiResponse(code = 0, message = "成功")
+    })
+    @GetMapping("listBy")
+    public Result<List<UserEntity>> listBy(Integer departmentId,Integer roleId) {
+        return Result.success(userService.searchAllUser(departmentId,roleId,null,null));
+    }
+
+    @ApiOperation("名称查询")
+    @ApiResponses({
+            @ApiResponse(code = 0, message = "成功")
+    })
+    @GetMapping("getByName")
+    public Result<List<UserEntity>> getByName(@RequestParam("name") String name){
+	    return userService.findByName(name);
+    }
+
+    @ApiOperation("分页条件筛选")
+    @ApiResponses({
+            @ApiResponse(code = 0, message = "成功")
+    })
+    @GetMapping("searchData")
+    public Result<PageInfo<UserEntity>> searchData(Integer departmentId,Integer roleId,Integer nameType,String name,Integer page, Integer size) {
+        PageHelper.startPage(page, size, "id desc");
+        return Result.success(new PageInfo<>( userService.searchAllUser(departmentId,roleId,nameType,name)));
+    }
+
+    @ApiOperation("人员统计")
+    @ApiResponses({
+            @ApiResponse(code = 0, message = "成功")
+    })
+    @GetMapping("getCount")
+    public  Result<Integer> getCount(){return  Result.success(userService.getCount());}
+
+    @ApiOperation("ID查找")    
+	@ApiResponses({
+            @ApiResponse(code = 0, message = "成功")
+    })
+    @GetMapping("get")
+    public  Result<UserEntity> get(@RequestParam Integer id){return  Result.success(userService.getUser(id));}
+
+    @ApiOperation("增添")    
+	@ApiResponses({
+            @ApiResponse(code = 0, message = "成功")
+    })
+    @PostMapping("add")
+    public Result<String> add( @RequestBody UserEntity data){return  userService.add(data);}
+
+    @ApiOperation("删除")    
+	@ApiResponses({
+            @ApiResponse(code = 0, message = "成功")
+    })
+    @PostMapping("delete")
+    public Result<String> delete(@RequestBody DeleteEntity deleteEntity){return  userService.delete(deleteEntity.getIds());}
+
+    @ApiOperation("修改")    
+	@ApiResponses({
+            @ApiResponse(code = 0, message = "成功")
+    })
+    @PostMapping("edit")
+    public Result<String> edit( @RequestBody UserEntity data){return  userService.edit(data);}
+
+    @ApiOperation("查")
+    @ApiResponses({
+            @ApiResponse(code = 0, message = "成功")
+    })
+    @PostMapping("findByUser")
+    public Result<List<UserEntity>> findByUser(@RequestBody UserEntity user){
+	    return userService.findByUser(user);
+    }
+
+
+}

+ 20 - 0
src/main/java/com/zglc/fm/dao/AircraftTypeDao.java

@@ -0,0 +1,20 @@
+package com.zglc.fm.dao;
+
+import com.zglc.fm.entity.AircraftTypeEntity;
+import org.apache.ibatis.annotations.Param;
+import org.springframework.stereotype.Repository;
+import tk.mybatis.mapper.common.Mapper;
+
+import java.util.List;
+
+@Repository
+public interface AircraftTypeDao extends Mapper<AircraftTypeEntity> {
+
+    List<AircraftTypeEntity> listAll();
+
+    Integer addNotExist(AircraftTypeEntity aircraft);
+
+    List<AircraftTypeEntity> findByName(@Param("name") String name);
+
+    Integer findMinId();
+}

+ 18 - 0
src/main/java/com/zglc/fm/dao/BookDao.java

@@ -0,0 +1,18 @@
+package com.zglc.fm.dao;
+
+import com.zglc.fm.entity.BookEntity;
+import org.apache.ibatis.annotations.Param;
+import org.springframework.stereotype.Repository;
+import tk.mybatis.mapper.common.Mapper;
+
+import java.util.List;
+
+@Repository
+public interface BookDao extends Mapper<BookEntity> {
+
+    List<BookEntity> listAll();
+
+    Integer getCount();
+
+    List<BookEntity> findByName(@Param("book_name") String name);
+}

+ 18 - 0
src/main/java/com/zglc/fm/dao/CardDao.java

@@ -0,0 +1,18 @@
+package com.zglc.fm.dao;
+
+import com.zglc.fm.entity.CardEntity;
+import org.apache.ibatis.annotations.Param;
+import org.springframework.stereotype.Repository;
+import tk.mybatis.mapper.common.Mapper;
+
+import java.util.List;
+
+@Repository
+public interface CardDao extends Mapper<CardEntity> {
+
+    List<CardEntity> listAll();
+
+    Integer getCount();
+
+    List<CardEntity> findByName(@Param("card_name") String name);
+}

+ 25 - 0
src/main/java/com/zglc/fm/dao/DepartmentDao.java

@@ -0,0 +1,25 @@
+package com.zglc.fm.dao;
+
+import com.zglc.fm.entity.DepartmentEntity;
+import org.apache.ibatis.annotations.Param;
+import org.springframework.stereotype.Repository;
+import tk.mybatis.mapper.common.Mapper;
+
+import java.util.List;
+
+/**
+ * 部门
+ * 
+ * @author wcf
+ * @email mnhwa@163.com
+ * @date 2020-02-14 01:33:53
+ * @description Refactoring 1st
+ *
+ */
+@Repository
+public interface DepartmentDao extends Mapper<DepartmentEntity> {
+
+    List<DepartmentEntity> listAll();
+    List<DepartmentEntity> listsub(Integer id);
+    List<DepartmentEntity> findByName(@Param("name") String name);
+}

+ 18 - 0
src/main/java/com/zglc/fm/dao/FaultDao.java

@@ -0,0 +1,18 @@
+package com.zglc.fm.dao;
+
+import com.zglc.fm.entity.FaultEntity;
+import org.apache.ibatis.annotations.Param;
+import org.springframework.stereotype.Repository;
+import tk.mybatis.mapper.common.Mapper;
+
+import java.util.List;
+
+@Repository
+public interface FaultDao extends Mapper<FaultEntity> {
+
+    List<FaultEntity> listAll();
+
+    Integer getCount();
+
+    List<FaultEntity> findByName(@Param("fault_name") String name);
+}

+ 20 - 0
src/main/java/com/zglc/fm/dao/FloatValueDao.java

@@ -0,0 +1,20 @@
+package com.zglc.fm.dao;
+
+import com.zglc.fm.entity.FloatValue;
+import org.springframework.stereotype.Repository;
+import tk.mybatis.mapper.common.Mapper;
+
+/**
+ * 
+ * 
+ * @author wcf
+ * @email mnhwa@163.com
+ * @date 2020-02-14 01:33:53
+ * @description Refactoring 1st
+ *
+ */
+@Repository
+public interface FloatValueDao extends Mapper<FloatValue> {
+
+	
+}

+ 20 - 0
src/main/java/com/zglc/fm/dao/IntValueDao.java

@@ -0,0 +1,20 @@
+package com.zglc.fm.dao;
+
+import com.zglc.fm.entity.IntValue;
+import org.springframework.stereotype.Repository;
+import tk.mybatis.mapper.common.Mapper;
+
+/**
+ *
+ * 
+ * @author wcf
+ * @email mnhwa@163.com
+ * @date 2020-02-14 01:33:53
+ * @description Refactoring 1st
+ *
+ */
+@Repository
+public interface IntValueDao extends Mapper<IntValue> {
+
+	
+}

+ 23 - 0
src/main/java/com/zglc/fm/dao/LogDao.java

@@ -0,0 +1,23 @@
+package com.zglc.fm.dao;
+
+import com.zglc.fm.entity.LogEntity;
+import org.springframework.stereotype.Repository;
+import tk.mybatis.mapper.common.Mapper;
+
+import java.util.List;
+
+/**
+ * 日志
+ * 
+ * @author wcf
+ * @email mnhwa@163.com
+ * @date 2020-02-14 01:33:53
+ * @description Refactoring 1st
+ *
+ */
+@Repository
+public interface LogDao extends Mapper<LogEntity> {
+
+    List<LogEntity> findByLog(LogEntity log);
+	
+}

+ 18 - 0
src/main/java/com/zglc/fm/dao/MajorDao.java

@@ -0,0 +1,18 @@
+package com.zglc.fm.dao;
+
+import com.zglc.fm.entity.MajorEntity;
+import org.apache.ibatis.annotations.Param;
+import org.springframework.stereotype.Repository;
+import tk.mybatis.mapper.common.Mapper;
+
+import java.util.List;
+
+@Repository
+public interface MajorDao extends Mapper<MajorEntity> {
+
+    List<MajorEntity> listAll();
+
+    Integer getCount();
+
+    List<MajorEntity> findByName(@Param("major_name") String name);
+}

+ 18 - 0
src/main/java/com/zglc/fm/dao/ManuelDao.java

@@ -0,0 +1,18 @@
+package com.zglc.fm.dao;
+
+import com.zglc.fm.entity.ManuelEntity;
+import org.apache.ibatis.annotations.Param;
+import org.springframework.stereotype.Repository;
+import tk.mybatis.mapper.common.Mapper;
+
+import java.util.List;
+
+@Repository
+public interface ManuelDao extends Mapper<ManuelEntity> {
+
+    List<ManuelEntity> listAll();
+
+    Integer getCount();
+
+    List<ManuelEntity> findByName(@Param("manuel_name") String name);
+}

+ 18 - 0
src/main/java/com/zglc/fm/dao/OutlineDao.java

@@ -0,0 +1,18 @@
+package com.zglc.fm.dao;
+
+import com.zglc.fm.entity.OutlineEntity;
+import org.apache.ibatis.annotations.Param;
+import org.springframework.stereotype.Repository;
+import tk.mybatis.mapper.common.Mapper;
+
+import java.util.List;
+
+@Repository
+public interface OutlineDao extends Mapper<OutlineEntity> {
+
+    List<OutlineEntity> listAll();
+
+    Integer getCount();
+
+    List<OutlineEntity> findByName(@Param("outline_name") String name);
+}

+ 23 - 0
src/main/java/com/zglc/fm/dao/RightsDao.java

@@ -0,0 +1,23 @@
+package com.zglc.fm.dao;
+
+import com.zglc.fm.entity.RightsEntity;
+import org.springframework.stereotype.Repository;
+import tk.mybatis.mapper.common.Mapper;
+
+import java.util.List;
+
+/**
+ * 权限
+ * 
+ * @author wcf
+ * @email mnhwa@163.com
+ * @date 2020-02-14 01:33:53
+ * @description Refactoring 1st
+ *
+ */
+@Repository
+public interface RightsDao extends Mapper<RightsEntity> {
+
+    List<RightsEntity> listAll();
+	
+}

+ 23 - 0
src/main/java/com/zglc/fm/dao/RoleDao.java

@@ -0,0 +1,23 @@
+package com.zglc.fm.dao;
+
+import com.zglc.fm.entity.RoleEntity;
+import org.springframework.stereotype.Repository;
+import tk.mybatis.mapper.common.Mapper;
+
+import java.util.List;
+
+/**
+ * 角色
+ * 
+ * @author wcf
+ * @email mnhwa@163.com
+ * @date 2020-02-14 01:33:53
+ * @description Refactoring 1st
+ *
+ */
+@Repository
+public interface RoleDao extends Mapper<RoleEntity> {
+
+    List<RoleEntity> listAll();
+    List<RoleEntity> getByName(String name);
+}

+ 21 - 0
src/main/java/com/zglc/fm/dao/StrValueDao.java

@@ -0,0 +1,21 @@
+package com.zglc.fm.dao;
+
+import com.zglc.fm.entity.StrValue;
+import org.springframework.stereotype.Repository;
+import tk.mybatis.mapper.common.Mapper;
+
+/**
+ * 
+ * 
+ * @author wcf
+ * @email mnhwa@163.com
+ * @date 2020-02-14 01:33:53
+ * @description Refactoring 1st
+ *
+ */
+@Repository
+
+public interface StrValueDao extends Mapper<StrValue> {
+
+
+}

+ 28 - 0
src/main/java/com/zglc/fm/dao/UserDao.java

@@ -0,0 +1,28 @@
+package com.zglc.fm.dao;
+
+import com.zglc.fm.entity.UserEntity;
+import org.apache.ibatis.annotations.Param;
+import org.springframework.stereotype.Repository;
+import tk.mybatis.mapper.common.Mapper;
+
+import java.util.List;
+
+/**
+ * 用户
+ * 
+ * @author wcf
+ * @email mnhwa@163.com
+ * @date 2020-02-14 01:33:53
+ * @description Refactoring 1st
+ *
+ */
+@Repository
+public interface UserDao extends Mapper<UserEntity> {
+	List<UserEntity> listAll();
+
+	Integer getCount();
+
+	List<UserEntity> findByName(@Param("name") String name);
+
+	List<UserEntity> findByUser(UserEntity user);
+}

+ 22 - 0
src/main/java/com/zglc/fm/entity/AircraftTypeEntity.java

@@ -0,0 +1,22 @@
+package com.zglc.fm.entity;
+
+import lombok.Data;
+
+import javax.persistence.*;
+
+@Data
+@Table(name = "t_aircraft_type")
+public class AircraftTypeEntity {
+
+    @Id
+    @GeneratedValue(strategy = GenerationType.IDENTITY)
+    @Column(name = "id")
+    private Integer id;
+
+    @Column(name = "aircraft_type")
+    private String aircraft_type;
+
+    @Column(name = "remarks")
+    private String remarks;
+
+}

+ 64 - 0
src/main/java/com/zglc/fm/entity/BookEntity.java

@@ -0,0 +1,64 @@
+package com.zglc.fm.entity;
+
+import lombok.Data;
+
+import javax.persistence.*;
+import java.io.Serializable;
+import java.util.Date;
+
+@Data
+@Table(name = "t_book")
+public class BookEntity implements Serializable {
+    private static final long serialVersionUID = 1L;
+
+    /**
+     * id
+     */
+    @Id
+    @GeneratedValue(strategy = GenerationType.IDENTITY)
+    @Column(name = "id")
+    private Integer id;
+
+    /**
+     * book_name
+     */
+    @Column(name = "book_name")
+    private String book_name;
+
+    /**
+     * aircraft_type
+     */
+    @Column(name = "aircraft_type")
+    private String aircraft_type;
+
+    /**
+     * major_type
+     */
+    @Column(name = "major_type")
+    private String major_type;
+
+    /**
+     * description
+     */
+    @Column(name = "description")
+    private String description;
+
+    /**
+     * file_path
+     */
+    @Column(name = "file_path")
+    private String file_path;
+
+    /**
+     * input_time
+     */
+    @Column(name = "input_time")
+    private Date input_time;
+
+    /**
+     * remarks
+     */
+    @Column(name = "remarks")
+    private String remarks;
+}
+

+ 64 - 0
src/main/java/com/zglc/fm/entity/CardEntity.java

@@ -0,0 +1,64 @@
+package com.zglc.fm.entity;
+
+import lombok.Data;
+
+import javax.persistence.*;
+import java.io.Serializable;
+import java.util.Date;
+
+@Data
+@Table(name = "t_card")
+public class CardEntity implements Serializable {
+    private static final long serialVersionUID = 1L;
+
+    /**
+     * id
+     */
+    @Id
+    @GeneratedValue(strategy = GenerationType.IDENTITY)
+    @Column(name = "id")
+    private Integer id;
+
+    /**
+     * card_name
+     */
+    @Column(name = "card_name")
+    private String card_name;
+
+    /**
+     * aircraft_type
+     */
+    @Column(name = "aircraft_type")
+    private String aircraft_type;
+
+    /**
+     * major_type
+     */
+    @Column(name = "major_type")
+    private String major_type;
+
+    /**
+     * description
+     */
+    @Column(name = "description")
+    private String description;
+
+    /**
+     * file_path
+     */
+    @Column(name = "file_path")
+    private String file_path;
+
+    /**
+     * input_time
+     */
+    @Column(name = "input_time")
+    private Date input_time;
+
+    /**
+     * remarks
+     */
+    @Column(name = "remarks")
+    private String remarks;
+}
+

+ 19 - 0
src/main/java/com/zglc/fm/entity/DeleteEntity.java

@@ -0,0 +1,19 @@
+package com.zglc.fm.entity;
+
+import lombok.Data;
+
+import java.util.List;
+
+//这是一个不得已的办法,post方法无法接受list,暂时选此方法,后面可能还会出现别的
+@Data
+public class DeleteEntity {
+    public Integer id;
+    //用来存要删除的id
+    List<Integer> ids;
+    public DeleteEntity(){}
+    public DeleteEntity(List<String> ids){
+        ids.clear();
+        ids.forEach(id ->this.ids.add(Integer.parseInt(id)));
+    }
+
+}

+ 64 - 0
src/main/java/com/zglc/fm/entity/DepartmentEntity.java

@@ -0,0 +1,64 @@
+package com.zglc.fm.entity;
+import javax.persistence.*;
+import java.io.Serializable;
+import java.util.Date;
+import lombok.Data;
+
+/**
+ * 部门
+ * 
+ * @author wcf
+ * @email mnhwa@163.com
+ * @date 2020-02-14 23:23:33
+ * @description Refactoring 1st
+ *
+ */
+@Data
+@Table(name = "t_department")
+public class DepartmentEntity implements Serializable {
+	private static final long serialVersionUID = 1L;
+
+	/**
+	* 部门ID
+	*/
+	@Id
+	@GeneratedValue(strategy = GenerationType.IDENTITY)
+	@Column(name = "id")
+	private Integer id;
+	
+	/**
+	* 上级部门用于级别管理ID
+	*/
+	@Column(name = "parent_id")
+	private Integer parentId;
+	/**
+	 * 上级部门用于级别管理Name
+	 */
+	@Column(name = "parent_name")
+	private String parentName;
+	/**
+	* 部门名
+	*/
+	@Column(name = "department_name")
+	private String departmentName;
+	
+	/**
+	* 负责人
+	*/
+	@Column(name = "master_id")
+	private Integer masterId;
+	
+	/**
+	* 负责人姓名
+	*/
+	@Column(name = "master_name")
+	private String masterName;
+	
+	/**
+	* 
+	*/
+	@Column(name = "remark")
+	private String remark;
+	
+	
+}

+ 85 - 0
src/main/java/com/zglc/fm/entity/FaultEntity.java

@@ -0,0 +1,85 @@
+package com.zglc.fm.entity;
+
+import lombok.Data;
+
+import javax.persistence.*;
+import java.io.Serializable;
+import java.util.Date;
+
+@Data
+@Table(name = "t_fault")
+public class FaultEntity implements Serializable {
+    private static final long serialVersionUID = 1L;
+
+    /**
+     * id
+     */
+    @Id
+    @GeneratedValue(strategy = GenerationType.IDENTITY)
+    @Column(name = "id")
+    private Integer id;
+
+    /**
+     * fault_name
+     */
+    @Column(name = "fault_name")
+    private String fault_name;
+
+    /**
+     * fault_number
+     */
+    @Column(name = "fault_number")
+    private String fault_number;
+
+    @Column(name = "author")
+    private String author;
+
+    @Column(name = "department")
+    private String department;
+
+    /**
+     * aircraft_type
+     */
+    @Column(name = "aircraft_type")
+    private String aircraft_type;
+
+    /**
+     * major_type
+     */
+    @Column(name = "major_type")
+    private String major_type;
+
+    /**
+     * description
+     */
+    @Column(name = "description")
+    private String description;
+
+    /**
+     * file_path
+     */
+    @Column(name = "file_path")
+    private String file_path;
+
+    /**
+     * input_time
+     */
+    @Column(name = "input_time")
+    private Date input_time;
+
+    /**
+     * fault_time
+     */
+    @Column(name = "fault_time")
+    private Date fault_time;
+
+    @Column(name = "chapter")
+    private String chapter;
+
+    /**
+     * remarks
+     */
+    @Column(name = "remarks")
+    private String remarks;
+}
+

+ 23 - 0
src/main/java/com/zglc/fm/entity/FaultFind.java

@@ -0,0 +1,23 @@
+package com.zglc.fm.entity;
+
+import lombok.Getter;
+import lombok.Setter;
+
+import java.util.Date;
+
+@Getter
+@Setter
+public class FaultFind {
+
+    private String aircraft;
+
+    private String firstDevice;
+
+    private String secondDevice;
+
+    private String faultName;
+
+    private Date startTime;
+
+    private Date endTime;
+}

+ 23 - 0
src/main/java/com/zglc/fm/entity/FaultRecordStatistics.java

@@ -0,0 +1,23 @@
+package com.zglc.fm.entity;
+
+import lombok.Getter;
+import lombok.Setter;
+
+import java.util.Date;
+
+@Getter
+@Setter
+public class FaultRecordStatistics {
+
+    private Integer aircarftId;
+
+    private Date startTime;
+
+    private Date endTime;
+
+    private String Type;
+
+    private Integer startyear;
+
+    private Integer endyear;
+}

+ 26 - 0
src/main/java/com/zglc/fm/entity/FloatValue.java

@@ -0,0 +1,26 @@
+package com.zglc.fm.entity;
+
+import lombok.Data;
+
+import javax.persistence.Column;
+import javax.persistence.GeneratedValue;
+import javax.persistence.GenerationType;
+import javax.persistence.Id;
+
+@Data
+public class FloatValue {
+
+    /**
+     *
+     */
+    @Id
+    @GeneratedValue(strategy = GenerationType.IDENTITY)
+    @Column(name = "id")
+    private Integer id;
+
+    /**
+     * 
+     */
+    @Column(name = "v")
+    private String fv;
+}

+ 26 - 0
src/main/java/com/zglc/fm/entity/IntValue.java

@@ -0,0 +1,26 @@
+package com.zglc.fm.entity;
+
+import lombok.Data;
+
+import javax.persistence.Column;
+import javax.persistence.GeneratedValue;
+import javax.persistence.GenerationType;
+import javax.persistence.Id;
+
+@Data
+public class IntValue {
+
+    /**
+     *
+     */
+    @Id
+    @GeneratedValue(strategy = GenerationType.IDENTITY)
+    @Column(name = "id")
+    private Integer id;
+
+    /**
+     *
+     */
+    @Column(name = "v")
+    private String iv;
+}

+ 84 - 0
src/main/java/com/zglc/fm/entity/LogEntity.java

@@ -0,0 +1,84 @@
+package com.zglc.fm.entity;
+import javax.persistence.*;
+import java.io.Serializable;
+
+import lombok.Data;
+
+/**
+ * 日志
+ * 
+ * @author wcf
+ * @email mnhwa@163.com
+ * @date 2020-02-17 02:14:13
+ * @description Refactoring 1st
+ *
+ */
+@Data
+@Table(name = "t_log")
+public class LogEntity implements Serializable {
+	private static final long serialVersionUID = 1L;
+
+	/**
+	* 
+	*/
+	@Id
+	@GeneratedValue(strategy = GenerationType.IDENTITY)
+	@Column(name = "id")
+	private Integer id;
+	
+	/**
+	* 用户id
+	*/
+	@Column(name = "user_id")
+	private Integer userId;
+	
+	/**
+	* 操作用户姓名
+	*/
+	@Column(name = "real_name")
+	private String realName;
+	
+	/**
+	* 操作开始时刻
+	*/
+	@Column(name = "begin_time")
+	private String beginTime;
+	
+	/**
+	* 操作结束时刻
+	*/
+	@Column(name = "finish_time")
+	private String finishTime;
+	
+	/**
+	* 用户ip
+	*/
+	@Column(name = "user_ip")
+	private String userIp;
+	
+	/**
+	* 请求的url
+	*/
+	@Column(name = "request_url")
+	private String requestUrl;
+	
+	/**
+	* 请求描述
+	*/
+	@Column(name = "request_description")
+	private String requestDescription;
+	
+	/**
+	* 数据
+	*/
+	@Column(name = "arguments")
+	private String arguments;
+	
+	/**
+	* 执行结果
+	*/
+	@Column(name = "exec_status")
+	private Integer execStatus;
+	
+	
+}

+ 19 - 0
src/main/java/com/zglc/fm/entity/LoginVO.java

@@ -0,0 +1,19 @@
+package com.zglc.fm.entity;
+
+import lombok.Data;
+
+@Data
+public class LoginVO {
+
+    private Integer id;
+
+    private String userName;
+
+    private String realName;
+
+    private String roleName;
+
+    private Integer role;
+
+    private String token;
+}

+ 32 - 0
src/main/java/com/zglc/fm/entity/MajorEntity.java

@@ -0,0 +1,32 @@
+package com.zglc.fm.entity;
+import javax.persistence.*;
+
+import lombok.Data;
+
+
+@Data
+@Table(name = "t_major")
+public class MajorEntity {
+    private static final long serialVersionUID = 1L;
+
+    /**
+     *id
+     */
+    @Id
+    @GeneratedValue(strategy = GenerationType.IDENTITY)
+    @Column(name = "id")
+    private Integer id;
+
+    /**
+     * 专业名
+     */
+    @Column(name = "major_name")
+    private String major_name;
+
+    /**
+     * 备注
+     */
+    @Column(name = "remarks")
+    private String remarks;
+
+}

+ 64 - 0
src/main/java/com/zglc/fm/entity/ManuelEntity.java

@@ -0,0 +1,64 @@
+package com.zglc.fm.entity;
+
+import lombok.Data;
+
+import javax.persistence.*;
+import java.io.Serializable;
+import java.util.Date;
+
+@Data
+@Table(name = "t_manuel")
+public class ManuelEntity implements Serializable {
+    private static final long serialVersionUID = 1L;
+
+    /**
+     * id
+     */
+    @Id
+    @GeneratedValue(strategy = GenerationType.IDENTITY)
+    @Column(name = "id")
+    private Integer id;
+
+    /**
+     * manuel_name
+     */
+    @Column(name = "manuel_name")
+    private String manuel_name;
+
+    /**
+     * aircraft_type
+     */
+    @Column(name = "aircraft_type")
+    private String aircraft_type;
+
+    /**
+     * major_type
+     */
+    @Column(name = "major_type")
+    private String major_type;
+
+    /**
+     * description
+     */
+    @Column(name = "description")
+    private String description;
+
+    /**
+     * file_path
+     */
+    @Column(name = "file_path")
+    private String file_path;
+
+    /**
+     * input_time
+     */
+    @Column(name = "input_time")
+    private Date input_time;
+
+    /**
+     * remarks
+     */
+    @Column(name = "remarks")
+    private String remarks;
+}
+

+ 62 - 0
src/main/java/com/zglc/fm/entity/OutlineEntity.java

@@ -0,0 +1,62 @@
+package com.zglc.fm.entity;
+import javax.persistence.*;
+import java.io.Serializable;
+import java.util.Date;
+import lombok.Data;
+
+@Data
+@Table(name = "t_outline")
+public class OutlineEntity implements Serializable {
+    private static final long serialVersionUID = 1L;
+
+    /**
+     * id
+     */
+    @Id
+    @GeneratedValue(strategy = GenerationType.IDENTITY)
+    @Column(name = "id")
+    private Integer id;
+
+    /**
+     * outline_name
+     */
+    @Column(name = "outline_name")
+    private String outline_name;
+
+    /**
+     * aircraft_type
+     */
+    @Column(name = "aircraft_type")
+    private String aircraft_type;
+
+    /**
+     * major_type
+     */
+    @Column(name = "major_type")
+    private String major_type;
+
+    /**
+     * description
+     */
+    @Column(name = "description")
+    private String description;
+
+    /**
+     * file_path
+     */
+    @Column(name = "file_path")
+    private String file_path;
+
+    /**
+     * input_time
+     */
+    @Column(name = "input_time")
+    private Date input_time;
+
+    /**
+     * remarks
+     */
+    @Column(name = "remarks")
+    private String remarks;
+}
+

+ 14 - 0
src/main/java/com/zglc/fm/entity/RecordVO.java

@@ -0,0 +1,14 @@
+package com.zglc.fm.entity;
+
+import lombok.Data;
+
+import java.util.List;
+
+@Data
+public class RecordVO {
+
+//    private FaultRecordEntity faultRecordEntity;
+
+    List<StrValue> datas;
+
+}

+ 52 - 0
src/main/java/com/zglc/fm/entity/RightsEntity.java

@@ -0,0 +1,52 @@
+package com.zglc.fm.entity;
+import javax.persistence.*;
+import java.io.Serializable;
+
+import lombok.Data;
+
+/**
+ * 权限
+ * 
+ * @author wcf
+ * @email mnhwa@163.com
+ * @date 2020-02-14 23:23:33
+ * @description Refactoring 1st
+ *
+ */
+@Data
+@Table(name = "t_rights")
+public class RightsEntity implements Serializable {
+	private static final long serialVersionUID = 1L;
+
+	/**
+	* 
+	*/
+	@Id
+	@GeneratedValue(strategy = GenerationType.IDENTITY)
+	@Column(name = "id")
+	private Integer id;
+	
+	/**
+	* 请求路径
+	*/
+	@Column(name = "rights_path")
+	private String rightsPath;
+	
+	/**
+	* 权限名
+	*/
+	@Column(name = "rights_name")
+	private String rightsName;
+	
+	/**
+	* 
+	*/
+	@Column(name = "remark")
+	private String remark;
+
+	@Transient
+	private Integer isHave = 0;
+
+	@Column(name = "is_hide")
+	private Integer isHide;
+}

+ 49 - 0
src/main/java/com/zglc/fm/entity/RoleEntity.java

@@ -0,0 +1,49 @@
+package com.zglc.fm.entity;
+import javax.persistence.*;
+import java.io.Serializable;
+
+import lombok.Data;
+
+/**
+ * 角色
+ * 
+ * @author wcf
+ * @email mnhwa@163.com
+ * @date 2020-02-14 23:23:33
+ * @description Refactoring 1st
+ *
+ */
+@Data
+@Table(name = "t_role")
+public class RoleEntity implements Serializable {
+	private static final long serialVersionUID = 1L;
+
+	/**
+	* 
+	*/
+	@Id
+	@GeneratedValue(strategy = GenerationType.IDENTITY)
+	@Column(name = "id")
+	private Integer id;
+	
+	/**
+	* 角色名
+	*/
+	@Column(name = "role_name")
+	private String roleName;
+	
+	/**
+	* 权限
+	*/
+	@Column(name = "rights")
+	private String rights;
+	
+	/**
+	* 
+	*/
+	@Column(name = "remark")
+	private String remark;
+
+
+	
+}

+ 24 - 0
src/main/java/com/zglc/fm/entity/StrValue.java

@@ -0,0 +1,24 @@
+package com.zglc.fm.entity;
+
+import lombok.Data;
+
+import javax.persistence.*;
+
+@Data
+@Table(name = "t_str_value")
+public class StrValue {
+
+    /**
+     *
+     */
+    @Id
+    @GeneratedValue(strategy = GenerationType.IDENTITY)
+    @Column(name = "id")
+    private Integer id;
+
+    /**
+     * 
+     */
+    @Column(name = "v")
+    private String strv;
+}

+ 102 - 0
src/main/java/com/zglc/fm/entity/UserEntity.java

@@ -0,0 +1,102 @@
+package com.zglc.fm.entity;
+import javax.persistence.*;
+import java.io.Serializable;
+
+import lombok.Data;
+
+/**
+ * 用户
+ * 
+ * @author wcf
+ * @email mnhwa@163.com
+ * @date 2020-02-14 23:23:33
+ * @description Refactoring 1st
+ *
+ */
+@Data
+@Table(name = "t_user")
+public class UserEntity implements Serializable {
+	private static final long serialVersionUID = 1L;
+
+	/**
+	* 
+	*/
+	@Id
+	@GeneratedValue(strategy = GenerationType.IDENTITY)
+	@Column(name = "id")
+	private Integer id;
+	
+	/**
+	* 用户名
+	*/
+	@Column(name = "user_name")
+	private String userName;
+	
+	/**
+	* 真实姓名
+	*/
+	@Column(name = "real_name")
+	private String realName;
+	
+	/**
+	* 密码
+	*/
+	@Column(name = "password")
+	private String password;
+	
+	/**
+	* 部门ID
+	*/
+	@Column(name = "department_id")
+	private Integer departmentId;
+	
+	/**
+	* 部门名
+	*/
+	@Column(name = "department_name")
+	private String departmentName;
+	
+	/**
+	* 角色ID
+	*/
+	@Column(name = "role_id")
+	private Integer roleId;
+	
+	/**
+	* 角色名
+	*/
+	@Column(name = "role_name")
+	private String roleName;
+	
+	/**
+	* 0女1男
+	*/
+	@Column(name = "sex")
+	private Integer sex;
+	
+	/**
+	* 出生日期
+	*/
+	@Column(name = "birth")
+	private String birth;
+	
+	/**
+	* 图像
+	*/
+	@Column(name = "img")
+	private String img;
+	
+	/**
+	* 启用状态0正常
+	*/
+	@Column(name = "is_enable")
+	private Integer isEnable;
+	
+	/**
+	* 
+	*/
+	@Column(name = "remark")
+	private String remark;
+	
+	
+}

+ 13 - 0
src/main/java/com/zglc/fm/exceptions/BusinessException.java

@@ -0,0 +1,13 @@
+package com.zglc.fm.exceptions;
+
+public class BusinessException extends RuntimeException{
+
+    public BusinessException(String errorMsg){
+        super(errorMsg);
+    }
+
+    public BusinessException(String errorMsg, Throwable e){
+        super(errorMsg, e);
+    }
+
+}

+ 119 - 0
src/main/java/com/zglc/fm/intercepter/AuthInterceptor.java

@@ -0,0 +1,119 @@
+package com.zglc.fm.intercepter;
+
+import com.auth0.jwt.JWT;
+import com.auth0.jwt.exceptions.JWTDecodeException;
+import com.fasterxml.jackson.databind.ObjectMapper;
+import com.zglc.fm.anno.PassToken;
+import com.zglc.fm.base.Result;
+import com.zglc.fm.constant.ErrorCode;
+import com.zglc.fm.entity.UserEntity;
+import com.zglc.fm.service.RightsService;
+import com.zglc.fm.service.UserService;
+import org.apache.juli.logging.Log;
+import org.apache.juli.logging.LogFactory;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Component;
+import org.springframework.web.method.HandlerMethod;
+import org.springframework.web.servlet.HandlerInterceptor;
+import org.springframework.web.servlet.ModelAndView;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import java.io.IOException;
+import java.lang.reflect.Method;
+
+/**
+ * 身份验证拦截器
+ */
+@Component
+public class AuthInterceptor implements HandlerInterceptor {
+    private final static Log log = LogFactory.getLog(AuthInterceptor.class);
+
+    private final ObjectMapper objectMapper;
+
+    private final UserService userService;
+
+    private final RightsService rightsService;
+
+    @Autowired
+    public AuthInterceptor(ObjectMapper objectMapper, UserService userService,RightsService rightsService) {
+        this.objectMapper = objectMapper;
+        this.userService = userService;
+        this.rightsService = rightsService;
+    }
+
+    private void returnResult(HttpServletResponse response, Result<ErrorCode> result) throws IOException {
+        response.setHeader("Content-Type", "application/json; charset=utf-8");
+        response.getWriter().print(objectMapper.writeValueAsString(result));
+    }
+
+    @Override
+    public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object object)
+            throws Exception {
+        String token = request.getHeader("token");// 从 http 请求头中取出 token
+        if (token != null)
+        {
+            if (token.compareTo("undefined") == 0) token = null;
+            if (token.compareTo("") == 0) token = null;
+        }
+        if (request.getRequestURI().contains("swagger"))
+            return true;
+        // 如果不是映射到方法直接通过
+        if(!(object instanceof HandlerMethod)){
+            return true;
+        }
+        HandlerMethod handlerMethod=(HandlerMethod)object;
+        Method method=handlerMethod.getMethod();
+        if (method.getName().compareTo("error") == 0)
+            return true;
+        //检查是否有passtoken注释,有则跳过认证
+        if (method.isAnnotationPresent(PassToken.class)) {
+            return true;
+        }else
+        {
+            if (token == null || token.length() < 4) {
+                response.setStatus(200);
+                returnResult(response,  Result.fail(ErrorCode.RET_NO_LOGIN));
+                return false;
+            }
+            // 获取 token 中的 user id
+            Integer userId;
+            UserEntity userEntity = null;
+            try {
+                userId = Integer.parseInt(JWT.decode(token).getAudience().get(0));
+                userEntity = userService.getUser(userId);
+            } catch (JWTDecodeException j) {
+                response.setStatus(200);
+                returnResult(response,  Result.fail(ErrorCode.RET_ACCOUNT_ERROR_TOKEN));
+                return false;
+            }
+
+            if (userEntity != null) {
+                    // 检查用户权限, 获取用户所有的功能
+                    if(userEntity.getId() == 1) return true;
+                    if (rightsService.haveRights(request.getRequestURI(),userEntity.getRoleId())) {
+                        return true;
+                    } else {
+                        response.setStatus(401);
+                        returnResult(response, new Result(ErrorCode.RET_PERMISSION_DENIED));
+                        return false;
+                    }
+
+            } else {
+                //log.warn( "not permit"+requestUrl +"  user:"+ cookie.getValue());
+                returnResult(response, new Result(ErrorCode.RET_ACCOUNT_ERROR_NO_USER));
+                return false;
+            }
+        }
+    }
+
+    @Override
+    public void postHandle(HttpServletRequest request, HttpServletResponse response, Object handler,
+                           ModelAndView modelAndView) {
+    }
+
+    @Override
+    public void afterCompletion(HttpServletRequest request, HttpServletResponse response, Object handler,
+                                Exception ex) {
+    }
+}

+ 205 - 0
src/main/java/com/zglc/fm/schedule/ScheduleTasks.java

@@ -0,0 +1,205 @@
+//package com.zglc.fm.schedule;
+//
+//
+//import com.zglc.fm.dao.AircraftTypeDao;
+//import com.zglc.fm.dao.DeviceDao;
+//import com.zglc.fm.dao.RepairManualDao;
+//import com.zglc.fm.entity.AircraftEntity;
+//import com.zglc.fm.entity.DeviceEntity;
+//import com.zglc.fm.entity.EquipmentEntity;
+//import com.zglc.fm.entity.RepairManualEntity;
+//import com.zglc.fm.exceptions.BusinessException;
+//import com.zglc.fm.utils.DocToPdf;
+//import com.zglc.fm.utils.ExcelUtils;
+//import com.zglc.fm.utils.FileTool;
+//import com.zglc.fm.utils.FileTypeUtil;
+//import org.apache.poi.ss.usermodel.Row;
+//import org.apache.poi.ss.usermodel.Sheet;
+//import org.apache.poi.ss.usermodel.Workbook;
+//import org.springframework.beans.factory.annotation.Autowired;
+//import org.springframework.beans.factory.annotation.Value;
+//import org.springframework.context.annotation.Configuration;
+//import org.springframework.mock.web.MockMultipartFile;
+//import org.springframework.scheduling.annotation.EnableScheduling;
+//import org.springframework.scheduling.annotation.Scheduled;
+//import org.springframework.web.multipart.MultipartFile;
+//
+//import java.io.File;
+//import java.io.FileInputStream;
+//import java.io.IOException;
+//import java.text.SimpleDateFormat;
+//import java.util.*;
+//
+//@Configuration
+//@EnableScheduling
+//public class ScheduleTasks {
+//
+//    private static final String sheetName = "sheet1";
+//
+//    @Autowired
+//    private AircraftDao aircraftDao;
+//    @Autowired
+//    private DeviceDao deviceDao;
+//    @Autowired
+//    private RepairManualDao repairManualDao;
+//
+//    @Value("${spring.fault.sourcePath}")
+//    private String sourcePath; //targetPath
+//
+//    @Value("${spring.fault.uploadPath}")
+//    private String uploadPath;
+//
+//    @Scheduled(cron = "0/10 * * * * ?")
+//    public void faultImport() {
+//        readDirTargetContext();
+//        deleteDir(new File(uploadPath));
+//    }
+//
+//
+//    private void readDirTargetContext() {
+//        File file = new File(uploadPath);
+//        if (file == null) {
+//            return;
+//        }
+//        File[] files = file.listFiles();
+//        if (files == null || files.length == 0) {
+//            return;
+//        }
+//        for (File f : files) {
+//            AircraftEntity aircraft = new AircraftEntity();
+//            aircraft.setAircraft_type(f.getName());
+//            SimpleDateFormat date = new SimpleDateFormat("yyyy-MM-dd HH-mm-ss");
+//            aircraft.setInput_time(date.format(new Date()));
+//            aircraftDao.addNotExist(aircraft);
+//            getAllDirName(f, f.getName());
+//        }
+//    }
+//
+//    private void getAllDirName(File file, String type) {
+//        String sourcePath1;
+//        sourcePath1 = "d:\\source";
+//        File[] files = file.listFiles();
+//        boolean falg = false;
+//        for (File f : files) {
+//            DeviceEntity device = new DeviceEntity();
+//            if (f.isDirectory()) {
+//                falg = true;
+//                device.setDevice_type(f.getName());
+//                if (type != null) {
+//                    device.setAircraft_type(file.getName());
+//                } else {
+//                    device.setParent(file.getName());
+//                }
+//                deviceDao.insertNotExists(device);
+//                getAllDirName(f, null);
+//            }
+//        }
+//        if (!falg) {
+//            Map<String, String> fileparams = new HashMap<>();
+//            for (File f : files) {
+//                if (f.getName().endsWith(ExcelUtils.DOC) || f.getName().endsWith(ExcelUtils.DOCX)) {
+//                    MultipartFile mfile = transtTo(f);
+//                    String filePath = FileTool.fileUp(mfile, sourcePath1, new Date().getTime() + f.getName());
+//                    //转为pdf
+//                    DocToPdf.convertDoc2Pdf(filePath, sourcePath1);
+//                    if (f.getName().endsWith(ExcelUtils.DOC))  {
+//                        filePath = filePath.replaceAll( "doc","pdf");
+//                        filePath = filePath.replaceAll( "d:","");
+//                    }
+//                    if (f.getName().endsWith(ExcelUtils.DOCX))  {
+//                        filePath = filePath.replaceAll( "docx","pdf");
+//                        filePath = filePath.replaceAll( "d:","");
+//                    }
+//
+//                    String name = null;
+//                    if (f.getName().endsWith(ExcelUtils.DOC)) {
+//                        name = f.getName().replace(ExcelUtils.DOC, "");
+//                    } else {
+//                        name = f.getName().replace(ExcelUtils.DOCX, "");
+//                    }
+//                    System.out.println(f.getName());
+//                    fileparams.put(name, filePath);
+//                }
+//            }
+//            for (File f : files) {
+//                if (f.getName().endsWith(ExcelUtils.XLS) || f.getName().endsWith(ExcelUtils.XLSX)) {
+//                    int id = deviceDao.getIdByType(file.getName());
+//                    String name = null;
+//                    if (f.getName().endsWith(ExcelUtils.XLS)) {
+//                        name = f.getName().replace(ExcelUtils.XLS, "");
+//                    } else {
+//                        name = f.getName().replace(ExcelUtils.XLSX, "");
+//                    }
+//
+//                    List<RepairManualEntity> list = getAllByFile(f, id, file.getName(), fileparams.get(name), name);
+//                    if (list != null && list.size() > 0) {
+//                        repairManualDao.addBatch(list);
+//                    }
+//                }
+//            }
+//        }
+//    }
+//
+//    private List<RepairManualEntity> getAllByFile(File file, int id, String deviceType, String filePath, String name) {
+//        Workbook wb = ExcelUtils.readExcel(file);
+//        Sheet sheet = ExcelUtils.getSheet(wb, sheetName);
+//        if (sheet == null || sheet.getLastRowNum() < 1) {
+//            return null;
+//        }
+//        List<RepairManualEntity> list = new ArrayList<>();
+////        int rowNums = sheet.getLastRowNum();
+////        for (int i = 1; i<=1; i++) {
+////            RepairManualEntity repairManual = new RepairManualEntity();
+////            repairManual.setType(ExcelUtils.getCeilValue(sheet, i, 0));
+////            repairManual.setFault_describe(ExcelUtils.getCeilValue(sheet, i, 1));
+////            repairManual.setRepair_plan(ExcelUtils.getCeilValue(sheet, i, 2));
+////            repairManual.setDevice_id(id);
+////            repairManual.setDevice_type(deviceType);
+////            repairManual.setFile_path(filePath);
+////            list.add(repairManual);
+//        RepairManualEntity repairManual = new RepairManualEntity();
+//        repairManual.setDevice_id(id);
+//        repairManual.setDevice_type(deviceType);
+//        repairManual.setFile_path(filePath);
+//        repairManual.setAircraft(ExcelUtils.getCeilValue(sheet, 0, 1));
+//        repairManual.setManual_system(ExcelUtils.getCeilValue(sheet, 1, 1));
+//        repairManual.setManual_number(Integer.parseInt(ExcelUtils.getCeilValue(sheet, 3, 1)));
+//        repairManual.setType(name);
+//        repairManual.setFault_describe(ExcelUtils.getCeilValue(sheet, 4, 1));
+//        repairManual.setRepair_plan(ExcelUtils.getCeilValue(sheet, 5, 2));
+//        list.add(repairManual);
+//
+////        }
+//        try {
+//            wb.close();
+//        } catch (IOException e) {
+//            throw new BusinessException("关闭文件错误!", e);
+//        }
+//        return list;
+//    }
+//
+//    private void deleteDir(File file) {
+//        File[] files = file.listFiles();
+//        if (files == null) {
+//            return;
+//        }
+//        for (File f : files) {
+//            if (f.isDirectory()) {
+//                deleteDir(f);
+//                f.delete();
+//            }
+//            f.delete();
+//        }
+//    }
+//
+//    private MultipartFile transtTo(File file) {
+//        MultipartFile mfile = null;
+//        try {
+//            FileInputStream fileInputStream = new FileInputStream(file);
+//            mfile = new MockMultipartFile(file.getName(), file.getName(), "text/plain", fileInputStream);
+//        } catch (IOException e) {
+//            throw new BusinessException("文件转换错误!", e);
+//        }
+//        return mfile;
+//    }
+//}

+ 91 - 0
src/main/java/com/zglc/fm/service/AircraftTypeService.java

@@ -0,0 +1,91 @@
+package com.zglc.fm.service;
+
+import com.zglc.fm.base.Result;
+import com.zglc.fm.dao.AircraftTypeDao;
+import com.zglc.fm.entity.AircraftTypeEntity;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import tk.mybatis.mapper.entity.Example;
+
+import java.util.Iterator;
+import java.util.List;
+
+@Service
+public class AircraftTypeService {
+
+    @Autowired
+    private AircraftTypeDao aircraftTypeDao;
+
+    public List<AircraftTypeEntity> listAll(){
+        return aircraftTypeDao.listAll();
+    }
+
+    public List<AircraftTypeEntity> getAllRecord() {
+        Example example = new Example(AircraftTypeEntity.class);
+        return aircraftTypeDao.selectByExample(example);
+    }
+
+    public Result<String> add(AircraftTypeEntity data) {
+        data.setId(null);
+        boolean flag = true;
+        String msg = "";
+        int index = aircraftTypeDao.insertSelective(data);
+        if (index == 0) {
+            flag = false;
+            msg = "添加信息失败!";
+        } else {
+            msg = "添加信息成功!";
+        }
+
+        return Result.result(flag, msg, msg);
+    }
+
+    public Result<String> delete(List<Integer> ids) {
+        boolean flag = true;
+        String msg = "";
+        Iterator iter = ids.iterator();
+        while(iter.hasNext()) {
+            Integer id = (Integer)iter.next();
+            int index = aircraftTypeDao.deleteByPrimaryKey(id);
+            if (index == 0) {
+                flag = false;
+                msg += "信息删除失败!" + id + ";";
+            } else {
+                msg += "信息删除成功!" + id + ";";
+            }
+        }
+        return Result.result(flag, msg, msg);
+    }
+
+    public Result<String> edit(AircraftTypeEntity data) {
+        boolean flag = true;
+        String msg = "";
+        AircraftTypeEntity tmpData = aircraftTypeDao.selectByPrimaryKey(data.getId());
+        if (tmpData != null) {
+            int index = aircraftTypeDao.updateByPrimaryKeySelective(data);
+            if (index == 0) {
+                flag = false;
+                msg = "信息修改失败";
+            } else {
+                msg = "信息修改成功";
+            }
+        } else {
+            flag = false;
+            msg = "信息不存在!";
+        }
+        return Result.result(flag, msg, msg);
+    }
+
+    public Result<List<AircraftTypeEntity>> findByName(String name){
+        if (name==null || "".equals(name)){
+            return Result.result(false, "名称不能为空", null);
+        }
+        List<AircraftTypeEntity> list = aircraftTypeDao.findByName("%" + name + "%");
+        return Result.success(list);
+    }
+
+    public AircraftTypeEntity getAircraftType(Integer id) {
+        return aircraftTypeDao.selectByPrimaryKey(id);
+    }
+
+}

+ 102 - 0
src/main/java/com/zglc/fm/service/BookService.java

@@ -0,0 +1,102 @@
+package com.zglc.fm.service;
+
+import com.zglc.fm.base.Result;
+import com.zglc.fm.dao.BookDao;
+import com.zglc.fm.entity.BookEntity;
+import org.springframework.stereotype.Service;
+import tk.mybatis.mapper.entity.Example;
+
+import java.util.Iterator;
+import java.util.List;
+
+@Service
+
+public class BookService {
+
+    private BookDao bookDao;
+
+    public BookService(BookDao bookDao) {
+        this.bookDao = bookDao;
+    }
+
+    public List<BookEntity> listAll() {
+        return bookDao.listAll();
+    }
+
+    public Integer getCount() {
+        return bookDao.getCount();
+    }
+
+    public Result<String> add(BookEntity data) {
+        data.setId(null);
+        boolean flag = true;
+        String msg = "";
+        int index = bookDao.insertSelective(data);
+        if (index == 0) {
+            flag = false;
+            msg = "添加教材信息失败!";
+        } else {
+            msg = "添加教材信息成功!";
+        }
+
+        return Result.result(flag, msg, msg);
+    }
+
+    public Result<String> delete(List<Integer> ids) {
+        boolean flag = true;
+        String msg = "";
+        Iterator iter = ids.iterator();
+        while(iter.hasNext()) {
+            Integer id = (Integer)iter.next();
+            int index = bookDao.deleteByPrimaryKey(id);
+            if (index == 0) {
+                flag = false;
+                msg += "教材删除失败!" + id + ";";
+            } else {
+                msg += "教材删除成功!" + id + ";";
+            }
+        }
+        return Result.result(flag, msg, msg);
+    }
+
+    public Result<String> edit(BookEntity data) {
+        boolean flag = true;
+        String msg = "";
+        BookEntity tmpData = bookDao.selectByPrimaryKey(data.getId());
+        if (tmpData != null) {
+            int index = bookDao.updateByPrimaryKeySelective(data);
+            if (index == 0) {
+                flag = false;
+                msg = "教材信息修改失败";
+            } else {
+                msg = "教材信息修改成功";
+            }
+        } else {
+            flag = false;
+            msg = "教材信息不存在!";
+        }
+        return Result.result(flag, msg, msg);
+    }
+
+    public Result<List<BookEntity>> findByName(String name){
+        if (name == null ||"".equals(name)){
+            return Result.result(false, "名称不能为空" ,null);
+        }
+        List<BookEntity> list = bookDao.findByName("%" + name + "%");
+        return Result.success(list);
+    }
+
+    public BookEntity getOutline(Integer id) {
+        return bookDao.selectByPrimaryKey(id);
+    }
+
+    public List<BookEntity> getAllBook() {
+        String msg = "";
+        Example example = new Example(BookEntity.class);
+//        example.createCriteria().andNotEqualTo("id", 1);//使用的原因为不显示admin用户
+        example.createCriteria();
+        return bookDao.selectByExample(example);
+    }
+
+
+}

+ 102 - 0
src/main/java/com/zglc/fm/service/CardService.java

@@ -0,0 +1,102 @@
+package com.zglc.fm.service;
+
+import com.zglc.fm.base.Result;
+import com.zglc.fm.dao.CardDao;
+import com.zglc.fm.entity.BookEntity;
+import com.zglc.fm.entity.CardEntity;
+import org.springframework.stereotype.Service;
+import tk.mybatis.mapper.entity.Example;
+
+import java.util.Iterator;
+import java.util.List;
+
+@Service
+
+public class CardService {
+
+    private CardDao cardDao;
+
+    public CardService(CardDao cardDao) {
+        this.cardDao = cardDao;
+    }
+
+    public List<CardEntity> listAll() {
+        return cardDao.listAll();
+    }
+
+    public Integer getCount() {
+        return cardDao.getCount();
+    }
+
+    public Result<String> add(CardEntity data) {
+        data.setId(null);
+        boolean flag = true;
+        String msg = "";
+        int index = cardDao.insertSelective(data);
+        if (index == 0) {
+            flag = false;
+            msg = "添加手册信息失败!";
+        } else {
+            msg = "添加手册信息成功!";
+        }
+
+        return Result.result(flag, msg, msg);
+    }
+
+    public Result<String> delete(List<Integer> ids) {
+        boolean flag = true;
+        String msg = "";
+        Iterator iter = ids.iterator();
+        while(iter.hasNext()) {
+            Integer id = (Integer)iter.next();
+            int index = cardDao.deleteByPrimaryKey(id);
+            if (index == 0) {
+                flag = false;
+                msg += "手册删除失败!" + id + ";";
+            } else {
+                msg += "手册删除成功!" + id + ";";
+            }
+        }
+        return Result.result(flag, msg, msg);
+    }
+
+    public Result<String> edit(CardEntity data) {
+        boolean flag = true;
+        String msg = "";
+        CardEntity tmpData = cardDao.selectByPrimaryKey(data.getId());
+        if (tmpData != null) {
+            int index = cardDao.updateByPrimaryKeySelective(data);
+            if (index == 0) {
+                flag = false;
+                msg = "故障信息修改失败";
+            } else {
+                msg = "故障信息修改成功";
+            }
+        } else {
+            flag = false;
+            msg = "手册信息不存在!";
+        }
+        return Result.result(flag, msg, msg);
+    }
+
+    public Result<List<CardEntity>> findByName(String name){
+        if (name == null ||"".equals(name)){
+            return Result.result(false, "名称不能为空" ,null);
+        }
+        List<CardEntity> list = cardDao.findByName("%" + name + "%");
+        return Result.success(list);
+    }
+
+    public CardEntity getOutline(Integer id) {
+        return cardDao.selectByPrimaryKey(id);
+    }
+
+    public List<CardEntity> getAllCard() {
+        String msg = "";
+        Example example = new Example(CardEntity.class);
+        example.createCriteria();
+        return cardDao.selectByExample(example);
+    }
+
+
+}

+ 37 - 0
src/main/java/com/zglc/fm/service/CommonService.java

@@ -0,0 +1,37 @@
+package com.zglc.fm.service;
+
+import com.zglc.fm.base.Result;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import java.util.HashMap;
+import java.util.Map;
+
+@Service
+public class CommonService {
+
+//    @Autowired
+//    private RepairManualService repairManualService;
+//
+//    @Autowired
+//    private FaultRecordService faultRecordService;
+
+
+
+//    public Result<Map<String, Object>> find(String keyword,String type){
+//        Map<String, Object> map = new HashMap<>();
+//        if (type == null || "".equals(type) || "all".equals(type)){
+////            map.put("article", articleService.find1(new ArticleFind()));
+//            map.put("repairManual", repairManualService.getAllRecord());
+//            map.put("faultRecord", faultRecordService.getAllFaultRecord());
+//        }else if("faultRecord".equals(type)){
+//            map.put("faultRecord", faultRecordService.getAllFaultRecord());
+//        }else if("repairManual".equals(type)){
+//            map.put("repairManual", repairManualService.getAllRecord());
+//        }
+////        else if("article".equals(type)){
+//////            map.put("article", articleService.find1(new ArticleFind()));
+//////        }
+//            return Result.success(map);
+//    }
+}

+ 121 - 0
src/main/java/com/zglc/fm/service/DepartmentService.java

@@ -0,0 +1,121 @@
+package com.zglc.fm.service;
+
+import com.zglc.fm.entity.DepartmentEntity;
+import com.zglc.fm.dao.DepartmentDao;
+import com.zglc.fm.exceptions.BusinessException;
+import org.springframework.stereotype.Service;
+import com.zglc.fm.base.Result;
+import org.springframework.util.StringUtils;
+import tk.mybatis.mapper.entity.Example;
+import java.util.Iterator;
+import java.util.List;
+
+/**
+ * 部门
+ *
+ * @author wcf
+ * @email mnhwa@163.com
+ * @date 2020-02-14 01:26:36
+ * @description Refactoring 1st
+ *
+ */
+ @Service
+public class DepartmentService{
+
+	private DepartmentDao departmentDao;
+	
+    public DepartmentService(DepartmentDao departmentDao){this.departmentDao = departmentDao;}
+	
+	public  List<DepartmentEntity> getAllDepartment(){return departmentDao.selectAll();}
+
+    public  List<DepartmentEntity> listAll(){return departmentDao.listAll();}
+
+	public DepartmentEntity getDepartment(Integer id){return departmentDao.selectByPrimaryKey(id);}
+	
+	public Result<String> add(DepartmentEntity data){
+        data.setId(null);
+        boolean flag = true;
+        String msg = "";
+		int index = departmentDao.insertSelective(data);
+		if (index == 0) {
+			flag = false;
+			msg = "添加部门失败!";
+		} else {
+			msg = "添加部门成功!";
+		}
+		      
+        return Result.result(flag, msg, msg);
+    }
+	
+	public Result<String> addAndCheck(DepartmentEntity data){
+        boolean flag = true;
+        String msg = "";
+        DepartmentEntity tmpData = null;
+		Example example = new Example(DepartmentEntity.class);
+		example.createCriteria().andEqualTo("id", data.getId());
+		tmpData = departmentDao.selectOneByExample(example);
+		if (tmpData != null) {
+			flag = false;
+			msg = "部门已存在!";
+		} else {
+			int index = departmentDao.insertSelective(data);
+			if (index == 0) {
+				flag = false;
+				msg = "添加部门失败!";
+			} else {
+				msg = "添加部门成功!";
+			}
+		}
+	
+        return Result.result(flag, msg, msg);
+    }
+	
+	public Result<String> edit(DepartmentEntity data) {
+        boolean flag = true;
+        String msg = "";
+        DepartmentEntity tmpData = departmentDao.selectByPrimaryKey(data.getId());
+        if (tmpData != null) {
+            int index = departmentDao.updateByPrimaryKeySelective(data);
+            if (index == 0) {
+                flag = false;
+                msg = "部门修改失败!";
+            } else {
+                msg = "部门修改成功!";
+            }
+        } else {
+            flag = false;
+            msg = "部门不存在!";
+        }
+        return Result.result(flag, msg, msg);
+    }
+	
+	public Result<String> delete(List<Integer> ids) {
+        boolean flag = true;
+        String msg = "";
+        Iterator iter = ids.iterator();
+        while(iter.hasNext()) {
+            Integer id = (Integer)iter.next();
+            int index = departmentDao.deleteByPrimaryKey(id);
+            if (index == 0) {
+                flag = false;
+                msg += "部门删除失败!" + id + ";";
+            } else {
+                msg += "部门删除成功!" + id + ";";
+            }
+        }
+        return Result.result(flag, msg, msg);
+    }
+
+    public List<DepartmentEntity> listsubDepartment(Integer id){return departmentDao.listsub(id);}
+
+    public Result<List<DepartmentEntity>> findByName(String name){
+        String msg = "";
+        if (name == null || name.equals("")){
+           msg = "名称不能为空";
+           return Result.result(false, msg, null);
+        }
+        List<DepartmentEntity> list = departmentDao.findByName("%" + name + "%");
+        return Result.success(list);
+    }
+}
+

+ 100 - 0
src/main/java/com/zglc/fm/service/FaultService.java

@@ -0,0 +1,100 @@
+package com.zglc.fm.service;
+
+import com.zglc.fm.base.Result;
+import com.zglc.fm.dao.FaultDao;
+import com.zglc.fm.entity.FaultEntity;
+import org.springframework.stereotype.Service;
+import tk.mybatis.mapper.entity.Example;
+
+import java.util.Iterator;
+import java.util.List;
+
+@Service
+
+public class FaultService {
+
+    private FaultDao faultDao;
+
+    public FaultService(FaultDao faultDao) {
+        this.faultDao = faultDao;
+    }
+
+    public List<FaultEntity> listAll() {
+        return faultDao.listAll();
+    }
+
+    public Integer getCount() {
+        return faultDao.getCount();
+    }
+
+    public Result<String> add(FaultEntity data) {
+        data.setId(null);
+        boolean flag = true;
+        String msg = "";
+        int index = faultDao.insertSelective(data);
+        if (index == 0) {
+            flag = false;
+            msg = "添加故障信息失败!";
+        } else {
+            msg = "添加故障信息成功!";
+        }
+
+        return Result.result(flag, msg, msg);
+    }
+
+    public Result<String> delete(List<Integer> ids) {
+        boolean flag = true;
+        String msg = "";
+        Iterator iter = ids.iterator();
+        while(iter.hasNext()) {
+            Integer id = (Integer)iter.next();
+            int index = faultDao.deleteByPrimaryKey(id);
+            if (index == 0) {
+                flag = false;
+                msg += "故障删除失败!" + id + ";";
+            } else {
+                msg += "故障删除成功!" + id + ";";
+            }
+        }
+        return Result.result(flag, msg, msg);
+    }
+
+    public Result<String> edit(FaultEntity data) {
+        boolean flag = true;
+        String msg = "";
+        FaultEntity tmpData = faultDao.selectByPrimaryKey(data.getId());
+        if (tmpData != null) {
+            int index = faultDao.updateByPrimaryKeySelective(data);
+            if (index == 0) {
+                flag = false;
+                msg = "故障信息修改失败";
+            } else {
+                msg = "故障信息修改成功";
+            }
+        } else {
+            flag = false;
+            msg = "故障信息不存在!";
+        }
+        return Result.result(flag, msg, msg);
+    }
+
+    public Result<List<FaultEntity>> findByName(String name){
+        if (name == null ||"".equals(name)){
+            return Result.result(false, "名称不能为空" ,null);
+        }
+        List<FaultEntity> list = faultDao.findByName("%" + name + "%");
+        return Result.success(list);
+    }
+
+    public FaultEntity getOutline(Integer id) {
+        return faultDao.selectByPrimaryKey(id);
+    }
+
+    public List<FaultEntity> getAllFault() {
+        String msg = "";
+        Example example = new Example(FaultEntity.class);
+        example.createCriteria();
+        return faultDao.selectByExample(example);
+    }
+
+}

+ 70 - 0
src/main/java/com/zglc/fm/service/FloatValueService.java

@@ -0,0 +1,70 @@
+package com.zglc.fm.service;
+
+import com.zglc.fm.base.Result;
+import com.zglc.fm.dao.FloatValueDao;
+import com.zglc.fm.entity.FloatValue;
+import org.springframework.stereotype.Service;
+import tk.mybatis.mapper.entity.Example;
+
+import java.util.Iterator;
+import java.util.List;
+
+/**
+ *
+ *
+ * @author wcf
+ * @email mnhwa@163.com
+ * @date 2020-02-14 01:26:35
+ * @description Refactoring 1st
+ *
+ */
+ @Service
+public class FloatValueService {
+     private FloatValueDao floatValueDao;
+    public FloatValueService(FloatValueDao floatValueDao){
+        this.floatValueDao = floatValueDao;
+    }
+
+	public FloatValue get(Integer id){return  floatValueDao.selectByPrimaryKey(id);}
+
+	public List<FloatValue> getValues(List<Integer> ids){
+        Example example = new Example(FloatValue.class);
+        example.createCriteria().andIn("id",ids);
+        return floatValueDao.selectByExample(example);
+    }
+
+	public Result<String> add(FloatValue data){
+        data.setId(null);
+        boolean flag = true;
+        String msg = "";
+		int index = floatValueDao.insertSelective(data);
+		if (index == 0) {
+			flag = false;
+			msg = "保存数据失败!";
+		} else {
+			msg = "保存数据成功!";
+		}
+		      
+        return Result.result(flag, msg, msg);
+    }
+
+	public Result<String> delete(List<Integer> ids) {
+        boolean flag = true;
+        String msg = "";
+        Iterator iter = ids.iterator();
+        while(iter.hasNext()) {
+            Integer id = (Integer)iter.next();
+            int index = floatValueDao.deleteByPrimaryKey(id);
+            if (index == 0) {
+                flag = false;
+                msg += "权限数据失败!" + id + ";";
+            } else {
+                msg += "权限数据成功!" + id + ";";
+            }
+        }
+        return Result.result(flag, msg, msg);
+    }
+
+
+}
+

+ 70 - 0
src/main/java/com/zglc/fm/service/IntValueService.java

@@ -0,0 +1,70 @@
+package com.zglc.fm.service;
+
+import com.zglc.fm.base.Result;
+import com.zglc.fm.dao.IntValueDao;
+import com.zglc.fm.entity.IntValue;
+import org.springframework.stereotype.Service;
+import tk.mybatis.mapper.entity.Example;
+
+import java.util.Iterator;
+import java.util.List;
+
+/**
+ *
+ *
+ * @author wcf
+ * @email mnhwa@163.com
+ * @date 2020-02-14 01:26:35
+ * @description Refactoring 1st
+ *
+ */
+ @Service
+public class IntValueService {
+     private IntValueDao intValueDao;
+    public IntValueService(IntValueDao intValueDao){
+        this.intValueDao = intValueDao;
+    }
+
+	public IntValue get(Integer id){return  intValueDao.selectByPrimaryKey(id);}
+
+	public List<IntValue> getValues(List<Integer> ids){
+        Example example = new Example(IntValue.class);
+        example.createCriteria().andIn("id",ids);
+        return intValueDao.selectByExample(example);
+    }
+
+	public Result<String> add(IntValue data){
+        data.setId(null);
+        boolean flag = true;
+        String msg = "";
+		int index = intValueDao.insertSelective(data);
+		if (index == 0) {
+			flag = false;
+			msg = "保存数据失败!";
+		} else {
+			msg = "保存数据成功!";
+		}
+		      
+        return Result.result(flag, msg, msg);
+    }
+
+	public Result<String> delete(List<Integer> ids) {
+        boolean flag = true;
+        String msg = "";
+        Iterator iter = ids.iterator();
+        while(iter.hasNext()) {
+            Integer id = (Integer)iter.next();
+            int index = intValueDao.deleteByPrimaryKey(id);
+            if (index == 0) {
+                flag = false;
+                msg += "权限数据失败!" + id + ";";
+            } else {
+                msg += "权限数据成功!" + id + ";";
+            }
+        }
+        return Result.result(flag, msg, msg);
+    }
+
+
+}
+

+ 110 - 0
src/main/java/com/zglc/fm/service/LogService.java

@@ -0,0 +1,110 @@
+package com.zglc.fm.service;
+
+import com.zglc.fm.entity.LogEntity;
+import com.zglc.fm.dao.LogDao;
+import org.springframework.stereotype.Service;
+import com.zglc.fm.base.Result;
+import tk.mybatis.mapper.entity.Example;
+import java.util.Iterator;
+import java.util.List;
+
+/**
+ * 日志
+ *
+ * @author wcf
+ * @email mnhwa@163.com
+ * @date 2020-02-14 01:26:35
+ * @description Refactoring 1st
+ *
+ */
+ @Service
+public class LogService{
+
+	private LogDao logDao;
+	
+    public LogService(LogDao logDao){this.logDao = logDao;}
+	
+	public  List<LogEntity> getAllLog(){return logDao.selectAll();}
+	
+	public LogEntity getLog(Integer id){return logDao.selectByPrimaryKey(id);}
+	
+	public Result<String> add(LogEntity data){
+        data.setId(null);
+        boolean flag = true;
+        String msg = "";
+		int index = logDao.insertSelective(data);
+		if (index == 0) {
+			flag = false;
+			msg = "添加日志失败!";
+		} else {
+			msg = "添加日志成功!";
+		}
+		      
+        return Result.result(flag, msg, msg);
+    }
+	
+	public Result<String> addAndCheck(LogEntity data){
+        boolean flag = true;
+        String msg = "";
+        LogEntity tmpData = null;
+		Example example = new Example(LogEntity.class);
+		example.createCriteria().andEqualTo("id", data.getId());
+		tmpData = logDao.selectOneByExample(example);
+		if (tmpData != null) {
+			flag = false;
+			msg = "日志已存在!";
+		} else {
+			int index = logDao.insertSelective(data);
+			if (index == 0) {
+				flag = false;
+				msg = "添加日志失败!";
+			} else {
+				msg = "添加日志成功!";
+			}
+		}
+	
+        return Result.result(flag, msg, msg);
+    }
+	
+	public Result<String> edit(LogEntity data) {
+        boolean flag = true;
+        String msg = "";
+        LogEntity tmpData = logDao.selectByPrimaryKey(data.getId());
+        if (tmpData != null) {
+            int index = logDao.updateByPrimaryKeySelective(data);
+            if (index == 0) {
+                flag = false;
+                msg = "日志修改失败!";
+            } else {
+                msg = "日志修改成功!";
+            }
+        } else {
+            flag = false;
+            msg = "日志不存在!";
+        }
+        return Result.result(flag, msg, msg);
+    }
+	
+	public Result<String> delete(List<Integer> ids) {
+        boolean flag = true;
+        String msg = "";
+        Iterator iter = ids.iterator();
+        while(iter.hasNext()) {
+            Integer id = (Integer)iter.next();
+            int index = logDao.deleteByPrimaryKey(id);
+            if (index == 0) {
+                flag = false;
+                msg += "日志删除失败!" + id + ";";
+            } else {
+                msg += "日志删除成功!" + id + ";";
+            }
+        }
+        return Result.result(flag, msg, msg);
+    }
+
+    public Result<List<LogEntity>> findByLog(LogEntity log){
+        List<LogEntity> list = logDao.findByLog(log);
+        return Result.success(list);
+    }
+}
+

+ 101 - 0
src/main/java/com/zglc/fm/service/MajorService.java

@@ -0,0 +1,101 @@
+package com.zglc.fm.service;
+
+import com.zglc.fm.base.Result;
+import com.zglc.fm.entity.MajorEntity;
+import com.zglc.fm.dao.MajorDao;
+import com.zglc.fm.entity.ManuelEntity;
+import org.springframework.stereotype.Service;
+import tk.mybatis.mapper.entity.Example;
+
+import java.util.Iterator;
+import java.util.List;
+
+@Service
+
+public class MajorService {
+
+    private MajorDao majorDao;
+
+    public MajorService(MajorDao majorDao) {
+        this.majorDao = majorDao;
+    }
+
+    public List<MajorEntity> listAll() {
+        return majorDao.listAll();
+    }
+
+    public Integer getCount() {
+        return majorDao.getCount();
+    }
+
+    public Result<String> add(MajorEntity data) {
+        data.setId(null);
+        boolean flag = true;
+        String msg = "";
+        int index = majorDao.insertSelective(data);
+        if (index == 0) {
+            flag = false;
+            msg = "添加专业信息失败!";
+        } else {
+            msg = "添加专业信息成功!";
+        }
+
+        return Result.result(flag, msg, msg);
+    }
+
+    public Result<String> delete(List<Integer> ids) {
+        boolean flag = true;
+        String msg = "";
+        Iterator iter = ids.iterator();
+        while(iter.hasNext()) {
+            Integer id = (Integer)iter.next();
+            int index = majorDao.deleteByPrimaryKey(id);
+            if (index == 0) {
+                flag = false;
+                msg += "专业删除失败!" + id + ";";
+            } else {
+                msg += "专业删除成功!" + id + ";";
+            }
+        }
+        return Result.result(flag, msg, msg);
+    }
+
+    public Result<String> edit(MajorEntity data) {
+        boolean flag = true;
+        String msg = "";
+        MajorEntity tmpData = majorDao.selectByPrimaryKey(data.getId());
+        if (tmpData != null) {
+            int index = majorDao.updateByPrimaryKeySelective(data);
+            if (index == 0) {
+                flag = false;
+                msg = "专业信息修改失败";
+            } else {
+                msg = "专业信息修改成功";
+            }
+        } else {
+            flag = false;
+            msg = "专业信息不存在!";
+        }
+        return Result.result(flag, msg, msg);
+    }
+
+    public Result<List<MajorEntity>> findByName(String name){
+        if (name == null ||"".equals(name)){
+            return Result.result(false, "名称不能为空" ,null);
+        }
+        List<MajorEntity> list = majorDao.findByName("%" + name + "%");
+        return Result.success(list);
+    }
+
+    public MajorEntity getMajor(Integer id) {
+        return majorDao.selectByPrimaryKey(id);
+    }
+
+    public List<MajorEntity> getAllMajor() {
+        String msg = "";
+        Example example = new Example(MajorEntity.class);
+        example.createCriteria();
+        return majorDao.selectByExample(example);
+    }
+
+}

+ 101 - 0
src/main/java/com/zglc/fm/service/ManuelService.java

@@ -0,0 +1,101 @@
+package com.zglc.fm.service;
+
+import com.zglc.fm.base.Result;
+import com.zglc.fm.dao.ManuelDao;
+import com.zglc.fm.entity.FaultEntity;
+import com.zglc.fm.entity.ManuelEntity;
+import org.springframework.stereotype.Service;
+import tk.mybatis.mapper.entity.Example;
+
+import java.util.Iterator;
+import java.util.List;
+
+@Service
+
+public class ManuelService {
+
+    private ManuelDao manuelDao;
+
+    public ManuelService(ManuelDao manuelDao) {
+        this.manuelDao = manuelDao;
+    }
+
+    public List<ManuelEntity> listAll() {
+        return manuelDao.listAll();
+    }
+
+    public Integer getCount() {
+        return manuelDao.getCount();
+    }
+
+    public Result<String> add(ManuelEntity data) {
+        data.setId(null);
+        boolean flag = true;
+        String msg = "";
+        int index = manuelDao.insertSelective(data);
+        if (index == 0) {
+            flag = false;
+            msg = "添加手册信息失败!";
+        } else {
+            msg = "添加手册信息成功!";
+        }
+
+        return Result.result(flag, msg, msg);
+    }
+
+    public Result<String> delete(List<Integer> ids) {
+        boolean flag = true;
+        String msg = "";
+        Iterator iter = ids.iterator();
+        while(iter.hasNext()) {
+            Integer id = (Integer)iter.next();
+            int index = manuelDao.deleteByPrimaryKey(id);
+            if (index == 0) {
+                flag = false;
+                msg += "手册删除失败!" + id + ";";
+            } else {
+                msg += "手册删除成功!" + id + ";";
+            }
+        }
+        return Result.result(flag, msg, msg);
+    }
+
+    public Result<String> edit(ManuelEntity data) {
+        boolean flag = true;
+        String msg = "";
+        ManuelEntity tmpData = manuelDao.selectByPrimaryKey(data.getId());
+        if (tmpData != null) {
+            int index = manuelDao.updateByPrimaryKeySelective(data);
+            if (index == 0) {
+                flag = false;
+                msg = "故障信息修改失败";
+            } else {
+                msg = "故障信息修改成功";
+            }
+        } else {
+            flag = false;
+            msg = "手册信息不存在!";
+        }
+        return Result.result(flag, msg, msg);
+    }
+
+    public Result<List<ManuelEntity>> findByName(String name){
+        if (name == null ||"".equals(name)){
+            return Result.result(false, "名称不能为空" ,null);
+        }
+        List<ManuelEntity> list = manuelDao.findByName("%" + name + "%");
+        return Result.success(list);
+    }
+
+    public ManuelEntity getOutline(Integer id) {
+        return manuelDao.selectByPrimaryKey(id);
+    }
+
+    public List<ManuelEntity> getAllManuel() {
+        String msg = "";
+        Example example = new Example(ManuelEntity.class);
+        example.createCriteria();
+        return manuelDao.selectByExample(example);
+    }
+
+}

+ 101 - 0
src/main/java/com/zglc/fm/service/OutlineService.java

@@ -0,0 +1,101 @@
+package com.zglc.fm.service;
+
+import com.zglc.fm.base.Result;
+import com.zglc.fm.dao.OutlineDao;
+import com.zglc.fm.entity.FaultEntity;
+import com.zglc.fm.entity.OutlineEntity;
+import org.springframework.stereotype.Service;
+import tk.mybatis.mapper.entity.Example;
+
+import java.util.Iterator;
+import java.util.List;
+
+@Service
+
+public class OutlineService {
+
+    private OutlineDao outlineDao;
+
+    public OutlineService(OutlineDao outlineDao) {
+        this.outlineDao = outlineDao;
+    }
+
+    public List<OutlineEntity> listAll() {
+        return outlineDao.listAll();
+    }
+
+    public Integer getCount() {
+        return outlineDao.getCount();
+    }
+
+    public Result<String> add(OutlineEntity data) {
+        data.setId(null);
+        boolean flag = true;
+        String msg = "";
+        int index = outlineDao.insertSelective(data);
+        if (index == 0) {
+            flag = false;
+            msg = "添加大纲信息失败!";
+        } else {
+            msg = "添加大纲信息成功!";
+        }
+
+        return Result.result(flag, msg, msg);
+    }
+
+    public Result<String> delete(List<Integer> ids) {
+        boolean flag = true;
+        String msg = "";
+        Iterator iter = ids.iterator();
+        while(iter.hasNext()) {
+            Integer id = (Integer)iter.next();
+            int index = outlineDao.deleteByPrimaryKey(id);
+            if (index == 0) {
+                flag = false;
+                msg += "大纲删除失败!" + id + ";";
+            } else {
+                msg += "大纲删除成功!" + id + ";";
+            }
+        }
+        return Result.result(flag, msg, msg);
+    }
+
+    public Result<String> edit(OutlineEntity data) {
+        boolean flag = true;
+        String msg = "";
+        OutlineEntity tmpData = outlineDao.selectByPrimaryKey(data.getId());
+        if (tmpData != null) {
+            int index = outlineDao.updateByPrimaryKeySelective(data);
+            if (index == 0) {
+                flag = false;
+                msg = "大纲信息修改失败";
+            } else {
+                msg = "大纲信息修改成功";
+            }
+        } else {
+            flag = false;
+            msg = "大纲信息不存在!";
+        }
+        return Result.result(flag, msg, msg);
+    }
+
+    public Result<List<OutlineEntity>> findByName(String name){
+        if (name == null ||"".equals(name)){
+            return Result.result(false, "名称不能为空" ,null);
+        }
+        List<OutlineEntity> list = outlineDao.findByName("%" + name + "%");
+        return Result.success(list);
+    }
+
+    public OutlineEntity getOutline(Integer id) {
+        return outlineDao.selectByPrimaryKey(id);
+    }
+
+    public List<OutlineEntity> getAllOutline() {
+        String msg = "";
+        Example example = new Example(OutlineEntity.class);
+        example.createCriteria();
+        return outlineDao.selectByExample(example);
+    }
+
+}

+ 152 - 0
src/main/java/com/zglc/fm/service/RightsService.java

@@ -0,0 +1,152 @@
+package com.zglc.fm.service;
+
+import com.zglc.fm.dao.RoleDao;
+import com.zglc.fm.entity.RightsEntity;
+import com.zglc.fm.dao.RightsDao;
+import com.zglc.fm.entity.RoleEntity;
+import com.zglc.fm.utils.RightsTool;
+import org.springframework.stereotype.Service;
+import com.zglc.fm.base.Result;
+import tk.mybatis.mapper.entity.Example;
+import java.util.Iterator;
+import java.util.List;
+
+/**
+ * 权限
+ *
+ * @author wcf
+ * @email mnhwa@163.com
+ * @date 2020-02-14 01:26:35
+ * @description Refactoring 1st
+ *
+ */
+ @Service
+public class RightsService{
+
+	private RightsDao rightsDao;
+
+	private RoleDao roleDao;
+
+    public RightsService(RightsDao rightsDao,RoleDao roleDao){
+        this.roleDao = roleDao;
+        this.rightsDao = rightsDao;
+    }
+
+	public  List<RightsEntity> getAllRights(){return rightsDao.selectAll();}
+	
+	public RightsEntity getRights(Integer id){return rightsDao.selectByPrimaryKey(id);}
+
+	public RightsEntity getRightsByPath(String path)
+    {
+        Example example = new Example(RightsEntity.class);
+        example.createCriteria().andEqualTo("rightsPath", path);
+        return rightsDao.selectOneByExample(example);
+    }
+
+    public boolean haveRights(String path ,Integer roleId){
+        boolean flag = true;
+        RoleEntity roleEntity = roleDao.selectByPrimaryKey(roleId);
+        if (roleEntity != null)
+        {
+            RightsEntity rightsEntity = getRightsByPath(path);
+            if (rightsEntity != null)
+            {
+                flag = RightsTool.testRights(roleEntity.getRights(),rightsEntity.getId());
+            }
+        }else
+            flag = false;
+       return flag;
+    }
+
+	public Result<String> add(RightsEntity data){
+        data.setId(null);
+        boolean flag = true;
+        String msg = "";
+		int index = rightsDao.insertSelective(data);
+		if (index == 0) {
+			flag = false;
+			msg = "添加权限失败!";
+		} else {
+			msg = "添加权限成功!";
+		}
+		      
+        return Result.result(flag, msg, msg);
+    }
+	
+	public Result<String> addAndCheck(RightsEntity data){
+        boolean flag = true;
+        String msg = "";
+        RightsEntity tmpData = null;
+		Example example = new Example(RightsEntity.class);
+		example.createCriteria().andEqualTo("id", data.getId());
+		tmpData = rightsDao.selectOneByExample(example);
+		if (tmpData != null) {
+			flag = false;
+			msg = "权限已存在!";
+		} else {
+			int index = rightsDao.insertSelective(data);
+			if (index == 0) {
+				flag = false;
+				msg = "添加权限失败!";
+			} else {
+				msg = "添加权限成功!";
+			}
+		}
+	
+        return Result.result(flag, msg, msg);
+    }
+	
+	public Result<String> edit(RightsEntity data) {
+        boolean flag = true;
+        String msg = "";
+        RightsEntity tmpData = rightsDao.selectByPrimaryKey(data.getId());
+        if (tmpData != null) {
+            int index = rightsDao.updateByPrimaryKeySelective(data);
+            if (index == 0) {
+                flag = false;
+                msg = "权限修改失败!";
+            } else {
+                msg = "权限修改成功!";
+            }
+        } else {
+            flag = false;
+            msg = "权限不存在!";
+        }
+        return Result.result(flag, msg, msg);
+    }
+	
+	public Result<String> delete(List<Integer> ids) {
+        boolean flag = true;
+        String msg = "";
+        Iterator iter = ids.iterator();
+        while(iter.hasNext()) {
+            Integer id = (Integer)iter.next();
+            int index = rightsDao.deleteByPrimaryKey(id);
+            if (index == 0) {
+                flag = false;
+                msg += "权限删除失败!" + id + ";";
+            } else {
+                msg += "权限删除成功!" + id + ";";
+            }
+        }
+        return Result.result(flag, msg, msg);
+    }
+
+    public List<RightsEntity> listAllByRole(Integer roleId) {
+        List<RightsEntity> rightsList = rightsDao.listAll();
+        if (roleId != 0)
+        {
+            RoleEntity roleEntity = roleDao.selectByPrimaryKey(roleId);
+            if (roleEntity!= null && roleEntity.getRights().compareTo("") != 0)
+            {
+                Iterator iter = rightsList.iterator();
+                while (iter.hasNext()) {
+                    RightsEntity rightEntity = (RightsEntity) iter.next();
+                    rightEntity.setIsHave(RightsTool.testRights(roleEntity.getRights(), rightEntity.getId())? 1: 0);
+                }
+            }
+        }
+        return rightsList;
+    }
+}
+

+ 127 - 0
src/main/java/com/zglc/fm/service/RoleService.java

@@ -0,0 +1,127 @@
+package com.zglc.fm.service;
+
+import com.zglc.fm.dao.RightsDao;
+import com.zglc.fm.entity.RoleEntity;
+import com.zglc.fm.dao.RoleDao;
+import org.springframework.stereotype.Service;
+import com.zglc.fm.base.Result;
+import tk.mybatis.mapper.entity.Example;
+
+import java.util.Iterator;
+import java.util.List;
+
+/**
+ * 角色
+ *
+ * @author wcf
+ * @email mnhwa@163.com
+ * @date 2020-02-14 01:26:35
+ * @description Refactoring 1st
+ */
+@Service
+public class RoleService {
+
+    private RoleDao roleDao;
+    private RightsDao rightDao;
+
+    public RoleService(RoleDao roleDao, RightsDao rightDao) {
+        this.roleDao = roleDao;
+        this.rightDao = rightDao;
+    }
+
+    public List<RoleEntity> getAllRole() {
+        return roleDao.selectAll();
+    }
+
+    public List<RoleEntity> listAll() {
+        return roleDao.listAll();
+    }
+
+    public RoleEntity getRole(Integer id) {
+        return roleDao.selectByPrimaryKey(id);
+    }
+
+    public Result<String> add(RoleEntity data) {
+        data.setId(null);
+        boolean flag = true;
+        String msg = "";
+        int index = roleDao.insertSelective(data);
+        if (index == 0) {
+            flag = false;
+            msg = "添加角色失败!";
+        } else {
+            msg = "添加角色成功!";
+        }
+
+        return Result.result(flag, msg, msg);
+    }
+
+    public Result<String> addAndCheck(RoleEntity data) {
+        boolean flag = true;
+        String msg = "";
+        RoleEntity tmpData = null;
+        Example example = new Example(RoleEntity.class);
+        example.createCriteria().andEqualTo("id", data.getId());
+        tmpData = roleDao.selectOneByExample(example);
+        if (tmpData != null) {
+            flag = false;
+            msg = "角色已存在!";
+        } else {
+            int index = roleDao.insertSelective(data);
+            if (index == 0) {
+                flag = false;
+                msg = "添加角色失败!";
+            } else {
+                msg = "添加角色成功!";
+            }
+        }
+
+        return Result.result(flag, msg, msg);
+    }
+
+    public Result<String> edit(RoleEntity data) {
+        boolean flag = true;
+        String msg = "";
+        RoleEntity tmpData = roleDao.selectByPrimaryKey(data.getId());
+        if (tmpData != null) {
+            int index = roleDao.updateByPrimaryKeySelective(data);
+            if (index == 0) {
+                flag = false;
+                msg = "角色修改失败!";
+            } else {
+                msg = "角色修改成功!";
+            }
+        } else {
+            flag = false;
+            msg = "角色不存在!";
+        }
+        return Result.result(flag, msg, msg);
+    }
+
+    public Result<String> delete(List<Integer> ids) {
+        boolean flag = true;
+        String msg = "";
+        Iterator iter = ids.iterator();
+        while (iter.hasNext()) {
+            Integer id = (Integer) iter.next();
+            int index = roleDao.deleteByPrimaryKey(id);
+            if (index == 0) {
+                flag = false;
+                msg += "角色删除失败!" + id + ";";
+            } else {
+                msg += "角色删除成功!" + id + ";";
+            }
+        }
+        return Result.result(flag, msg, msg);
+    }
+
+    public List<RoleEntity> listByName(String name) {
+        if (name.compareTo("") == 0)
+            return getAllRole();
+        Example example = new Example(RoleEntity.class);
+        example.createCriteria().andLike("roleName", "%" + name + "%");
+        return roleDao.selectByExample(example);
+    }
+
+}
+

+ 60 - 0
src/main/java/com/zglc/fm/service/StrValueService.java

@@ -0,0 +1,60 @@
+package com.zglc.fm.service;
+
+import com.zglc.fm.base.Result;
+import com.zglc.fm.dao.StrValueDao;
+import com.zglc.fm.entity.StrValue;
+import org.springframework.stereotype.Service;
+import tk.mybatis.mapper.entity.Example;
+
+import java.util.Iterator;
+import java.util.List;
+
+/**
+ *
+ *
+ * @author wcf
+ * @email mnhwa@163.com
+ * @date 2020-02-14 01:26:35
+ * @description Refactoring 1st
+ *
+ */
+ @Service
+public class StrValueService {
+     private StrValueDao strValueDao;
+    public StrValueService(StrValueDao strValueDao){
+        this.strValueDao = strValueDao;
+    }
+
+	public StrValue get(Integer id){return  strValueDao.selectByPrimaryKey(id);}
+
+	public List<StrValue> getValues(List<Integer> ids){
+        Example example = new Example(StrValue.class);
+        example.createCriteria().andIn("id",ids);
+        return strValueDao.selectByExample(example);
+    }
+
+	public Integer add(StrValue data){
+        data.setId(null);
+		return strValueDao.insertSelective(data);
+    }
+
+	public Result<String> delete(List<Integer> ids) {
+        boolean flag = true;
+        String msg = "";
+        Iterator iter = ids.iterator();
+        while(iter.hasNext()) {
+            Integer id = (Integer)iter.next();
+            int index = strValueDao.deleteByPrimaryKey(id);
+            if (index == 0) {
+                flag = false;
+                msg += "权限数据失败!" + id + ";";
+            } else {
+                msg += "权限数据成功!" + id + ";";
+            }
+        }
+        return Result.result(flag, msg, msg);
+    }
+
+
+}
+

+ 180 - 0
src/main/java/com/zglc/fm/service/UserService.java

@@ -0,0 +1,180 @@
+package com.zglc.fm.service;
+
+import com.zglc.fm.entity.UserEntity;
+import com.zglc.fm.dao.UserDao;
+import org.springframework.stereotype.Service;
+import com.zglc.fm.base.Result;
+import tk.mybatis.mapper.entity.Example;
+
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.List;
+
+/**
+ * 用户
+ *
+ * @author wcf
+ * @email mnhwa@163.com
+ * @date 2020-02-14 01:26:35
+ * @description Refactoring 1st
+ */
+@Service
+public class UserService {
+
+    private UserDao userDao;
+
+    public UserService(UserDao userDao) {
+        this.userDao = userDao;
+    }
+
+    public List<UserEntity> getAllUser() {
+        String msg = "";
+        Example example = new Example(UserEntity.class);
+        example.createCriteria().andNotEqualTo("id", 1);
+        return userDao.selectByExample(example);
+    }
+
+    public List<UserEntity> listAll() {
+        return userDao.listAll();
+    }
+
+    public List<UserEntity> searchAllUser(Integer departmentId, Integer roleId, Integer nameType, String name) {
+
+        Example example = new Example(UserEntity.class);
+        Example.Criteria criteria = example.createCriteria();
+        if (departmentId != 0)
+            criteria.andEqualTo("departmentId", departmentId);
+        if (roleId != 0)
+            criteria.andEqualTo("roleId", roleId);
+        if(name != null)
+        {
+            if (nameType == 0 )
+                criteria.andLike("userName", "%" + name + "%");
+            else
+                criteria.andLike("realName", "%" + name + "%");
+            criteria.andNotEqualTo("id", 1);
+        }
+        if (criteria.isValid())
+            return userDao.selectByExample(example);
+        else
+            return getAllUser();
+    }
+
+    public UserEntity getUser(Integer id) {
+        return userDao.selectByPrimaryKey(id);
+    }
+
+    public UserEntity getUserByName(String userName) {
+        Example example = new Example(UserEntity.class);
+        example.createCriteria().andEqualTo("userName", userName);
+        return userDao.selectOneByExample(example);
+    }
+
+    public Integer getCount() {
+        return userDao.getCount();
+    }
+
+    public Result<String> add(UserEntity data) {
+        data.setId(null);
+        boolean flag = true;
+        String msg = "";
+        int index = userDao.insertSelective(data);
+        if (index == 0) {
+            flag = false;
+            msg = "添加用户失败!";
+        } else {
+            msg = "添加用户成功!";
+        }
+
+        return Result.result(flag, msg, msg);
+    }
+
+    public Result<String> addAndCheck(UserEntity data) {
+        boolean flag = true;
+        String msg = "";
+        UserEntity tmpData = null;
+        Example example = new Example(UserEntity.class);
+        example.createCriteria().andEqualTo("id", data.getId());
+        tmpData = userDao.selectOneByExample(example);
+        if (tmpData != null) {
+            flag = false;
+            msg = "用户已存在!";
+        } else {
+            int index = userDao.insertSelective(data);
+            if (index == 0) {
+                flag = false;
+                msg = "添加用户失败!";
+            } else {
+                msg = "添加用户成功!";
+            }
+        }
+
+        return Result.result(flag, msg, msg);
+    }
+
+    public Result<String> edit(UserEntity data) {
+        boolean flag = true;
+        String msg = "";
+        UserEntity tmpData = userDao.selectByPrimaryKey(data.getId());
+        if (tmpData != null) {
+
+            int index = userDao.updateByPrimaryKeySelective(data);
+            if (index == 0) {
+                flag = false;
+                msg = "用户修改失败!";
+            } else {
+                msg = "用户修改成功!";
+            }
+        } else {
+            flag = false;
+            msg = "用户不存在!";
+        }
+        return Result.result(flag, msg, msg);
+    }
+
+    public boolean getImg(UserEntity userEntity){
+        boolean result = false;
+        if (userEntity != null)
+        {
+            if (userEntity.getImg().compareTo("") != 0 && userEntity.getImg().length() > 15)
+                result = true;
+        }
+        return result;
+    }
+    public Result<String> delete(List<Integer> ids) {
+        boolean flag = true;
+        String msg = "";
+        List<String> files = new ArrayList<>();
+        Iterator iter = ids.iterator();
+        while (iter.hasNext()) {
+            Integer id = (Integer) iter.next();
+            UserEntity userEntity = userDao.selectByPrimaryKey(id);
+           if (getImg(userEntity))
+                    files.add("image/" + userEntity.getImg());
+            int index = userDao.deleteByPrimaryKey(id);
+            if (index == 0) {
+                flag = false;
+                msg += "用户删除失败!" + id + ";";
+            } else {
+                msg += "用户删除成功!" + id + ";";
+            }
+        }
+
+        return Result.result(flag, msg, msg);
+    }
+
+    public Result<List<UserEntity>> findByName(String name){
+        if (name == null || "".equals(name)){
+            return Result.result(false, "名称不能为空!", null);
+        }
+        List<UserEntity> list = userDao.findByName("%" + name + "%");
+        return Result.success(list);
+    }
+
+    public Result<List<UserEntity>> findByUser(UserEntity user){
+        List<UserEntity> list = userDao.findByUser(user);
+        return Result.success(list);
+
+    }
+}
+

+ 80 - 0
src/main/java/com/zglc/fm/utils/CollectionUtil.java

@@ -0,0 +1,80 @@
+//
+// Source code recreated from a .class file by IntelliJ IDEA
+// (powered by Fernflower decompiler)
+//
+
+package com.zglc.fm.utils;
+
+
+//import org.elasticsearch.common.inject.internal.Nullable;
+import org.springframework.data.domain.Page;
+import org.springframework.data.domain.PageImpl;
+import org.springframework.data.domain.Pageable;
+import org.springframework.lang.Nullable;
+import org.springframework.util.CollectionUtils;
+
+import java.util.*;
+import java.util.function.Function;
+import java.util.stream.Collectors;
+import java.util.stream.Stream;
+
+public class CollectionUtil {
+ public CollectionUtil() {
+ }
+
+ public static <T> boolean addIfNotContains(Collection<T> collection, T item) {
+  if (!collection.contains(item)) {
+   collection.add(item);
+   return true;
+  } else {
+   return false;
+  }
+ }
+
+ public static <T> boolean listIsNotEmpty(@Nullable List<T> list) {
+  return list != null && !list.isEmpty();
+ }
+
+ public static <T> boolean listIsEmpty(@Nullable List<T> list) {
+  return CollectionUtils.isEmpty(list);
+ }
+
+ public static <T> T getIndexOf(T[] arr, int index, T defaultValue) {
+  if (index < 0) {
+   return defaultValue;
+  } else {
+   return arr != null && arr.length > index ? arr[index] : defaultValue;
+  }
+ }
+
+ public static <T> T getIndexOf(List<Map<String, Object>> collection, int index, Object defaultValue) {
+  return collection != null && collection.size() > index ? (T) collection.get(index) : (T) defaultValue;
+ }
+
+ public static <E, T> List<T> convert(Collection<E> collection, Function<? super E, T> function) {
+  Stream var10000 = collection.stream();
+  function.getClass();
+  return (List)var10000.map(function).collect(Collectors.toList());
+ }
+
+ public static <T> Page<T> listConvertToPage(List<T> list, Pageable pageable) {
+  int start = (int)pageable.getOffset();
+  int end = (start + pageable.getPageSize()) > list.size() ? list.size() : ( start + pageable.getPageSize());
+  return new PageImpl<T>(list.subList(start, end), pageable, list.size());
+ }
+
+ public static <T> boolean equalsAny(T entity, List<T> compare) {
+  Iterator var2 = compare.iterator();
+
+  Object t;
+  do {
+   if (!var2.hasNext()) {
+    return false;
+   }
+
+   t = var2.next();
+  } while(!Objects.equals(entity, t));
+
+  return true;
+ }
+}

+ 223 - 0
src/main/java/com/zglc/fm/utils/DateTool.java

@@ -0,0 +1,223 @@
+package com.zglc.fm.utils;
+
+import java.text.DateFormat;
+import java.text.ParseException;
+import java.text.SimpleDateFormat;
+import java.util.Calendar;
+import java.util.Date;
+
+public class DateTool {
+    private final static SimpleDateFormat sdfYear = new SimpleDateFormat("yyyy");
+    private final static SimpleDateFormat sdfDay = new SimpleDateFormat("yyyy-MM-dd");
+    private final static SimpleDateFormat sdfDays = new SimpleDateFormat("yyyyMMdd");
+    private final static SimpleDateFormat sdfTime = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
+    private final static SimpleDateFormat sdfTimes = new SimpleDateFormat("yyyyMMddHHmmss");
+
+    /**
+     * 获取yyyyMMddHHmmss格式
+     * @return
+     */
+    public static String getDateString() {
+        return sdfTimes.format(new Date());
+    }
+
+    /**
+     * 获取YYYY-MM-DD HH:mm:ss格式
+     * @return
+     */
+    public static String getFormatedDateString() {
+        return sdfTime.format(new Date());
+    }
+
+    /**
+     * 获取YYYY格式
+     * @return
+     */
+    public static String getYearString() {
+        return sdfYear.format(new Date());
+    }
+
+    /**
+     * 获取YYYY-MM-DD格式
+     * @return
+     */
+    public static String getFormatedDayString() {
+        return sdfDay.format(new Date());
+    }
+
+    /**
+     * 获取YYYYMMDD格式
+     * @return
+     */
+    public static String getDayString(){
+        return sdfDays.format(new Date());
+    }
+
+
+
+    /**
+     * @Title: compareDate
+     * @Description: TODO(日期比较,如果s>=e 返回true 否则返回false)
+     * @param s
+     * @param e
+     * @return boolean
+     * @throws
+     * @author fh
+     */
+    public static boolean compareDate(String s, String e) {
+        if(stringToDate(s)==null||stringToDate(e)==null){
+            return false;
+        }
+        return stringToDate(s).getTime() >=stringToDate(e).getTime();
+    }
+
+    /**
+     * 格式化日期 yyyy-MM-dd格式
+     * @return
+     */
+    public static Date stringToDate(String date) {
+        DateFormat fmt = new SimpleDateFormat("yyyy-MM-dd");
+        try {
+            return fmt.parse(date);
+        } catch (ParseException e) {
+            e.printStackTrace();
+            return null;
+        }
+    }
+
+    /**
+     * 按照yyyy-MM-dd HH:mm:ss的格式,字符串转日期
+     * @param date
+     * @return
+     */
+    public static Date stringToDateTime(String date){
+        if(Tools.notEmpty(date)){
+            SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
+            try {
+                return sdf.parse(date);
+            } catch (ParseException e) {
+                e.printStackTrace();
+            }
+            return new Date();
+        }else{
+            return null;
+        }
+    }
+
+    /**
+     * 按照参数format的格式,日期转字符串
+     * @param date
+     * @param format
+     * @return
+     */
+    public static String dateToString(Date date,String format){
+        if(date!=null){
+            SimpleDateFormat sdf = new SimpleDateFormat(format);
+            return sdf.format(date);
+        }else{
+            return "";
+        }
+    }
+
+    /**
+     * 按照yyyy-MM-dd HH:mm:ss的格式,日期转字符串
+     * @param date
+     * @return yyyy-MM-dd HH:mm:ss
+     */
+    public static String dateToString(Date date){
+        return dateToString(date,"yyyy-MM-dd HH:mm:ss");
+    }
+
+    /**
+     * 校验日期是否合法
+     * @return
+     */
+    public static boolean isValidDate(String s) {
+        DateFormat fmt = new SimpleDateFormat("yyyy-MM-dd");
+        try {
+            fmt.parse(s);
+            return true;
+        } catch (Exception e) {
+            // 如果throw java.text.ParseException或者NullPointerException,就说明格式不对
+            return false;
+        }
+    }
+
+    /**
+     * 获取相隔多少年
+     * @param startTime
+     * @param endTime
+     * @return
+     */
+    public static int getDiffYear(String startTime,String endTime) {
+        DateFormat fmt = new SimpleDateFormat("yyyy-MM-dd");
+        try {
+            //long aa=0;
+            int years=(int) (((fmt.parse(endTime).getTime()-fmt.parse(startTime).getTime())/ (1000 * 60 * 60 * 24))/365);
+            return years;
+        } catch (Exception e) {
+            // 如果throw java.text.ParseException或者NullPointerException,就说明格式不对
+            return 0;
+        }
+    }
+
+    /**
+     * <li>功能描述:时间相减得到天数
+     * @param beginDateStr
+     * @param endDateStr
+     * @return
+     * long
+     * @author Administrator
+     */
+    public static long getDaySub(String beginDateStr,String endDateStr){
+        long day=0;
+        java.text.SimpleDateFormat format = new java.text.SimpleDateFormat("yyyy-MM-dd");
+        java.util.Date beginDate = null;
+        java.util.Date endDate = null;
+
+        try {
+            beginDate = format.parse(beginDateStr);
+            endDate= format.parse(endDateStr);
+        } catch (ParseException e) {
+            e.printStackTrace();
+        }
+        day=(endDate.getTime()-beginDate.getTime())/(24*60*60*1000);
+        //System.out.println("相隔的天数="+day);
+
+        return day;
+    }
+
+    /**
+     * 得到n天之后的日期
+     * @param days
+     * @return
+     */
+    public static String getAfterDayDate(String days) {
+        int daysInt = Integer.parseInt(days);
+
+        Calendar canlendar = Calendar.getInstance(); // java.util包
+        canlendar.add(Calendar.DATE, daysInt); // 日期减 如果不够减会将月变动
+        Date date = canlendar.getTime();
+
+        SimpleDateFormat sdfd = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
+        String dateStr = sdfd.format(date);
+
+        return dateStr;
+    }
+
+    /**
+     * 得到n天之后是周几
+     * @param days
+     * @return
+     */
+    public static String getAfterDayWeek(String days) {
+        int daysInt = Integer.parseInt(days);
+        Calendar canlendar = Calendar.getInstance(); // java.util包
+        canlendar.add(Calendar.DATE, daysInt); // 日期减 如果不够减会将月变动
+        Date date = canlendar.getTime();
+        SimpleDateFormat sdf = new SimpleDateFormat("E");
+        String dateStr = sdf.format(date);
+        return dateStr;
+    }
+}
+

+ 21 - 0
src/main/java/com/zglc/fm/utils/DigestUtil.java

@@ -0,0 +1,21 @@
+package com.zglc.fm.utils;
+
+import org.apache.tomcat.util.buf.HexUtils;
+
+import java.security.MessageDigest;
+import java.security.NoSuchAlgorithmException;
+
+public class DigestUtil
+{
+    public static String getMD5Str(final String src) {
+        try {
+            final MessageDigest md5Digest = MessageDigest.getInstance("MD5");
+            final byte[] digest = md5Digest.digest(src.getBytes());
+            return HexUtils.toHexString(digest);
+        }
+        catch (NoSuchAlgorithmException e) {
+            e.printStackTrace();
+            return null;
+        }
+    }
+}

+ 45 - 0
src/main/java/com/zglc/fm/utils/DocToPdf.java

@@ -0,0 +1,45 @@
+package com.zglc.fm.utils;
+
+import com.aspose.words.Document;
+import com.aspose.words.License;
+
+import java.io.File;
+import java.io.InputStream;
+
+public class DocToPdf {
+
+    /*public static void main(String[] args) {
+        loadLicense();
+        convertDoc2Pdf("/Users/wcf/Desktop/123.wps","/Users/wcf/Desktop");
+    }*/
+
+
+    public static void loadLicense() {
+        final InputStream is = DocToPdf.class.getClassLoader().getResourceAsStream("license.xml");
+        final License aposeLic = new License();
+        try {
+            assert is != null;
+            aposeLic.setLicense(is);
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+    }
+
+    public static File convertDoc2Pdf(final String docPath, final String pdfLocal) {
+        FileUtils.mkDirIfNotExists(new File(pdfLocal));
+        final String nameWithoutExtension = FileUtils.getNameWithoutExtension(docPath);
+        final File docPdfFile = new File(pdfLocal + File.separator + nameWithoutExtension + ".pdf");
+        if (docPdfFile.exists() && docPdfFile.length() != 0L) {
+            return docPdfFile;
+        }
+        try {
+            final Document document = new Document(docPath);
+            document.save(docPdfFile.getPath(), 40);
+            return docPdfFile;
+        } catch (Exception e) {
+            e.printStackTrace();
+            return null;
+        }
+    }
+
+}

+ 883 - 0
src/main/java/com/zglc/fm/utils/EncodingDetect.java

@@ -0,0 +1,883 @@
+//
+// Source code recreated from a .class file by IntelliJ IDEA
+// (powered by Fernflower decompiler)
+//
+
+package com.zglc.fm.utils;
+
+import java.io.Closeable;
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.InputStream;
+import java.net.URL;
+
+public class EncodingDetect {
+    public EncodingDetect() {
+    }
+
+    public static String detect(String path) {
+        EncodingDetect.BytesEncodingDetect s = new EncodingDetect.BytesEncodingDetect();
+        return EncodingDetect.BytesEncodingDetect.javaname[s.detectEncoding(new File(path))];
+    }
+
+    public static String detect(File file) {
+        EncodingDetect.BytesEncodingDetect s = new EncodingDetect.BytesEncodingDetect();
+        return EncodingDetect.BytesEncodingDetect.javaname[s.detectEncoding(file)];
+    }
+
+    public static String detect(byte[] contents) {
+        EncodingDetect.BytesEncodingDetect s = new EncodingDetect.BytesEncodingDetect();
+        return EncodingDetect.BytesEncodingDetect.javaname[s.detectEncoding(contents)];
+    }
+
+    public static String detect(URL url) {
+        EncodingDetect.BytesEncodingDetect s = new EncodingDetect.BytesEncodingDetect();
+        return EncodingDetect.BytesEncodingDetect.javaname[s.detectEncoding(url)];
+    }
+
+    static class Encoding {
+        public static int GB2312 = 0;
+        public static int GBK = 1;
+        public static int GB18030 = 2;
+        public static int HZ = 3;
+        public static int BIG5 = 4;
+        public static int CNS11643 = 5;
+        public static int UTF8 = 6;
+        public static int UTF8T = 7;
+        public static int UTF8S = 8;
+        public static int UNICODE = 9;
+        public static int UNICODET = 10;
+        public static int UNICODES = 11;
+        public static int ISO2022CN = 12;
+        public static int ISO2022CN_CNS = 13;
+        public static int ISO2022CN_GB = 14;
+        public static int EUC_KR = 15;
+        public static int CP949 = 16;
+        public static int ISO2022KR = 17;
+        public static int JOHAB = 18;
+        public static int SJIS = 19;
+        public static int EUC_JP = 20;
+        public static int ISO2022JP = 21;
+        public static int ASCII = 22;
+        public static int OTHER = 23;
+        public static int TOTALTYPES = 24;
+        public static final int SIMP = 0;
+        public static final int TRAD = 1;
+        public static String[] javaname;
+        public static String[] nicename;
+        public static String[] htmlname;
+
+        public Encoding() {
+            javaname = new String[TOTALTYPES];
+            nicename = new String[TOTALTYPES];
+            htmlname = new String[TOTALTYPES];
+            javaname[GB2312] = "GB2312";
+            javaname[GBK] = "GBK";
+            javaname[GB18030] = "GB18030";
+            javaname[HZ] = "ASCII";
+            javaname[ISO2022CN_GB] = "ISO2022CN_GB";
+            javaname[BIG5] = "BIG5";
+            javaname[CNS11643] = "EUC-TW";
+            javaname[ISO2022CN_CNS] = "ISO2022CN_CNS";
+            javaname[ISO2022CN] = "ISO2022CN";
+            javaname[UTF8] = "UTF-8";
+            javaname[UTF8T] = "UTF-8";
+            javaname[UTF8S] = "UTF-8";
+            javaname[UNICODE] = "Unicode";
+            javaname[UNICODET] = "Unicode";
+            javaname[UNICODES] = "Unicode";
+            javaname[EUC_KR] = "EUC_KR";
+            javaname[CP949] = "MS949";
+            javaname[ISO2022KR] = "ISO2022KR";
+            javaname[JOHAB] = "Johab";
+            javaname[SJIS] = "SJIS";
+            javaname[EUC_JP] = "EUC_JP";
+            javaname[ISO2022JP] = "ISO2022JP";
+            javaname[ASCII] = "ASCII";
+            javaname[OTHER] = "ISO8859_1";
+            htmlname[GB2312] = "GB2312";
+            htmlname[GBK] = "GBK";
+            htmlname[GB18030] = "GB18030";
+            htmlname[HZ] = "HZ-GB-2312";
+            htmlname[ISO2022CN_GB] = "ISO-2022-CN-EXT";
+            htmlname[BIG5] = "BIG5";
+            htmlname[CNS11643] = "EUC-TW";
+            htmlname[ISO2022CN_CNS] = "ISO-2022-CN-EXT";
+            htmlname[ISO2022CN] = "ISO-2022-CN";
+            htmlname[UTF8] = "UTF-8";
+            htmlname[UTF8T] = "UTF-8";
+            htmlname[UTF8S] = "UTF-8";
+            htmlname[UNICODE] = "UTF-16";
+            htmlname[UNICODET] = "UTF-16";
+            htmlname[UNICODES] = "UTF-16";
+            htmlname[EUC_KR] = "EUC-KR";
+            htmlname[CP949] = "x-windows-949";
+            htmlname[ISO2022KR] = "ISO-2022-KR";
+            htmlname[JOHAB] = "x-Johab";
+            htmlname[SJIS] = "Shift_JIS";
+            htmlname[EUC_JP] = "EUC-JP";
+            htmlname[ISO2022JP] = "ISO-2022-JP";
+            htmlname[ASCII] = "ASCII";
+            htmlname[OTHER] = "ISO8859-1";
+            nicename[GB2312] = "GB-2312";
+            nicename[GBK] = "GBK";
+            nicename[GB18030] = "GB18030";
+            nicename[HZ] = "HZ";
+            nicename[ISO2022CN_GB] = "ISO2022CN-GB";
+            nicename[BIG5] = "Big5";
+            nicename[CNS11643] = "CNS11643";
+            nicename[ISO2022CN_CNS] = "ISO2022CN-CNS";
+            nicename[ISO2022CN] = "ISO2022 CN";
+            nicename[UTF8] = "UTF-8";
+            nicename[UTF8T] = "UTF-8 (Trad)";
+            nicename[UTF8S] = "UTF-8 (Simp)";
+            nicename[UNICODE] = "Unicode";
+            nicename[UNICODET] = "Unicode (Trad)";
+            nicename[UNICODES] = "Unicode (Simp)";
+            nicename[EUC_KR] = "EUC-KR";
+            nicename[CP949] = "CP949";
+            nicename[ISO2022KR] = "ISO 2022 KR";
+            nicename[JOHAB] = "Johab";
+            nicename[SJIS] = "Shift-JIS";
+            nicename[EUC_JP] = "EUC-JP";
+            nicename[ISO2022JP] = "ISO 2022 JP";
+            nicename[ASCII] = "ASCII";
+            nicename[OTHER] = "OTHER";
+        }
+    }
+
+    static class BytesEncodingDetect extends EncodingDetect.Encoding {
+        int[][] GBFreq = new int[94][94];
+        int[][] GBKFreq = new int[126][191];
+        int[][] Big5Freq = new int[94][158];
+        int[][] Big5PFreq = new int[126][191];
+        int[][] EUC_TWFreq = new int[94][94];
+        int[][] KRFreq = new int[94][94];
+        int[][] JPFreq = new int[94][94];
+        boolean debug = false;
+
+        BytesEncodingDetect() {
+            this.initialize_frequencies();
+        }
+
+        int detectEncoding(URL testurl) {
+            byte[] rawText = new byte[10000];
+            int byteOffset = 0;
+            InputStream is = null;
+
+            int guess;
+            try {
+                int bytesRead;
+                for(is = testurl.openStream(); (bytesRead = is.read(rawText, byteOffset, rawText.length - byteOffset)) > 0; byteOffset += bytesRead) {
+                }
+
+                guess = this.detectEncoding(rawText);
+            } catch (Exception var11) {
+                System.err.println("Error loading or using URL " + var11.toString());
+                guess = -1;
+            } finally {
+                FileUtils.closeAllStream(new Closeable[]{is});
+            }
+
+            return guess;
+        }
+
+        int detectEncoding(File testfile) {
+            byte[] rawtext = new byte[(int)testfile.length()];
+
+            try {
+                FileInputStream fileis = new FileInputStream(testfile);
+                fileis.read(rawtext);
+                fileis.close();
+            } catch (Exception var5) {
+                System.err.println("Error: " + var5);
+                System.err.println();
+            }
+
+            return this.detectEncoding(rawtext);
+        }
+
+        int detectEncoding(byte[] rawtext) {
+            int maxscore = 0;
+            int encoding_guess = OTHER;
+            int[] scores = new int[TOTALTYPES];
+            scores[GB2312] = this.gb2312_probability(rawtext);
+            scores[GBK] = this.gbk_probability(rawtext);
+            scores[GB18030] = this.gb18030_probability(rawtext);
+            scores[HZ] = this.hz_probability(rawtext);
+            scores[BIG5] = this.big5_probability(rawtext);
+            scores[CNS11643] = this.euc_tw_probability(rawtext);
+            scores[ISO2022CN] = this.iso_2022_cn_probability(rawtext);
+            scores[UTF8] = this.utf8_probability(rawtext);
+            scores[UNICODE] = this.utf16_probability(rawtext);
+            scores[EUC_KR] = this.euc_kr_probability(rawtext);
+            scores[CP949] = this.cp949_probability(rawtext);
+            scores[JOHAB] = 0;
+            scores[ISO2022KR] = this.iso_2022_kr_probability(rawtext);
+            scores[ASCII] = this.ascii_probability(rawtext);
+            scores[SJIS] = this.sjis_probability(rawtext);
+            scores[EUC_JP] = this.euc_jp_probability(rawtext);
+            scores[ISO2022JP] = this.iso_2022_jp_probability(rawtext);
+            scores[UNICODET] = 0;
+            scores[UNICODES] = 0;
+            scores[ISO2022CN_GB] = 0;
+            scores[ISO2022CN_CNS] = 0;
+            scores[OTHER] = 0;
+
+            for(int index = 0; index < TOTALTYPES; ++index) {
+                if (this.debug) {
+                    System.err.println("Encoding " + nicename[index] + " score " + scores[index]);
+                }
+
+                if (scores[index] > maxscore) {
+                    encoding_guess = index;
+                    maxscore = scores[index];
+                }
+            }
+
+            if (maxscore <= 50) {
+                encoding_guess = OTHER;
+            }
+
+            return encoding_guess;
+        }
+
+        int gb2312_probability(byte[] rawtext) {
+            int rawtextlen = 0;
+            int dbchars = 1;
+            int gbchars = 1;
+            long gbfreq = 0L;
+            long totalfreq = 1L;
+            float rangeval = 0.0F;
+            float freqval = 0.0F;
+            rawtextlen = rawtext.length;
+
+            for(int i = 0; i < rawtextlen - 1; ++i) {
+                if (rawtext[i] < 0) {
+                    ++dbchars;
+                    if (-95 <= rawtext[i] && rawtext[i] <= -9 && -95 <= rawtext[i + 1] && rawtext[i + 1] <= -2) {
+                        ++gbchars;
+                        totalfreq += 500L;
+                        int row = rawtext[i] + 256 - 161;
+                        int column = rawtext[i + 1] + 256 - 161;
+                        if (this.GBFreq[row][column] != 0) {
+                            gbfreq += (long)this.GBFreq[row][column];
+                        } else if (15 <= row && row < 55) {
+                            gbfreq += 200L;
+                        }
+                    }
+
+                    ++i;
+                }
+            }
+
+            rangeval = 50.0F * ((float)gbchars / (float)dbchars);
+            freqval = 50.0F * ((float)gbfreq / (float)totalfreq);
+            return (int)(rangeval + freqval);
+        }
+
+        int gbk_probability(byte[] rawtext) {
+            int rawtextlen = 0;
+            int dbchars = 1;
+            int gbchars = 1;
+            long gbfreq = 0L;
+            long totalfreq = 1L;
+            float rangeval = 0.0F;
+            float freqval = 0.0F;
+            rawtextlen = rawtext.length;
+
+            for(int i = 0; i < rawtextlen - 1; ++i) {
+                if (rawtext[i] < 0) {
+                    ++dbchars;
+                    int row;
+                    int column;
+                    if (-95 <= rawtext[i] && rawtext[i] <= -9 && -95 <= rawtext[i + 1] && rawtext[i + 1] <= -2) {
+                        ++gbchars;
+                        totalfreq += 500L;
+                        row = rawtext[i] + 256 - 161;
+                        column = rawtext[i + 1] + 256 - 161;
+                        if (this.GBFreq[row][column] != 0) {
+                            gbfreq += (long)this.GBFreq[row][column];
+                        } else if (15 <= row && row < 55) {
+                            gbfreq += 200L;
+                        }
+                    } else if (-127 <= rawtext[i] && rawtext[i] <= -2 && (-128 <= rawtext[i + 1] && rawtext[i + 1] <= -2 || 64 <= rawtext[i + 1] && rawtext[i + 1] <= 126)) {
+                        ++gbchars;
+                        totalfreq += 500L;
+                        row = rawtext[i] + 256 - 129;
+                        if (64 <= rawtext[i + 1] && rawtext[i + 1] <= 126) {
+                            column = rawtext[i + 1] - 64;
+                        } else {
+                            column = rawtext[i + 1] + 256 - 64;
+                        }
+
+                        if (this.GBKFreq[row][column] != 0) {
+                            gbfreq += (long)this.GBKFreq[row][column];
+                        }
+                    }
+
+                    ++i;
+                }
+            }
+
+            rangeval = 50.0F * ((float)gbchars / (float)dbchars);
+            freqval = 50.0F * ((float)gbfreq / (float)totalfreq);
+            return (int)(rangeval + freqval) - 1;
+        }
+
+        int gb18030_probability(byte[] rawtext) {
+            int rawtextlen = 0;
+            int dbchars = 1;
+            int gbchars = 1;
+            long gbfreq = 0L;
+            long totalfreq = 1L;
+            float rangeval = 0.0F;
+            float freqval = 0.0F;
+            rawtextlen = rawtext.length;
+
+            for(int i = 0; i < rawtextlen - 1; ++i) {
+                if (rawtext[i] < 0) {
+                    ++dbchars;
+                    int row;
+                    int column;
+                    if (-95 <= rawtext[i] && rawtext[i] <= -9 && i + 1 < rawtextlen && -95 <= rawtext[i + 1] && rawtext[i + 1] <= -2) {
+                        ++gbchars;
+                        totalfreq += 500L;
+                        row = rawtext[i] + 256 - 161;
+                        column = rawtext[i + 1] + 256 - 161;
+                        if (this.GBFreq[row][column] != 0) {
+                            gbfreq += (long)this.GBFreq[row][column];
+                        } else if (15 <= row && row < 55) {
+                            gbfreq += 200L;
+                        }
+                    } else if (-127 > rawtext[i] || rawtext[i] > -2 || i + 1 >= rawtextlen || (-128 > rawtext[i + 1] || rawtext[i + 1] > -2) && (64 > rawtext[i + 1] || rawtext[i + 1] > 126)) {
+                        if (-127 <= rawtext[i] && rawtext[i] <= -2 && i + 3 < rawtextlen && 48 <= rawtext[i + 1] && rawtext[i + 1] <= 57 && -127 <= rawtext[i + 2] && rawtext[i + 2] <= -2 && 48 <= rawtext[i + 3] && rawtext[i + 3] <= 57) {
+                            ++gbchars;
+                        }
+                    } else {
+                        ++gbchars;
+                        totalfreq += 500L;
+                        row = rawtext[i] + 256 - 129;
+                        if (64 <= rawtext[i + 1] && rawtext[i + 1] <= 126) {
+                            column = rawtext[i + 1] - 64;
+                        } else {
+                            column = rawtext[i + 1] + 256 - 64;
+                        }
+
+                        if (this.GBKFreq[row][column] != 0) {
+                            gbfreq += (long)this.GBKFreq[row][column];
+                        }
+                    }
+
+                    ++i;
+                }
+            }
+
+            rangeval = 50.0F * ((float)gbchars / (float)dbchars);
+            freqval = 50.0F * ((float)gbfreq / (float)totalfreq);
+            return (int)(rangeval + freqval) - 1;
+        }
+
+        int hz_probability(byte[] rawtext) {
+            int hzchars = 0;
+            int dbchars = 1;
+            long hzfreq = 0L;
+            long totalfreq = 1L;
+            float rangeval = 0.0F;
+            float freqval = 0.0F;
+            int hzstart = 0;
+            int hzend = 0;
+            int rawtextlen = rawtext.length;
+
+            for(int i = 0; i < rawtextlen; ++i) {
+                if (rawtext[i] == 126) {
+                    if (rawtext[i + 1] != 123) {
+                        if (rawtext[i + 1] == 125) {
+                            ++hzend;
+                            ++i;
+                        } else if (rawtext[i + 1] == 126) {
+                            ++i;
+                        }
+                    } else {
+                        ++hzstart;
+
+                        for(i += 2; i < rawtextlen - 1 && rawtext[i] != 10 && rawtext[i] != 13; i += 2) {
+                            if (rawtext[i] == 126 && rawtext[i + 1] == 125) {
+                                ++hzend;
+                                ++i;
+                                break;
+                            }
+
+                            int row;
+                            int column;
+                            if (33 <= rawtext[i] && rawtext[i] <= 119 && 33 <= rawtext[i + 1] && rawtext[i + 1] <= 119) {
+                                hzchars += 2;
+                                row = rawtext[i] - 33;
+                                column = rawtext[i + 1] - 33;
+                                totalfreq += 500L;
+                                if (this.GBFreq[row][column] != 0) {
+                                    hzfreq += (long)this.GBFreq[row][column];
+                                } else if (15 <= row && row < 55) {
+                                    hzfreq += 200L;
+                                }
+                            } else if (161 <= rawtext[i] && rawtext[i] <= 247 && 161 <= rawtext[i + 1] && rawtext[i + 1] <= 247) {
+                                hzchars += 2;
+                                row = rawtext[i] + 256 - 161;
+                                column = rawtext[i + 1] + 256 - 161;
+                                totalfreq += 500L;
+                                if (this.GBFreq[row][column] != 0) {
+                                    hzfreq += (long)this.GBFreq[row][column];
+                                } else if (15 <= row && row < 55) {
+                                    hzfreq += 200L;
+                                }
+                            }
+
+                            dbchars += 2;
+                        }
+                    }
+                }
+            }
+
+            if (hzstart > 4) {
+                rangeval = 50.0F;
+            } else if (hzstart > 1) {
+                rangeval = 41.0F;
+            } else if (hzstart > 0) {
+                rangeval = 39.0F;
+            } else {
+                rangeval = 0.0F;
+            }
+
+            freqval = 50.0F * ((float)hzfreq / (float)totalfreq);
+            return (int)(rangeval + freqval);
+        }
+
+        int big5_probability(byte[] rawtext) {
+            int rawtextlen = 0;
+            int dbchars = 1;
+            int bfchars = 1;
+            float rangeval = 0.0F;
+            float freqval = 0.0F;
+            long bffreq = 0L;
+            long totalfreq = 1L;
+            rawtextlen = rawtext.length;
+
+            for(int i = 0; i < rawtextlen - 1; ++i) {
+                if (rawtext[i] < 0) {
+                    ++dbchars;
+                    if (-95 <= rawtext[i] && rawtext[i] <= -7 && (64 <= rawtext[i + 1] && rawtext[i + 1] <= 126 || -95 <= rawtext[i + 1] && rawtext[i + 1] <= -2)) {
+                        ++bfchars;
+                        totalfreq += 500L;
+                        int row = rawtext[i] + 256 - 161;
+                        int column;
+                        if (64 <= rawtext[i + 1] && rawtext[i + 1] <= 126) {
+                            column = rawtext[i + 1] - 64;
+                        } else {
+                            column = rawtext[i + 1] + 256 - 97;
+                        }
+
+                        if (this.Big5Freq[row][column] != 0) {
+                            bffreq += (long)this.Big5Freq[row][column];
+                        } else if (3 <= row && row <= 37) {
+                            bffreq += 200L;
+                        }
+                    }
+
+                    ++i;
+                }
+            }
+
+            rangeval = 50.0F * ((float)bfchars / (float)dbchars);
+            freqval = 50.0F * ((float)bffreq / (float)totalfreq);
+            return (int)(rangeval + freqval);
+        }
+
+        int big5plus_probability(byte[] rawtext) {
+            int rawtextlen = 0;
+            int dbchars = 1;
+            int bfchars = 1;
+            long bffreq = 0L;
+            long totalfreq = 1L;
+            float rangeval = 0.0F;
+            float freqval = 0.0F;
+            rawtextlen = rawtext.length;
+
+            for(int i = 0; i < rawtextlen - 1; ++i) {
+                if (rawtext[i] < 128) {
+                    ++dbchars;
+                    int row;
+                    int column;
+                    if (161 <= rawtext[i] && rawtext[i] <= 249 && (64 <= rawtext[i + 1] && rawtext[i + 1] <= 126 || 161 <= rawtext[i + 1] && rawtext[i + 1] <= 254)) {
+                        ++bfchars;
+                        totalfreq += 500L;
+                        row = rawtext[i] - 161;
+                        if (64 <= rawtext[i + 1] && rawtext[i + 1] <= 126) {
+                            column = rawtext[i + 1] - 64;
+                        } else {
+                            column = rawtext[i + 1] - 97;
+                        }
+
+                        if (this.Big5Freq[row][column] != 0) {
+                            bffreq += (long)this.Big5Freq[row][column];
+                        } else if (3 <= row && row < 37) {
+                            bffreq += 200L;
+                        }
+                    } else if (129 <= rawtext[i] && rawtext[i] <= 254 && (64 <= rawtext[i + 1] && rawtext[i + 1] <= 126 || 128 <= rawtext[i + 1] && rawtext[i + 1] <= 254)) {
+                        ++bfchars;
+                        totalfreq += 500L;
+                        row = rawtext[i] - 129;
+                        if (64 <= rawtext[i + 1] && rawtext[i + 1] <= 126) {
+                            column = rawtext[i + 1] - 64;
+                        } else {
+                            column = rawtext[i + 1] - 64;
+                        }
+
+                        if (this.Big5PFreq[row][column] != 0) {
+                            bffreq += (long)this.Big5PFreq[row][column];
+                        }
+                    }
+
+                    ++i;
+                }
+            }
+
+            rangeval = 50.0F * ((float)bfchars / (float)dbchars);
+            freqval = 50.0F * ((float)bffreq / (float)totalfreq);
+            return (int)(rangeval + freqval) - 1;
+        }
+
+        int euc_tw_probability(byte[] rawtext) {
+            int rawtextlen = 0;
+            int dbchars = 1;
+            int cnschars = 1;
+            long cnsfreq = 0L;
+            long totalfreq = 1L;
+            float rangeval = 0.0F;
+            float freqval = 0.0F;
+            rawtextlen = rawtext.length;
+
+            for(int i = 0; i < rawtextlen - 1; ++i) {
+                if (rawtext[i] < 0) {
+                    ++dbchars;
+                    if (i + 3 < rawtextlen && -114 == rawtext[i] && -95 <= rawtext[i + 1] && rawtext[i + 1] <= -80 && -95 <= rawtext[i + 2] && rawtext[i + 2] <= -2 && -95 <= rawtext[i + 3] && rawtext[i + 3] <= -2) {
+                        ++cnschars;
+                        i += 3;
+                    } else if (-95 <= rawtext[i] && rawtext[i] <= -2 && -95 <= rawtext[i + 1] && rawtext[i + 1] <= -2) {
+                        ++cnschars;
+                        totalfreq += 500L;
+                        int row = rawtext[i] + 256 - 161;
+                        int column = rawtext[i + 1] + 256 - 161;
+                        if (this.EUC_TWFreq[row][column] != 0) {
+                            cnsfreq += (long)this.EUC_TWFreq[row][column];
+                        } else if (35 <= row && row <= 92) {
+                            cnsfreq += 150L;
+                        }
+
+                        ++i;
+                    }
+                }
+            }
+
+            rangeval = 50.0F * ((float)cnschars / (float)dbchars);
+            freqval = 50.0F * ((float)cnsfreq / (float)totalfreq);
+            return (int)(rangeval + freqval);
+        }
+
+        int iso_2022_cn_probability(byte[] rawtext) {
+            int rawtextlen = 0;
+            int dbchars = 1;
+            int isochars = 1;
+            long isofreq = 0L;
+            long totalfreq = 1L;
+            float rangeval = 0.0F;
+            float freqval = 0.0F;
+            rawtextlen = rawtext.length;
+
+            for(int i = 0; i < rawtextlen - 1; ++i) {
+                if (rawtext[i] == 27 && i + 3 < rawtextlen) {
+                    int row;
+                    int column;
+                    if (rawtext[i + 1] == 36 && rawtext[i + 2] == 41 && rawtext[i + 3] == 65) {
+                        for(i += 4; rawtext[i] != 27; ++i) {
+                            ++dbchars;
+                            if (33 <= rawtext[i] && rawtext[i] <= 119 && 33 <= rawtext[i + 1] && rawtext[i + 1] <= 119) {
+                                ++isochars;
+                                row = rawtext[i] - 33;
+                                column = rawtext[i + 1] - 33;
+                                totalfreq += 500L;
+                                if (this.GBFreq[row][column] != 0) {
+                                    isofreq += (long)this.GBFreq[row][column];
+                                } else if (15 <= row && row < 55) {
+                                    isofreq += 200L;
+                                }
+
+                                ++i;
+                            }
+                        }
+                    } else if (i + 3 < rawtextlen && rawtext[i + 1] == 36 && rawtext[i + 2] == 41 && rawtext[i + 3] == 71) {
+                        for(i += 4; rawtext[i] != 27; ++i) {
+                            ++dbchars;
+                            if (33 <= rawtext[i] && rawtext[i] <= 126 && 33 <= rawtext[i + 1] && rawtext[i + 1] <= 126) {
+                                ++isochars;
+                                totalfreq += 500L;
+                                row = rawtext[i] - 33;
+                                column = rawtext[i + 1] - 33;
+                                if (this.EUC_TWFreq[row][column] != 0) {
+                                    isofreq += (long)this.EUC_TWFreq[row][column];
+                                } else if (35 <= row && row <= 92) {
+                                    isofreq += 150L;
+                                }
+
+                                ++i;
+                            }
+                        }
+                    }
+
+                    if (rawtext[i] == 27 && i + 2 < rawtextlen && rawtext[i + 1] == 40 && rawtext[i + 2] == 66) {
+                        i += 2;
+                    }
+                }
+            }
+
+            rangeval = 50.0F * ((float)isochars / (float)dbchars);
+            freqval = 50.0F * ((float)isofreq / (float)totalfreq);
+            return (int)(rangeval + freqval);
+        }
+
+        int utf8_probability(byte[] rawtext) {
+            int score = 0;
+            int rawtextlen = 0;
+            int goodbytes = 0;
+            int asciibytes = 0;
+            rawtextlen = rawtext.length;
+
+            for(int i = 0; i < rawtextlen; ++i) {
+                if ((rawtext[i] & 127) == rawtext[i]) {
+                    ++asciibytes;
+                } else if (-64 <= rawtext[i] && rawtext[i] <= -33 && i + 1 < rawtextlen && -128 <= rawtext[i + 1] && rawtext[i + 1] <= -65) {
+                    goodbytes += 2;
+                    ++i;
+                } else if (-32 <= rawtext[i] && rawtext[i] <= -17 && i + 2 < rawtextlen && -128 <= rawtext[i + 1] && rawtext[i + 1] <= -65 && -128 <= rawtext[i + 2] && rawtext[i + 2] <= -65) {
+                    goodbytes += 3;
+                    i += 2;
+                }
+            }
+
+            if (asciibytes == rawtextlen) {
+                return 0;
+            } else {
+                score = (int)(100.0F * ((float)goodbytes / (float)(rawtextlen - asciibytes)));
+                if (score > 98) {
+                    return score;
+                } else if (score > 95 && goodbytes > 30) {
+                    return score;
+                } else {
+                    return 0;
+                }
+            }
+        }
+
+        int utf16_probability(byte[] rawtext) {
+            return (rawtext.length <= 1 || -2 != rawtext[0] || -1 != rawtext[1]) && (-1 != rawtext[0] || -2 != rawtext[1]) ? 0 : 100;
+        }
+
+        int ascii_probability(byte[] rawtext) {
+            int score = 75;
+            int rawtextlen = rawtext.length;
+
+            for(int i = 0; i < rawtextlen; ++i) {
+                if (rawtext[i] < 0) {
+                    score -= 5;
+                } else if (rawtext[i] == 27) {
+                    score -= 5;
+                }
+
+                if (score <= 0) {
+                    return 0;
+                }
+            }
+
+            return score;
+        }
+
+        int euc_kr_probability(byte[] rawtext) {
+            int rawtextlen = 0;
+            int dbchars = 1;
+            int krchars = 1;
+            long krfreq = 0L;
+            long totalfreq = 1L;
+            float rangeval = 0.0F;
+            float freqval = 0.0F;
+            rawtextlen = rawtext.length;
+
+            for(int i = 0; i < rawtextlen - 1; ++i) {
+                if (rawtext[i] < 0) {
+                    ++dbchars;
+                    if (-95 <= rawtext[i] && rawtext[i] <= -2 && -95 <= rawtext[i + 1] && rawtext[i + 1] <= -2) {
+                        ++krchars;
+                        totalfreq += 500L;
+                        int row = rawtext[i] + 256 - 161;
+                        int column = rawtext[i + 1] + 256 - 161;
+                        if (this.KRFreq[row][column] != 0) {
+                            krfreq += (long)this.KRFreq[row][column];
+                        } else if (15 <= row && row < 55) {
+                            krfreq += 0L;
+                        }
+                    }
+
+                    ++i;
+                }
+            }
+
+            rangeval = 50.0F * ((float)krchars / (float)dbchars);
+            freqval = 50.0F * ((float)krfreq / (float)totalfreq);
+            return (int)(rangeval + freqval);
+        }
+
+        int cp949_probability(byte[] rawtext) {
+            int rawtextlen = 0;
+            int dbchars = 1;
+            int krchars = 1;
+            long krfreq = 0L;
+            long totalfreq = 1L;
+            float rangeval = 0.0F;
+            float freqval = 0.0F;
+            rawtextlen = rawtext.length;
+
+            for(int i = 0; i < rawtextlen - 1; ++i) {
+                if (rawtext[i] < 0) {
+                    ++dbchars;
+                    if (-127 <= rawtext[i] && rawtext[i] <= -2 && (65 <= rawtext[i + 1] && rawtext[i + 1] <= 90 || 97 <= rawtext[i + 1] && rawtext[i + 1] <= 122 || -127 <= rawtext[i + 1] && rawtext[i + 1] <= -2)) {
+                        ++krchars;
+                        totalfreq += 500L;
+                        if (-95 <= rawtext[i] && rawtext[i] <= -2 && -95 <= rawtext[i + 1] && rawtext[i + 1] <= -2) {
+                            int row = rawtext[i] + 256 - 161;
+                            int column = rawtext[i + 1] + 256 - 161;
+                            if (this.KRFreq[row][column] != 0) {
+                                krfreq += (long)this.KRFreq[row][column];
+                            }
+                        }
+                    }
+
+                    ++i;
+                }
+            }
+
+            rangeval = 50.0F * ((float)krchars / (float)dbchars);
+            freqval = 50.0F * ((float)krfreq / (float)totalfreq);
+            return (int)(rangeval + freqval);
+        }
+
+        int iso_2022_kr_probability(byte[] rawtext) {
+            for(int i = 0; i < rawtext.length; ++i) {
+                if (i + 3 < rawtext.length && rawtext[i] == 27 && (char)rawtext[i + 1] == '$' && (char)rawtext[i + 2] == ')' && (char)rawtext[i + 3] == 'C') {
+                    return 100;
+                }
+            }
+
+            return 0;
+        }
+
+        int euc_jp_probability(byte[] rawtext) {
+            int rawtextlen = 0;
+            int dbchars = 1;
+            int jpchars = 1;
+            long jpfreq = 0L;
+            long totalfreq = 1L;
+            float rangeval = 0.0F;
+            float freqval = 0.0F;
+            rawtextlen = rawtext.length;
+
+            for(int i = 0; i < rawtextlen - 1; ++i) {
+                if (rawtext[i] < 0) {
+                    ++dbchars;
+                    if (-95 <= rawtext[i] && rawtext[i] <= -2 && -95 <= rawtext[i + 1] && rawtext[i + 1] <= -2) {
+                        ++jpchars;
+                        totalfreq += 500L;
+                        int row = rawtext[i] + 256 - 161;
+                        int column = rawtext[i + 1] + 256 - 161;
+                        if (this.JPFreq[row][column] != 0) {
+                            jpfreq += (long)this.JPFreq[row][column];
+                        } else if (15 <= row && row < 55) {
+                            jpfreq += 0L;
+                        }
+                    }
+
+                    ++i;
+                }
+            }
+
+            rangeval = 50.0F * ((float)jpchars / (float)dbchars);
+            freqval = 50.0F * ((float)jpfreq / (float)totalfreq);
+            return (int)(rangeval + freqval);
+        }
+
+        int iso_2022_jp_probability(byte[] rawtext) {
+            for(int i = 0; i < rawtext.length; ++i) {
+                if (i + 2 < rawtext.length && rawtext[i] == 27 && (char)rawtext[i + 1] == '$' && (char)rawtext[i + 2] == 'B') {
+                    return 100;
+                }
+            }
+
+            return 0;
+        }
+
+        int sjis_probability(byte[] rawtext) {
+            int rawtextlen = 0;
+            int dbchars = 1;
+            int jpchars = 1;
+            long jpfreq = 0L;
+            long totalfreq = 1L;
+            float rangeval = 0.0F;
+            float freqval = 0.0F;
+            rawtextlen = rawtext.length;
+
+            for(int i = 0; i < rawtextlen - 1; ++i) {
+                if (rawtext[i] < 0) {
+                    ++dbchars;
+                    if (i + 1 < rawtext.length && (-127 <= rawtext[i] && rawtext[i] <= -97 || -32 <= rawtext[i] && rawtext[i] <= -17) && (64 <= rawtext[i + 1] && rawtext[i + 1] <= 126 || -128 <= rawtext[i + 1] && rawtext[i + 1] <= -4)) {
+                        ++jpchars;
+                        totalfreq += 500L;
+                        int row = rawtext[i] + 256;
+                        int column = rawtext[i + 1] + 256;
+                        byte adjust;
+                        if (column < 159) {
+                            adjust = 1;
+                            if (column > 127) {
+                                column -= 32;
+                            } else {
+                                column -= 25;
+                            }
+                        } else {
+                            adjust = 0;
+                            column -= 126;
+                        }
+
+                        if (row < 160) {
+                            row = (row - 112 << 1) - adjust;
+                        } else {
+                            row = (row - 176 << 1) - adjust;
+                        }
+
+                        row -= 32;
+                        column = 32;
+                        if (row < this.JPFreq.length && column < this.JPFreq[row].length && this.JPFreq[row][column] != 0) {
+                            jpfreq += (long)this.JPFreq[row][column];
+                        }
+
+                        ++i;
+                    } else if (-95 <= rawtext[i] && rawtext[i] <= -33) {
+                    }
+                }
+            }
+
+            rangeval = 50.0F * ((float)jpchars / (float)dbchars);
+            freqval = 50.0F * ((float)jpfreq / (float)totalfreq);
+            return (int)(rangeval + freqval) - 1;
+        }
+
+        void initialize_frequencies() {
+            // $FF: Couldn't be decompiled
+        }
+    }
+}

+ 99 - 0
src/main/java/com/zglc/fm/utils/ExcelUtils.java

@@ -0,0 +1,99 @@
+package com.zglc.fm.utils;
+
+import com.zglc.fm.exceptions.BusinessException;
+import org.apache.poi.hssf.usermodel.HSSFWorkbook;
+import org.apache.poi.ss.usermodel.*;
+import org.apache.poi.xssf.usermodel.XSSFCell;
+import org.apache.poi.xssf.usermodel.XSSFWorkbook;
+import org.springframework.web.multipart.MultipartFile;
+
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.IOException;
+import java.text.ParseException;
+import java.text.SimpleDateFormat;
+import java.util.Date;
+import java.util.HashMap;
+import java.util.Map;
+
+public class ExcelUtils {
+
+    public static final String XLS = ".xls";
+
+    public static final String XLSX = ".xlsx";
+
+    public static final String DOC = ".doc";
+
+    public static final String DOCX = ".docx";
+
+
+    public static Workbook readExcel(File file) {
+        Workbook workbook = null;
+        try {
+            if (file.getName().endsWith(XLS)) {
+                workbook = new HSSFWorkbook(new FileInputStream(file));
+            } else if (file.getName().endsWith(XLSX)) {
+                workbook = new XSSFWorkbook(new FileInputStream(file));
+            }
+        }catch (IOException e) {
+            throw new BusinessException("解析excel文件错误!"+file.getAbsolutePath(), e);
+        }
+        return workbook;
+    }
+    public static Workbook readExcel(MultipartFile file) {
+        Workbook workbook = null;
+        try {
+            if (file.getOriginalFilename().endsWith(XLS)) {
+                workbook = new HSSFWorkbook(file.getInputStream());
+            } else if (file.getOriginalFilename().endsWith(XLSX)) {
+                workbook = new XSSFWorkbook(file.getInputStream());
+            }
+        }catch (IOException e) {
+            throw new BusinessException("解析excel文件错误!"+file.getOriginalFilename(), e);
+        }
+        return workbook;
+    }
+
+
+    public static Sheet getSheet(Workbook workbook, String sheetName){
+        return workbook.getSheet(sheetName);
+    }
+
+    public static String getCeilValue(Sheet sheet, int rowNum, int colNum){
+        Row row = sheet.getRow(rowNum);
+        Cell cell = row.getCell(colNum);
+        if (cell == null) {
+            return null;
+        }
+        cell.setCellType(Cell.CELL_TYPE_STRING);
+        return cell.getStringCellValue();
+    }
+
+    public static Map<String, Integer> getHeads(Sheet sheet){
+        Row row = sheet.getRow(0);
+        Map<String,Integer> heads = new HashMap<>();
+        for(int i = 0; i < row.getLastCellNum(); i++){
+            heads.put(getCeilValue(sheet, 0 , i), i);
+        }
+        return heads;
+    }
+
+    public static Date getDate(String text) throws ParseException {
+        if (text == null || "".equals(text)){
+            return null;
+        }
+        SimpleDateFormat sdf = new SimpleDateFormat("yyyy/MM/dd");
+        return sdf.parse(text);
+    }
+
+    public static Date getDateValue(Sheet sheet, int rowNum, int colNum){
+        Row row = sheet.getRow(rowNum);
+        Cell cell = row.getCell(colNum);
+        if (cell == null) {
+            return null;
+        }
+        return cell.getDateCellValue();
+    }
+
+
+}

部分文件因为文件数量过多而无法显示