浏览代码

代码推送

xiao547607 4 年之前
当前提交
7664a85c4f
共有 100 个文件被更改,包括 16340 次插入0 次删除
  1. 29 0
      .gitignore
  2. 114 0
      .mvn/wrapper/MavenWrapperDownloader.java
  3. 二进制
      .mvn/wrapper/maven-wrapper.jar
  4. 1 0
      .mvn/wrapper/maven-wrapper.properties
  5. 0 0
      loggerPath_IS_UNDEFINED/logfile.log
  6. 286 0
      mvnw
  7. 161 0
      mvnw.cmd
  8. 311 0
      pom.xml
  9. 20 0
      src/main/java/com/jpsoft/ipcps/BpmApplication.java
  10. 127 0
      src/main/java/com/jpsoft/ipcps/advice/PermissionAdvice.java
  11. 273 0
      src/main/java/com/jpsoft/ipcps/common/Base64.java
  12. 66 0
      src/main/java/com/jpsoft/ipcps/common/DESEncoding.java
  13. 22 0
      src/main/java/com/jpsoft/ipcps/common/MyX509TrustManager.java
  14. 55 0
      src/main/java/com/jpsoft/ipcps/common/PojoUtils.java
  15. 32 0
      src/main/java/com/jpsoft/ipcps/common/Sort.java
  16. 224 0
      src/main/java/com/jpsoft/ipcps/common/WechatUtils.java
  17. 5 0
      src/main/java/com/jpsoft/ipcps/common/WorkflowConstants.java
  18. 10 0
      src/main/java/com/jpsoft/ipcps/configuration/ActivitiConfig.java
  19. 50 0
      src/main/java/com/jpsoft/ipcps/configuration/SwaggerConfig.java
  20. 56 0
      src/main/java/com/jpsoft/ipcps/configuration/WebMvcConfig.java
  21. 193 0
      src/main/java/com/jpsoft/ipcps/controller/AdminRoleController.java
  22. 193 0
      src/main/java/com/jpsoft/ipcps/controller/DepartmentController.java
  23. 673 0
      src/main/java/com/jpsoft/ipcps/controller/JpAdminController.java
  24. 224 0
      src/main/java/com/jpsoft/ipcps/controller/LoginController.java
  25. 276 0
      src/main/java/com/jpsoft/ipcps/controller/MenuController.java
  26. 398 0
      src/main/java/com/jpsoft/ipcps/controller/MessagesController.java
  27. 910 0
      src/main/java/com/jpsoft/ipcps/controller/MonthPlanController.java
  28. 193 0
      src/main/java/com/jpsoft/ipcps/controller/MonthPlanMatterController.java
  29. 286 0
      src/main/java/com/jpsoft/ipcps/controller/OrgController.java
  30. 435 0
      src/main/java/com/jpsoft/ipcps/controller/ParkController.java
  31. 310 0
      src/main/java/com/jpsoft/ipcps/controller/ProcDefController.java
  32. 366 0
      src/main/java/com/jpsoft/ipcps/controller/ProcDefTmplController.java
  33. 290 0
      src/main/java/com/jpsoft/ipcps/controller/ProcDefTmplStepController.java
  34. 1306 0
      src/main/java/com/jpsoft/ipcps/controller/ProcInstController.java
  35. 1407 0
      src/main/java/com/jpsoft/ipcps/controller/ProjectController.java
  36. 447 0
      src/main/java/com/jpsoft/ipcps/controller/ProjectFileController.java
  37. 87 0
      src/main/java/com/jpsoft/ipcps/controller/ProjectImagesController.java
  38. 500 0
      src/main/java/com/jpsoft/ipcps/controller/ProjectPictureController.java
  39. 398 0
      src/main/java/com/jpsoft/ipcps/controller/ProjectQuestionController.java
  40. 130 0
      src/main/java/com/jpsoft/ipcps/controller/ProjectReplyController.java
  41. 354 0
      src/main/java/com/jpsoft/ipcps/controller/ProjectWarningController.java
  42. 312 0
      src/main/java/com/jpsoft/ipcps/controller/RoleController.java
  43. 818 0
      src/main/java/com/jpsoft/ipcps/controller/TaskController.java
  44. 196 0
      src/main/java/com/jpsoft/ipcps/controller/WechatMessageAdminController.java
  45. 273 0
      src/main/java/com/jpsoft/ipcps/controller/WechatMessageController.java
  46. 23 0
      src/main/java/com/jpsoft/ipcps/dao/AdminRoleDAO.java
  47. 23 0
      src/main/java/com/jpsoft/ipcps/dao/DepartmentDAO.java
  48. 30 0
      src/main/java/com/jpsoft/ipcps/dao/JpAdminDAO.java
  49. 23 0
      src/main/java/com/jpsoft/ipcps/dao/MenuDAO.java
  50. 20 0
      src/main/java/com/jpsoft/ipcps/dao/MessagesDAO.java
  51. 20 0
      src/main/java/com/jpsoft/ipcps/dao/MonthPlanDAO.java
  52. 19 0
      src/main/java/com/jpsoft/ipcps/dao/MonthPlanMatterDAO.java
  53. 22 0
      src/main/java/com/jpsoft/ipcps/dao/OrgDAO.java
  54. 21 0
      src/main/java/com/jpsoft/ipcps/dao/ParkAdminDAO.java
  55. 18 0
      src/main/java/com/jpsoft/ipcps/dao/ParkDAO.java
  56. 25 0
      src/main/java/com/jpsoft/ipcps/dao/ParkOrgDAO.java
  57. 26 0
      src/main/java/com/jpsoft/ipcps/dao/ProcDefStepAssigneeDAO.java
  58. 25 0
      src/main/java/com/jpsoft/ipcps/dao/ProcDefStepNoticeDAO.java
  59. 21 0
      src/main/java/com/jpsoft/ipcps/dao/ProcDefStepToDoDAO.java
  60. 21 0
      src/main/java/com/jpsoft/ipcps/dao/ProcDefTemplateDAO.java
  61. 24 0
      src/main/java/com/jpsoft/ipcps/dao/ProcDefTemplateStepDAO.java
  62. 9 0
      src/main/java/com/jpsoft/ipcps/dao/ProcInstDAO.java
  63. 21 0
      src/main/java/com/jpsoft/ipcps/dao/ProcInstStepDAO.java
  64. 20 0
      src/main/java/com/jpsoft/ipcps/dao/ProcInstTemplateDAO.java
  65. 30 0
      src/main/java/com/jpsoft/ipcps/dao/ProcInstToDoDAO.java
  66. 34 0
      src/main/java/com/jpsoft/ipcps/dao/ProjectDAO.java
  67. 18 0
      src/main/java/com/jpsoft/ipcps/dao/ProjectErrorDAO.java
  68. 21 0
      src/main/java/com/jpsoft/ipcps/dao/ProjectFileDAO.java
  69. 18 0
      src/main/java/com/jpsoft/ipcps/dao/ProjectImagesDAO.java
  70. 21 0
      src/main/java/com/jpsoft/ipcps/dao/ProjectPictureDAO.java
  71. 18 0
      src/main/java/com/jpsoft/ipcps/dao/ProjectQuestionDAO.java
  72. 18 0
      src/main/java/com/jpsoft/ipcps/dao/ProjectReplyDAO.java
  73. 23 0
      src/main/java/com/jpsoft/ipcps/dao/ProjectTaskDAO.java
  74. 21 0
      src/main/java/com/jpsoft/ipcps/dao/ProjectWarningDAO.java
  75. 22 0
      src/main/java/com/jpsoft/ipcps/dao/RoleDAO.java
  76. 23 0
      src/main/java/com/jpsoft/ipcps/dao/RoleMenuDAO.java
  77. 20 0
      src/main/java/com/jpsoft/ipcps/dao/WechatMessageAdminDAO.java
  78. 20 0
      src/main/java/com/jpsoft/ipcps/dao/WechatMessageDAO.java
  79. 51 0
      src/main/java/com/jpsoft/ipcps/dto/MessageResult.java
  80. 66 0
      src/main/java/com/jpsoft/ipcps/dto/ProcDefStepDTO.java
  81. 61 0
      src/main/java/com/jpsoft/ipcps/dto/StartProcessDTO.java
  82. 80 0
      src/main/java/com/jpsoft/ipcps/dto/TaskRequestDTO.java
  83. 88 0
      src/main/java/com/jpsoft/ipcps/dto/TaskResponseDTO.java
  84. 68 0
      src/main/java/com/jpsoft/ipcps/entity/AccessToken.java
  85. 87 0
      src/main/java/com/jpsoft/ipcps/entity/AdminRole.java
  86. 71 0
      src/main/java/com/jpsoft/ipcps/entity/Department.java
  87. 371 0
      src/main/java/com/jpsoft/ipcps/entity/JpAdmin.java
  88. 222 0
      src/main/java/com/jpsoft/ipcps/entity/Menu.java
  89. 185 0
      src/main/java/com/jpsoft/ipcps/entity/Messages.java
  90. 183 0
      src/main/java/com/jpsoft/ipcps/entity/MonthPlan.java
  91. 85 0
      src/main/java/com/jpsoft/ipcps/entity/MonthPlanMatter.java
  92. 89 0
      src/main/java/com/jpsoft/ipcps/entity/Org.java
  93. 214 0
      src/main/java/com/jpsoft/ipcps/entity/Park.java
  94. 71 0
      src/main/java/com/jpsoft/ipcps/entity/ParkAdmin.java
  95. 57 0
      src/main/java/com/jpsoft/ipcps/entity/ParkOrg.java
  96. 140 0
      src/main/java/com/jpsoft/ipcps/entity/ProcDefStepAssignee.java
  97. 140 0
      src/main/java/com/jpsoft/ipcps/entity/ProcDefStepNotice.java
  98. 140 0
      src/main/java/com/jpsoft/ipcps/entity/ProcDefStepToDo.java
  99. 150 0
      src/main/java/com/jpsoft/ipcps/entity/ProcDefTemplate.java
  100. 186 0
      src/main/java/com/jpsoft/ipcps/entity/ProcDefTemplateStep.java

+ 29 - 0
.gitignore

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

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

@@ -0,0 +1,114 @@
+/*
+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.
+*/
+
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.net.URL;
+import java.nio.channels.Channels;
+import java.nio.channels.ReadableByteChannel;
+import java.util.Properties;
+
+public class MavenWrapperDownloader {
+
+    /**
+     * 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/0.4.2/maven-wrapper-0.4.2.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 direcrory '" + 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 {
+        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


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

@@ -0,0 +1 @@
+distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.6.0/apache-maven-3.6.0-bin.zip

+ 0 - 0
loggerPath_IS_UNDEFINED/logfile.log


+ 286 - 0
mvnw

@@ -0,0 +1,286 @@
+#!/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.
+# ----------------------------------------------------------------------------
+
+# ----------------------------------------------------------------------------
+# Maven2 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)`"
+  # TODO classpath?
+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
+    jarUrl="https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.4.2/maven-wrapper-0.4.2.jar"
+    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 command -v wget > /dev/null; then
+        if [ "$MVNW_VERBOSE" = true ]; then
+          echo "Found wget ... using wget"
+        fi
+        wget "$jarUrl" -O "$wrapperJarPath"
+    elif command -v curl > /dev/null; then
+        if [ "$MVNW_VERBOSE" = true ]; then
+          echo "Found curl ... using curl"
+        fi
+        curl -o "$wrapperJarPath" "$jarUrl"
+    else
+        if [ "$MVNW_VERBOSE" = true ]; then
+          echo "Falling back to using Java to download"
+        fi
+        javaClass="$BASE_DIR/.mvn/wrapper/MavenWrapperDownloader.java"
+        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
+
+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 "$@"

+ 161 - 0
mvnw.cmd

@@ -0,0 +1,161 @@
+@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 Maven2 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 key stroke 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 my 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.4.2/maven-wrapper-0.4.2.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% (
+    echo Found %WRAPPER_JAR%
+) else (
+    echo Couldn't find %WRAPPER_JAR%, downloading it ...
+	echo Downloading from: %DOWNLOAD_URL%
+    powershell -Command "(New-Object Net.WebClient).DownloadFile('%DOWNLOAD_URL%', '%WRAPPER_JAR%')"
+    echo Finished downloading %WRAPPER_JAR%
+)
+@REM End of extension
+
+%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%

+ 311 - 0
pom.xml

@@ -0,0 +1,311 @@
+<?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 http://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.1.3.RELEASE</version>
+        <relativePath/> <!-- lookup parent from repository -->
+    </parent>
+    <groupId>com.jpsoft.ipcps</groupId>
+    <artifactId>ipcps-restful</artifactId>
+    <version>0.0.1-SNAPSHOT</version>
+    <packaging>war</packaging>
+    <name>ipcps-restful</name>
+    <description>Demo project for Spring Boot</description>
+
+    <properties>
+        <java.version>1.8</java.version>
+        <activiti.version>5.22.0</activiti.version>
+    </properties>
+
+    <dependencies>
+        <dependency>
+            <groupId>org.springframework.boot</groupId>
+            <artifactId>spring-boot-starter-web</artifactId>
+            <exclusions>
+                <exclusion>
+                    <groupId>org.springframework.boot</groupId>
+                    <artifactId>spring-boot-starter-tomcat</artifactId>
+                </exclusion>
+            </exclusions>
+        </dependency>
+
+        <dependency>
+            <groupId>com.alibaba</groupId>
+            <artifactId>druid-spring-boot-starter</artifactId>
+            <version>1.1.10</version>
+        </dependency>
+
+        <dependency>
+            <groupId>org.mybatis.spring.boot</groupId>
+            <artifactId>mybatis-spring-boot-starter</artifactId>
+            <version>2.0.0</version>
+        </dependency>
+
+        <dependency>
+            <groupId>com.github.pagehelper</groupId>
+            <artifactId>pagehelper-spring-boot-starter</artifactId>
+            <version>LATEST</version>
+        </dependency>
+
+        <dependency>
+            <groupId>org.springframework.boot</groupId>
+            <artifactId>spring-boot-devtools</artifactId>
+            <scope>runtime</scope>
+            <optional>true</optional>
+        </dependency>
+        <dependency>
+            <groupId>org.springframework.boot</groupId>
+            <artifactId>spring-boot-starter-test</artifactId>
+            <scope>test</scope>
+        </dependency>
+
+        <dependency>
+            <groupId>net.sf.json-lib</groupId>
+            <artifactId>json-lib</artifactId>
+            <version>2.4</version>
+            <classifier>jdk15</classifier>
+        </dependency>
+
+        <!-- 工作流 start-->
+        <dependency>
+            <groupId>org.activiti</groupId>
+            <artifactId>activiti-engine</artifactId>
+            <version>${activiti.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.activiti</groupId>
+            <artifactId>activiti-spring</artifactId>
+            <version>${activiti.version}</version>
+        </dependency>
+        <!-- 工作流 end -->
+        <dependency>
+            <groupId>joda-time</groupId>
+            <artifactId>joda-time</artifactId>
+            <version>2.3</version>
+        </dependency>
+        <dependency>
+            <groupId>mysql</groupId>
+            <artifactId>mysql-connector-java</artifactId>
+            <scope>runtime</scope>
+        </dependency>
+
+        <!--logging start-->
+        <dependency>
+            <groupId>org.springframework.boot</groupId>
+            <artifactId>spring-boot-starter-logging</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.lazyluke</groupId>
+            <artifactId>log4jdbc-remix</artifactId>
+            <version>0.2.7</version>
+        </dependency>
+        <!--logging end-->
+
+        <!--jwt start-->
+        <dependency>
+            <groupId>io.jsonwebtoken</groupId>
+            <artifactId>jjwt-api</artifactId>
+            <version>0.10.5</version>
+        </dependency>
+        <dependency>
+            <groupId>io.jsonwebtoken</groupId>
+            <artifactId>jjwt-impl</artifactId>
+            <version>0.10.5</version>
+            <scope>runtime</scope>
+        </dependency>
+        <dependency>
+            <groupId>io.jsonwebtoken</groupId>
+            <artifactId>jjwt-jackson</artifactId>
+            <version>0.10.5</version>
+            <scope>runtime</scope>
+        </dependency>
+        <!--jwt end-->
+
+        <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>
+
+        <!-- 读取xml start -->
+        <dependency>
+            <groupId>dom4j</groupId>
+            <artifactId>dom4j</artifactId>
+            <version>1.6.1</version>
+            <scope>compile</scope>
+        </dependency>
+        <dependency>
+            <groupId>jaxen</groupId>
+            <artifactId>jaxen</artifactId>
+            <version>1.1.4</version>
+            <type>jar</type>
+            <scope>compile</scope>
+        </dependency>
+        <!-- 读取xml end -->
+
+        <dependency>
+            <groupId>com.aliyun.oss</groupId>
+            <artifactId>aliyun-sdk-oss</artifactId>
+            <version>3.0.0</version>
+        </dependency>
+
+        <dependency>
+            <groupId>org.springframework.boot</groupId>
+            <artifactId>spring-boot-starter-aop</artifactId>
+        </dependency>
+
+        <dependency>
+            <groupId>de.codecentric</groupId>
+            <artifactId>spring-boot-admin-starter-client</artifactId>
+            <version>2.1.5</version>
+        </dependency>
+        <!--poi-->
+        <dependency>
+            <groupId>org.apache.poi</groupId>
+            <artifactId>poi</artifactId>
+            <version>4.1.0</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.poi</groupId>
+            <artifactId>poi-ooxml</artifactId>
+            <version>4.1.0</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.poi</groupId>
+            <artifactId>poi-scratchpad</artifactId>
+            <version>4.1.0</version>
+        </dependency>
+    </dependencies>
+    <build>
+        <finalName>${project.name}</finalName>
+        <plugins>
+            <plugin>
+                <groupId>org.springframework.boot</groupId>
+                <artifactId>spring-boot-maven-plugin</artifactId>
+                <configuration>
+                    <fork>true</fork>
+                    <addResources>true</addResources>
+                </configuration>
+            </plugin>
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-surefire-plugin</artifactId>
+                <version>2.16</version>
+                <configuration>
+                    <includes>
+                        <include>**/*TestForPack.java</include>
+                    </includes>
+                    <argLine>-Xmx256M</argLine>
+                </configuration>
+                <dependencies>
+                    <dependency>
+                        <groupId>org.apache.maven.surefire</groupId>
+                        <artifactId>surefire-junit47</artifactId>
+                        <version>2.16</version>
+                    </dependency>
+                </dependencies>
+            </plugin>
+            <!-- resources插件 -->
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-resources-plugin</artifactId>
+                <version>2.6</version>
+            </plugin>
+        </plugins>
+        <resources>
+            <resource>
+                <directory>src/main/resources/</directory>
+                <filtering>true</filtering>
+                <includes>
+                    <include>**/*.properties</include>
+                </includes>
+            </resource>
+            <resource>
+                <directory>src/main/resources/</directory>
+                <filtering>true</filtering>
+                <includes>
+                    <include>**/*.xml</include>
+                </includes>
+            </resource>
+            <resource>
+                <directory>src/main/resources/</directory>
+                <filtering>true</filtering>
+                <includes>
+                    <include>**/*.yml</include>
+                </includes>
+            </resource>
+            <resource>
+                <directory>src/main/resources</directory>
+                <filtering>true</filtering>
+                <excludes>
+                    <exclude>**/*.xlsx</exclude>
+                </excludes>
+            </resource>
+            <resource>
+                <directory>src/main/resources</directory>
+                <filtering>false</filtering>
+                <includes>
+                    <include>**/*.xlsx</include>
+                </includes>
+            </resource>
+        </resources>
+    </build>
+    <profiles>
+        <profile>
+            <id>dev</id>
+            <dependencies>
+                <dependency>
+                    <groupId>org.springframework.boot</groupId>
+                    <artifactId>spring-boot-starter-tomcat</artifactId>
+                </dependency>
+            </dependencies>
+            <activation>
+                <activeByDefault>true</activeByDefault>
+            </activation>
+            <properties>
+                <active.profile>dev</active.profile>
+                <oosUrl>http://58.54.251.155:8088/wzzgh-upload</oosUrl>
+                <uploadUrl>http://58.54.251.155:8088/wzzgh-upload</uploadUrl>
+            </properties>
+        </profile>
+        <profile>
+            <id>test</id>
+            <dependencies>
+                <dependency>
+                    <groupId>org.springframework.boot</groupId>
+                    <artifactId>spring-boot-starter-tomcat</artifactId>
+                    <scope>provided</scope>
+                </dependency>
+            </dependencies>
+            <properties>
+                <active.profile>test</active.profile>
+                <oosUrl>http://58.54.251.155:8088/wzzgh-upload</oosUrl>
+                <uploadUrl>http://58.54.251.155:8088/wzzgh-upload</uploadUrl>
+            </properties>
+        </profile>
+        <profile>
+            <id>production</id>
+            <dependencies>
+                <dependency>
+                    <groupId>org.springframework.boot</groupId>
+                    <artifactId>spring-boot-starter-tomcat</artifactId>
+                    <scope>provided</scope>
+                </dependency>
+            </dependencies>
+            <properties>
+                <active.profile>production</active.profile>
+                <oosUrl>http://gyxm.jing-zhou.gov.cn/wzzgh-upload</oosUrl>
+                <uploadUrl>http://127.0.0.1:8080/wzzgh-upload</uploadUrl>
+            </properties>
+        </profile>
+    </profiles>
+</project>

+ 20 - 0
src/main/java/com/jpsoft/ipcps/BpmApplication.java

@@ -0,0 +1,20 @@
+package com.jpsoft.ipcps;
+
+import org.mybatis.spring.annotation.MapperScan;
+import org.springframework.boot.SpringApplication;
+import org.springframework.boot.autoconfigure.SpringBootApplication;
+import org.springframework.boot.builder.SpringApplicationBuilder;
+import org.springframework.boot.web.servlet.support.SpringBootServletInitializer;
+
+@SpringBootApplication
+@MapperScan("com.jpsoft.ipcps.dao")
+public class BpmApplication extends SpringBootServletInitializer {
+	public static void main(String[] args) {
+		SpringApplication.run(BpmApplication.class, args);
+	}
+
+	@Override
+	protected SpringApplicationBuilder configure(SpringApplicationBuilder builder) {
+		return builder.sources(BpmApplication.class);
+	}
+}

+ 127 - 0
src/main/java/com/jpsoft/ipcps/advice/PermissionAdvice.java

@@ -0,0 +1,127 @@
+package com.jpsoft.ipcps.advice;
+
+import com.jpsoft.ipcps.dto.MessageResult;
+import com.jpsoft.ipcps.service.MenuService;
+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.aspectj.lang.reflect.MethodSignature;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.context.annotation.Profile;
+import org.springframework.stereotype.Component;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.context.request.RequestContextHolder;
+import org.springframework.web.context.request.ServletRequestAttributes;
+
+import javax.servlet.http.HttpServletRequest;
+import java.lang.reflect.Method;
+
+@Aspect
+@Component
+//@Profile("dev")
+public class PermissionAdvice {
+    private  Logger logger= LoggerFactory.getLogger("root");
+
+    @Autowired
+    private MenuService menuService;
+
+    @Pointcut("(execution(public * com.jpsoft.ipcps..controller.*.*(..)))")
+    public void pointcut(){
+
+    }
+
+    @Around("pointcut()")
+    public Object around(ProceedingJoinPoint point) throws Throwable {
+        long start = System.currentTimeMillis();
+
+        String classType = point.getTarget().getClass().getName();
+        Class<?> clazz = Class.forName(classType);
+        String clazzName = clazz.getName();
+        String clazzSimpleName = clazz.getSimpleName();
+        String methodName = point.getSignature().getName();
+
+        // 通过正则表达式判断当前url是否符合
+        //PathMatcher matcher = new AntPathMatcher();
+
+        StringBuilder pathBuilder = new StringBuilder();
+
+        //查询类的RequestMapping注解
+        RequestMapping classMapping = clazz.getAnnotation(RequestMapping.class);
+
+        if(classMapping != null && classMapping.value().length>0){
+            pathBuilder.append(classMapping.value()[0]);
+        }
+
+        //查询方法的RequestMapping注解
+        MethodSignature methodSignature = (MethodSignature)point.getSignature();
+        Method method = methodSignature.getMethod();
+
+        RequestMapping methodMapping = method.getAnnotation(RequestMapping.class);
+
+        if(methodMapping != null && methodMapping.value().length>0){
+            String subPath = methodMapping.value()[0];
+
+            if(!subPath.startsWith("/")){
+                pathBuilder.append("/");
+            }
+
+            pathBuilder.append(subPath);
+        }
+
+        logger.warn("request mapping path:" + pathBuilder.toString());
+
+        ServletRequestAttributes requestAttrs = (ServletRequestAttributes) RequestContextHolder.getRequestAttributes();
+
+        Object obj = null;
+
+        if(requestAttrs!=null) {
+            HttpServletRequest request = requestAttrs.getRequest();
+            logger.warn("访问地址:" + request.getRequestURL().toString());
+
+            String userId = (String)request.getAttribute("subject");
+
+            boolean existed = menuService.existByUrl(pathBuilder.toString(), request.getMethod());
+
+            String fullUrl = request.getMethod() + " " + pathBuilder.toString();
+
+            // 查询该url是否加入到权限控制中,如果是则查询当前用户是否能访问该url
+            if (existed) {
+                logger.warn(fullUrl + "已加入权限控制");
+
+                boolean permitted = menuService.hasPermitted(userId, pathBuilder.toString(), request.getMethod());
+                logger.warn("是否许可当前用户"+ userId + "访问:" + permitted);
+
+                if(permitted){
+                    // 执行切入方法
+                    obj = point.proceed();
+                }
+                else{
+                    MessageResult<String> msgResult = new MessageResult<>();
+                    msgResult.setResult(false);
+                    msgResult.setMessage(fullUrl + "未授权当前用户访问!");
+
+                    obj = msgResult;
+                }
+            }
+            else{
+                logger.info(fullUrl + "未加入权限控制");
+
+                // 执行切入方法
+                obj = point.proceed();
+            }
+        }
+        else{
+            obj = point.proceed();
+        }
+
+        long elapse = System.currentTimeMillis() - start;
+
+        System.out.println(classType);
+        logger.warn(String.format("调用类%s方法%s耗时%s毫秒",clazzSimpleName,methodName,elapse));
+
+        return obj;
+    }
+}

+ 273 - 0
src/main/java/com/jpsoft/ipcps/common/Base64.java

@@ -0,0 +1,273 @@
+package com.jpsoft.ipcps.common;
+
+public final class Base64 {
+
+    static private final int     BASELENGTH           = 128;
+    static private final int     LOOKUPLENGTH         = 64;
+    static private final int     TWENTYFOURBITGROUP   = 24;
+    static private final int     EIGHTBIT             = 8;
+    static private final int     SIXTEENBIT           = 16;
+    static private final int     FOURBYTE             = 4;
+    static private final int     SIGN                 = -128;
+    static private final char    PAD                  = '=';
+    static private final boolean fDebug               = false;
+    static final private byte[]  base64Alphabet       = new byte[BASELENGTH];
+    static final private char[]  lookUpBase64Alphabet = new char[LOOKUPLENGTH];
+
+    static {
+        for (int i = 0; i < BASELENGTH; ++i) {
+            base64Alphabet[i] = -1;
+        }
+        for (int i = 'Z'; i >= 'A'; i--) {
+            base64Alphabet[i] = (byte) (i - 'A');
+        }
+        for (int i = 'z'; i >= 'a'; i--) {
+            base64Alphabet[i] = (byte) (i - 'a' + 26);
+        }
+
+        for (int i = '9'; i >= '0'; i--) {
+            base64Alphabet[i] = (byte) (i - '0' + 52);
+        }
+
+        base64Alphabet['+'] = 62;
+        base64Alphabet['/'] = 63;
+
+        for (int i = 0; i <= 25; i++) {
+            lookUpBase64Alphabet[i] = (char) ('A' + i);
+        }
+
+        for (int i = 26, j = 0; i <= 51; i++, j++) {
+            lookUpBase64Alphabet[i] = (char) ('a' + j);
+        }
+
+        for (int i = 52, j = 0; i <= 61; i++, j++) {
+            lookUpBase64Alphabet[i] = (char) ('0' + j);
+        }
+        lookUpBase64Alphabet[62] = (char) '+';
+        lookUpBase64Alphabet[63] = (char) '/';
+
+    }
+
+    private static boolean isWhiteSpace(char octect) {
+        return (octect == 0x20 || octect == 0xd || octect == 0xa || octect == 0x9);
+    }
+
+    private static boolean isPad(char octect) {
+        return (octect == PAD);
+    }
+
+    private static boolean isData(char octect) {
+        return (octect < BASELENGTH && base64Alphabet[octect] != -1);
+    }
+
+    /**
+     * Encodes hex octects into Base64
+     *
+     * @param binaryData Array containing binaryData
+     * @return Encoded Base64 array
+     */
+    public static String encode(byte[] binaryData) {
+
+        if (binaryData == null) {
+            return null;
+        }
+
+        int lengthDataBits = binaryData.length * EIGHTBIT;
+        if (lengthDataBits == 0) {
+            return "";
+        }
+
+        int fewerThan24bits = lengthDataBits % TWENTYFOURBITGROUP;
+        int numberTriplets = lengthDataBits / TWENTYFOURBITGROUP;
+        int numberQuartet = fewerThan24bits != 0 ? numberTriplets + 1 : numberTriplets;
+        char encodedData[] = null;
+
+        encodedData = new char[numberQuartet * 4];
+
+        byte k = 0, l = 0, b1 = 0, b2 = 0, b3 = 0;
+
+        int encodedIndex = 0;
+        int dataIndex = 0;
+        if (fDebug) {
+            System.out.println("number of triplets = " + numberTriplets);
+        }
+
+        for (int i = 0; i < numberTriplets; i++) {
+            b1 = binaryData[dataIndex++];
+            b2 = binaryData[dataIndex++];
+            b3 = binaryData[dataIndex++];
+
+            if (fDebug) {
+                System.out.println("b1= " + b1 + ", b2= " + b2 + ", b3= " + b3);
+            }
+
+            l = (byte) (b2 & 0x0f);
+            k = (byte) (b1 & 0x03);
+
+            byte val1 = ((b1 & SIGN) == 0) ? (byte) (b1 >> 2) : (byte) ((b1) >> 2 ^ 0xc0);
+            byte val2 = ((b2 & SIGN) == 0) ? (byte) (b2 >> 4) : (byte) ((b2) >> 4 ^ 0xf0);
+            byte val3 = ((b3 & SIGN) == 0) ? (byte) (b3 >> 6) : (byte) ((b3) >> 6 ^ 0xfc);
+
+            if (fDebug) {
+                System.out.println("val2 = " + val2);
+                System.out.println("k4   = " + (k << 4));
+                System.out.println("vak  = " + (val2 | (k << 4)));
+            }
+
+            encodedData[encodedIndex++] = lookUpBase64Alphabet[val1];
+            encodedData[encodedIndex++] = lookUpBase64Alphabet[val2 | (k << 4)];
+            encodedData[encodedIndex++] = lookUpBase64Alphabet[(l << 2) | val3];
+            encodedData[encodedIndex++] = lookUpBase64Alphabet[b3 & 0x3f];
+        }
+
+        // form integral number of 6-bit groups
+        if (fewerThan24bits == EIGHTBIT) {
+            b1 = binaryData[dataIndex];
+            k = (byte) (b1 & 0x03);
+            if (fDebug) {
+                System.out.println("b1=" + b1);
+                System.out.println("b1<<2 = " + (b1 >> 2));
+            }
+            byte val1 = ((b1 & SIGN) == 0) ? (byte) (b1 >> 2) : (byte) ((b1) >> 2 ^ 0xc0);
+            encodedData[encodedIndex++] = lookUpBase64Alphabet[val1];
+            encodedData[encodedIndex++] = lookUpBase64Alphabet[k << 4];
+            encodedData[encodedIndex++] = PAD;
+            encodedData[encodedIndex++] = PAD;
+        } else if (fewerThan24bits == SIXTEENBIT) {
+            b1 = binaryData[dataIndex];
+            b2 = binaryData[dataIndex + 1];
+            l = (byte) (b2 & 0x0f);
+            k = (byte) (b1 & 0x03);
+
+            byte val1 = ((b1 & SIGN) == 0) ? (byte) (b1 >> 2) : (byte) ((b1) >> 2 ^ 0xc0);
+            byte val2 = ((b2 & SIGN) == 0) ? (byte) (b2 >> 4) : (byte) ((b2) >> 4 ^ 0xf0);
+
+            encodedData[encodedIndex++] = lookUpBase64Alphabet[val1];
+            encodedData[encodedIndex++] = lookUpBase64Alphabet[val2 | (k << 4)];
+            encodedData[encodedIndex++] = lookUpBase64Alphabet[l << 2];
+            encodedData[encodedIndex++] = PAD;
+        }
+
+        return new String(encodedData);
+    }
+
+    /**
+     * Decodes Base64 data into octects
+     *
+     * @param encoded string containing Base64 data
+     * @return Array containind decoded data.
+     */
+    public static byte[] decode(String encoded) {
+
+        if (encoded == null) {
+            return null;
+        }
+
+        char[] base64Data = encoded.toCharArray();
+        // remove white spaces
+        int len = removeWhiteSpace(base64Data);
+
+        if (len % FOURBYTE != 0) {
+            return null;//should be divisible by four
+        }
+
+        int numberQuadruple = (len / FOURBYTE);
+
+        if (numberQuadruple == 0) {
+            return new byte[0];
+        }
+
+        byte decodedData[] = null;
+        byte b1 = 0, b2 = 0, b3 = 0, b4 = 0;
+        char d1 = 0, d2 = 0, d3 = 0, d4 = 0;
+
+        int i = 0;
+        int encodedIndex = 0;
+        int dataIndex = 0;
+        decodedData = new byte[(numberQuadruple) * 3];
+
+        for (; i < numberQuadruple - 1; i++) {
+
+            if (!isData((d1 = base64Data[dataIndex++])) || !isData((d2 = base64Data[dataIndex++]))
+                    || !isData((d3 = base64Data[dataIndex++]))
+                    || !isData((d4 = base64Data[dataIndex++]))) {
+                return null;
+            }//if found "no data" just return null
+
+            b1 = base64Alphabet[d1];
+            b2 = base64Alphabet[d2];
+            b3 = base64Alphabet[d3];
+            b4 = base64Alphabet[d4];
+
+            decodedData[encodedIndex++] = (byte) (b1 << 2 | b2 >> 4);
+            decodedData[encodedIndex++] = (byte) (((b2 & 0xf) << 4) | ((b3 >> 2) & 0xf));
+            decodedData[encodedIndex++] = (byte) (b3 << 6 | b4);
+        }
+
+        if (!isData((d1 = base64Data[dataIndex++])) || !isData((d2 = base64Data[dataIndex++]))) {
+            return null;//if found "no data" just return null
+        }
+
+        b1 = base64Alphabet[d1];
+        b2 = base64Alphabet[d2];
+
+        d3 = base64Data[dataIndex++];
+        d4 = base64Data[dataIndex++];
+        if (!isData((d3)) || !isData((d4))) {//Check if they are PAD characters
+            if (isPad(d3) && isPad(d4)) {
+                if ((b2 & 0xf) != 0)//last 4 bits should be zero
+                {
+                    return null;
+                }
+                byte[] tmp = new byte[i * 3 + 1];
+                System.arraycopy(decodedData, 0, tmp, 0, i * 3);
+                tmp[encodedIndex] = (byte) (b1 << 2 | b2 >> 4);
+                return tmp;
+            } else if (!isPad(d3) && isPad(d4)) {
+                b3 = base64Alphabet[d3];
+                if ((b3 & 0x3) != 0)//last 2 bits should be zero
+                {
+                    return null;
+                }
+                byte[] tmp = new byte[i * 3 + 2];
+                System.arraycopy(decodedData, 0, tmp, 0, i * 3);
+                tmp[encodedIndex++] = (byte) (b1 << 2 | b2 >> 4);
+                tmp[encodedIndex] = (byte) (((b2 & 0xf) << 4) | ((b3 >> 2) & 0xf));
+                return tmp;
+            } else {
+                return null;
+            }
+        } else { //No PAD e.g 3cQl
+            b3 = base64Alphabet[d3];
+            b4 = base64Alphabet[d4];
+            decodedData[encodedIndex++] = (byte) (b1 << 2 | b2 >> 4);
+            decodedData[encodedIndex++] = (byte) (((b2 & 0xf) << 4) | ((b3 >> 2) & 0xf));
+            decodedData[encodedIndex++] = (byte) (b3 << 6 | b4);
+
+        }
+
+        return decodedData;
+    }
+
+    /**
+     * remove WhiteSpace from MIME containing encoded Base64 data.
+     *
+     * @param data  the byte array of base64 data (with WS)
+     * @return      the new length
+     */
+    private static int removeWhiteSpace(char[] data) {
+        if (data == null) {
+            return 0;
+        }
+
+        // count characters that's not whitespace
+        int newSize = 0;
+        int len = data.length;
+        for (int i = 0; i < len; i++) {
+            if (!isWhiteSpace(data[i])) {
+                data[newSize++] = data[i];
+            }
+        }
+        return newSize;
+    }
+}

+ 66 - 0
src/main/java/com/jpsoft/ipcps/common/DESEncoding.java

@@ -0,0 +1,66 @@
+package com.jpsoft.ipcps.common;
+
+import java.security.SecureRandom;
+
+import javax.crypto.Cipher;
+import javax.crypto.SecretKey;
+import javax.crypto.SecretKeyFactory;
+import javax.crypto.spec.DESKeySpec;
+
+
+public class DESEncoding {
+    /**
+     * 长度必须是8的倍数
+     */
+    public static String DEFAULT_KEY = "jpsoft";
+    /**
+     *
+     * @param key /密码,长度要是8的倍数
+     * @param plainText
+     * @return
+     * @throws Exception
+     */
+    public String encode(String key,String plainText) throws Exception{
+        String encText = null;
+
+        SecureRandom random = new SecureRandom();
+        DESKeySpec desKey = new DESKeySpec(key.getBytes("UTF-8"));
+        //创建一个密匙工厂,然后用它把DESKeySpec转换成
+        SecretKeyFactory keyFactory = SecretKeyFactory.getInstance("DES");
+        SecretKey securekey = keyFactory.generateSecret(desKey);
+        //Cipher对象实际完成加密操作
+        Cipher cipher = Cipher.getInstance("DES");
+        //用密匙初始化Cipher对象
+        cipher.init(Cipher.ENCRYPT_MODE, securekey, random);
+        //现在,获取数据并加密
+        //正式执行加密操作
+        byte[] buffer = cipher.doFinal(plainText.getBytes("UTF-8"));
+
+        encText = Base64.encode(buffer);
+
+        return encText;
+    }
+
+    public String decode(String key,String encText) throws Exception{
+        byte[] encBuffer = Base64.decode(encText);
+
+        // DES算法要求有一个可信任的随机数源
+        SecureRandom random = new SecureRandom();
+        // 创建一个DESKeySpec对象
+        DESKeySpec desKey = new DESKeySpec(key.getBytes("UTF-8"));
+        // 创建一个密匙工厂
+        SecretKeyFactory keyFactory = SecretKeyFactory.getInstance("DES");
+        // 将DESKeySpec对象转换成SecretKey对象
+        SecretKey securekey = keyFactory.generateSecret(desKey);
+        // Cipher对象实际完成解密操作
+        Cipher cipher = Cipher.getInstance("DES");
+        // 用密匙初始化Cipher对象
+        cipher.init(Cipher.DECRYPT_MODE, securekey, random);
+        // 真正开始解密操作
+        byte[] buffer = cipher.doFinal(encBuffer);
+
+        String plainText =  new String(buffer,"UTF-8");
+
+        return plainText;
+    }
+}

+ 22 - 0
src/main/java/com/jpsoft/ipcps/common/MyX509TrustManager.java

@@ -0,0 +1,22 @@
+package com.jpsoft.ipcps.common;
+
+import java.security.cert.CertificateException;
+import java.security.cert.X509Certificate;
+
+import javax.net.ssl.X509TrustManager;
+
+/**
+ * 证书信任管理器(用于https请求)
+ */
+public class MyX509TrustManager implements X509TrustManager {
+
+    public void checkClientTrusted(X509Certificate[] chain, String authType) throws CertificateException {
+    }
+
+    public void checkServerTrusted(X509Certificate[] chain, String authType) throws CertificateException {
+    }
+
+    public X509Certificate[] getAcceptedIssuers() {
+        return null;
+    }
+}

+ 55 - 0
src/main/java/com/jpsoft/ipcps/common/PojoUtils.java

@@ -0,0 +1,55 @@
+package com.jpsoft.ipcps.common;
+
+import com.github.pagehelper.Page;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import java.beans.BeanInfo;
+import java.beans.Introspector;
+import java.beans.PropertyDescriptor;
+import java.util.HashMap;
+import java.util.Map;
+
+public class PojoUtils {
+    private static Logger logger = LoggerFactory.getLogger("root");
+
+    public static <T> Map<String, Object> pojo2map(T t) {
+        // TODO Auto-generated method stub
+        Map<String,Object> map = new HashMap<String,Object>();
+
+        try{
+            BeanInfo beanInfo  = Introspector.getBeanInfo(t.getClass());
+            PropertyDescriptor[] props = beanInfo.getPropertyDescriptors();
+
+            for (PropertyDescriptor pd : props) {
+                if (pd.getReadMethod()!=null) {
+                    try {
+                        Object srcValue = pd.getReadMethod().invoke(t);
+                        map.put(pd.getName(), srcValue);
+                    }
+                    catch (Exception ex){
+                        logger.error(ex.getMessage(),ex);
+                    }
+                }
+            }
+        }
+        catch(Exception ex){
+            ex.printStackTrace();
+        }
+
+        return map;
+    }
+
+    public static Map pageWrapper(Page page){
+        Map<String,Object> pageMap = new HashMap<>();
+
+        pageMap.put("recordsTotal",page.getTotal());
+        pageMap.put("recordsFiltered",page.getTotal());
+        pageMap.put("totalPage",page.getPages());
+        pageMap.put("pageNumber",page.getPageNum());
+        pageMap.put("pageSize",page.getPageSize());
+        pageMap.put("data", page.getResult());
+
+        return pageMap;
+    }
+}

+ 32 - 0
src/main/java/com/jpsoft/ipcps/common/Sort.java

@@ -0,0 +1,32 @@
+package com.jpsoft.ipcps.common;
+
+import java.io.Serializable;
+
+public class Sort implements Serializable {
+    private String name;
+    private String order;
+
+    public String getName() {
+        return name;
+    }
+
+    public void setName(String name) {
+        this.name = name;
+    }
+
+    public String getOrder() {
+        return order;
+    }
+
+    public void setOrder(String order) {
+        this.order = order;
+    }
+
+    public Sort() {
+    }
+
+    public Sort(String name, String order) {
+        this.name = name;
+        this.order = order;
+    }
+}

+ 224 - 0
src/main/java/com/jpsoft/ipcps/common/WechatUtils.java

@@ -0,0 +1,224 @@
+package com.jpsoft.ipcps.common;
+
+import com.jpsoft.ipcps.entity.AccessToken;
+import java.util.concurrent.ConcurrentHashMap;
+import java.util.Date;
+import java.io.BufferedReader;
+import java.io.InputStream;
+import java.io.InputStreamReader;
+import java.io.OutputStream;
+import java.net.ConnectException;
+import java.net.URL;
+
+
+import javax.net.ssl.HttpsURLConnection;
+import javax.net.ssl.SSLContext;
+import javax.net.ssl.SSLSocketFactory;
+import javax.net.ssl.TrustManager;
+import net.sf.json.JSONException;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpSession;
+import java.net.URLEncoder;
+import java.io.UnsupportedEncodingException;
+
+
+public class WechatUtils {
+    private static Logger log = LoggerFactory.getLogger(WechatUtils.class);
+
+    // 获取access_token的接口地址(GET) 限200(次/天)
+    public final static String access_token_url = "https://api.weixin.qq.com/cgi-bin/token?grant_type=client_credential&appid=APPID&secret=APPSECRET";
+
+    public static ConcurrentHashMap<String,AccessToken> tokenMap = new ConcurrentHashMap<String,AccessToken>();
+    /**
+     * 获取基础支持中的access_token
+     * access_token的有效期目前为2个小时,需定时刷新,重复获取将导致上次获取的access_token失效
+     * @param appid 凭证
+     * @param appsecret 密钥
+     * @return
+     */
+    public static AccessToken getAccessToken(String appid, String appsecret) {
+        AccessToken accessToken = null;
+        boolean needRequest = false;
+
+        if (tokenMap.containsKey(appid)) {
+            accessToken = tokenMap.get(appid);
+
+            Date now = new Date();
+
+            if (accessToken.getCreateDate().getTime() + accessToken.getExpiresIn()*1000 < now.getTime()) {
+                //说明token已过期
+                System.out.println("appid=" + appid + ",token=" + accessToken.getToken() + "已过期!");
+                needRequest  =true;
+            }
+        }
+        else{
+            needRequest = true;
+        }
+
+        if (needRequest) {
+            String requestUrl = access_token_url.replace("APPID", appid).replace("APPSECRET", appsecret);
+            net.sf.json.JSONObject jsonObject = httpRequest(requestUrl, "GET", null);
+
+            //保存一个hashmap,如果2个小时之内获取过token就把缓存中token返回,如果超过2小时则重新获取一个
+            // 如果请求成功
+            if (null != jsonObject) {
+                try {
+                    accessToken = new AccessToken();
+                    accessToken.setAppId(appid);
+                    accessToken.setToken(jsonObject.getString("access_token"));
+                    accessToken.setExpiresIn(jsonObject.getInt("expires_in"));
+                    accessToken.setCreateDate(new Date());
+
+                    tokenMap.put(appid, accessToken);
+                    //accessToken.setOpenid(jsonObject.getString("openid"));
+                } catch (JSONException e) {
+                    accessToken = null;
+                    // 获取token失败
+                    //log.error("获取token失败 errcode:{} errmsg:{}", jsonObject.getInt("errcode"), jsonObject.getString("errmsg"));
+                }
+            }
+        }
+
+        return accessToken;
+    }
+
+
+    /**
+     * 发起https请求并获取结果
+     * @param requestUrl 请求地址
+     * @param requestMethod 请求方式(GET、POST)
+     * @param outputStr 提交的数据
+     * @return JSONObject(通过JSONObject.get(key)的方式获取json对象的属性值)
+     */
+    public static  net.sf.json.JSONObject httpRequest(String requestUrl, String requestMethod, String outputStr) {
+        net.sf.json.JSONObject jsonObject = null;
+        StringBuffer buffer = new StringBuffer();
+        try {
+            // 创建SSLContext对象,并使用我们指定的信任管理器初始化
+            TrustManager[] tm = { new MyX509TrustManager() };
+            SSLContext sslContext = SSLContext.getInstance("SSL", "SunJSSE");
+            sslContext.init(null, tm, new java.security.SecureRandom());
+            // 从上述SSLContext对象中得到SSLSocketFactory对象
+            SSLSocketFactory ssf = sslContext.getSocketFactory();
+
+            URL url = new URL(requestUrl);
+            HttpsURLConnection httpUrlConn = (HttpsURLConnection) url.openConnection();
+            httpUrlConn.setSSLSocketFactory(ssf);
+
+            httpUrlConn.setDoOutput(true);
+            httpUrlConn.setDoInput(true);
+            httpUrlConn.setUseCaches(false);
+            // 设置请求方式(GET/POST)
+            httpUrlConn.setRequestMethod(requestMethod);
+
+            if ("GET".equalsIgnoreCase(requestMethod))
+                httpUrlConn.connect();
+
+            // 当有数据需要提交时
+            if (null != outputStr) {
+                OutputStream outputStream = httpUrlConn.getOutputStream();
+                // 注意编码格式,防止中文乱码
+                outputStream.write(outputStr.getBytes("UTF-8"));
+                outputStream.close();
+            }
+
+            // 将返回的输入流转换成字符串
+            InputStream inputStream = httpUrlConn.getInputStream();
+            InputStreamReader inputStreamReader = new InputStreamReader(inputStream, "utf-8");
+            BufferedReader bufferedReader = new BufferedReader(inputStreamReader);
+
+            String str = null;
+            while ((str = bufferedReader.readLine()) != null) {
+                buffer.append(str);
+            }
+            bufferedReader.close();
+            inputStreamReader.close();
+            // 释放资源
+            inputStream.close();
+            inputStream = null;
+            httpUrlConn.disconnect();
+            jsonObject = net.sf.json.JSONObject.fromObject(buffer.toString());
+        } catch (ConnectException ce) {
+
+        } catch (Exception e) {
+
+        }
+        return jsonObject;
+    }
+
+
+
+    //获取微信的code
+    public static String code = "https://open.weixin.qq.com/connect/oauth2/authorize?appid=APPID&redirect_uri=REDIRECT_URI&response_type=code&scope=SCOPE&state=STATE#wechat_redirect";
+
+
+    /**
+     * 通过OAuth2.0方式弹出授权页面获得用户基本信息
+     * @param appid
+     * @param url
+     * @param scope
+     * @return
+     */
+    public static String getCodeRequest(String appid, String url,String scope){
+        String result = null;
+        String url_encode = "";
+        try {
+            url_encode = java.net.URLEncoder.encode(url, "utf-8");
+        } catch (UnsupportedEncodingException e) {
+            // TODO Auto-generated catch block
+            e.printStackTrace();
+        }
+        result  = code.replace("APPID", appid).replace("REDIRECT_URI",url_encode).replace("SCOPE", scope);
+        return result;
+    }
+
+
+
+
+
+    //通过code换取网页授权access_token
+    public static String accessTokenurl = "https://api.weixin.qq.com/sns/oauth2/access_token?appid=APPID&secret=SECRET&code=CODE&grant_type=authorization_code";
+
+
+    /**
+     * 通过code换取网页授权access_token
+     * 微信网页授权是通过OAuth2.0机制实现的,在用户授权给公众号后,
+     * 公众号可以获取到一个网页授权特有的接口调用凭证(网页授权access_token),
+     * 通过网页授权access_token可以进行授权后接口调用,如获取用户基本信息
+     * 这里通过code换取的是一个特殊的网页授权access_token,与基础支持中的access_token不同
+     * @param appid
+     * @param appsecret
+     * @param code
+     * @return
+     */
+    public static AccessToken getAccessToken(String appid, String appsecret,String code) {
+        String result = null;
+        AccessToken accessToken = null;
+        result  = accessTokenurl.replace("APPID", appid).replace("SECRET",appsecret).replace("CODE", code);
+        log.error("result:"+result);
+        net.sf.json.JSONObject jsonObject = httpRequest(result, "GET", null);
+        if (null != jsonObject) {
+            try {
+                accessToken = new AccessToken();
+                accessToken.setToken(jsonObject.getString("access_token"));
+                accessToken.setExpiresIn(jsonObject.getInt("expires_in"));
+                accessToken.setOpenid(jsonObject.getString("openid"));
+                accessToken.setScope(jsonObject.getString("scope"));
+            } catch (JSONException e) {
+                accessToken = null;
+                // 获取token失败
+                log.error("获取token失败 errcode:{} errmsg:{}", jsonObject.getInt("errcode"), jsonObject.getString("errmsg"));
+            }
+        }
+        return accessToken;
+    }
+
+
+
+
+
+
+}

+ 5 - 0
src/main/java/com/jpsoft/ipcps/common/WorkflowConstants.java

@@ -0,0 +1,5 @@
+package com.jpsoft.ipcps.common;
+
+public class WorkflowConstants {
+    public static final String TENANT = "jpsoft";
+}

+ 10 - 0
src/main/java/com/jpsoft/ipcps/configuration/ActivitiConfig.java

@@ -0,0 +1,10 @@
+package com.jpsoft.ipcps.configuration;
+
+import org.springframework.context.annotation.Configuration;
+import org.springframework.context.annotation.ImportResource;
+
+@Configuration
+@ImportResource(locations = {"classpath:config/applicationContext-activit.xml"})
+public class ActivitiConfig {
+
+}

+ 50 - 0
src/main/java/com/jpsoft/ipcps/configuration/SwaggerConfig.java

@@ -0,0 +1,50 @@
+package com.jpsoft.ipcps.configuration;
+
+import org.springframework.context.annotation.Bean;
+import org.springframework.context.annotation.Configuration;
+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 SwaggerConfig {
+    @Bean
+    public Docket createRestApi() {
+        //Authorization
+        ParameterBuilder tokenPar = new ParameterBuilder();
+        List<Parameter> pars = new ArrayList<Parameter>();
+        tokenPar.name("Authorization").description("令牌")
+                .modelRef(new ModelRef("string"))
+                .parameterType("header")
+                .required(false).build();
+        pars.add(tokenPar.build());
+
+        return new Docket(DocumentationType.SWAGGER_2)
+                .apiInfo(apiInfo())
+                .select()
+                .apis(RequestHandlerSelectors.basePackage("com.jpsoft.ipcps.controller"))
+                .paths(PathSelectors.any())
+                .build()
+                .globalOperationParameters(pars);
+    }
+
+    private ApiInfo apiInfo() {
+        return new ApiInfoBuilder()
+                .title("后台接口文档")
+                .description("")
+                .termsOfServiceUrl("")
+                .version("1.0")
+                .build();
+    }
+}

+ 56 - 0
src/main/java/com/jpsoft/ipcps/configuration/WebMvcConfig.java

@@ -0,0 +1,56 @@
+package com.jpsoft.ipcps.configuration;
+
+import com.jpsoft.ipcps.interceptor.LoginInterceptor;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.context.annotation.Configuration;
+import org.springframework.web.servlet.config.annotation.*;
+
+@Configuration
+public class WebMvcConfig implements WebMvcConfigurer {
+	@Autowired
+	private LoginInterceptor loginInterceptor;
+
+	@Override
+	public void addCorsMappings(CorsRegistry registry) {
+		registry.addMapping("/**")
+				.allowedOrigins("*")
+				.allowedHeaders("*")
+				.allowedMethods("*")
+				.allowCredentials(false)
+				.exposedHeaders("access-control-allow-headers",
+						"access-control-allow-methods",
+						"access-control-allow-origin",
+						"access-control-max-age",
+						"X-Frame-Options",
+						"token-status")
+				.maxAge(3600);
+	}
+
+	@Override
+	public void addResourceHandlers(ResourceHandlerRegistry registry) {
+		registry.addResourceHandler("swagger-ui.html")
+				.addResourceLocations("classpath:/META-INF/resources/");
+
+		registry.addResourceHandler("/webjars/**")
+				.addResourceLocations("classpath:/META-INF/resources/webjars/");
+	}
+
+	@Override
+	public void addViewControllers(ViewControllerRegistry registry) {
+		// registry.addViewController("/login").setViewName("login");
+	}
+
+	@Override
+	public void addInterceptors(InterceptorRegistry registry) {
+		registry.addInterceptor(loginInterceptor)
+				.addPathPatterns("/**")
+				.excludePathPatterns("/getToken",
+                        "/swagger-resources/**",
+                        "/webjars/**",
+                        "/swagger-ui.html",
+						"/wechatGetToken",
+						"/getAT",
+                        "/v2/**",
+						"/actuator/**");
+	}
+}

+ 193 - 0
src/main/java/com/jpsoft/ipcps/controller/AdminRoleController.java

@@ -0,0 +1,193 @@
+package com.jpsoft.ipcps.controller;
+
+import com.github.pagehelper.Page;
+import com.jpsoft.ipcps.common.Sort;
+import com.jpsoft.ipcps.dto.MessageResult;
+import com.jpsoft.ipcps.entity.AdminRole;
+import com.jpsoft.ipcps.service.AdminRoleService;
+import io.swagger.annotations.ApiOperation;
+import org.activiti.engine.repository.Deployment;
+import org.activiti.engine.repository.ProcessDefinition;
+import org.activiti.engine.repository.ProcessDefinitionQuery;
+import org.apache.commons.lang3.StringUtils;
+import org.apache.ibatis.mapping.ResultMap;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+
+import javax.servlet.http.HttpServletRequest;
+import java.text.SimpleDateFormat;
+import java.util.*;
+
+@RestController
+@RequestMapping("/adminRole")
+public class AdminRoleController {
+    private Logger logger = LoggerFactory.getLogger(getClass());
+
+    @Autowired
+    private AdminRoleService adminRoleService;
+
+    @ApiOperation(value="添加信息")
+    @PostMapping("add")
+    public MessageResult<AdminRole> add(@ModelAttribute AdminRole adminRole){
+        MessageResult<AdminRole> msgResult = new MessageResult<>();
+
+        try {
+            adminRole.setId(UUID.randomUUID().toString());
+
+            int affectCount = adminRoleService.insert(adminRole);
+
+            if (affectCount > 0) {
+                msgResult.setResult(true);
+                msgResult.setData(adminRole);
+            } else {
+                msgResult.setResult(false);
+                msgResult.setMessage("数据库添加失败");
+            }
+        }
+        catch(Exception ex){
+            logger.error(ex.getMessage(),ex);
+
+            msgResult.setResult(false);
+            msgResult.setMessage(ex.getMessage());
+        }
+
+        return msgResult;
+    }
+
+    @ApiOperation(value="获取信息")
+    @GetMapping("detail/{id}")
+    public MessageResult<AdminRole> detail(@PathVariable("id") String id){
+        MessageResult<AdminRole> msgResult = new MessageResult<>();
+
+        try {
+            AdminRole adminRole = adminRoleService.get(id);
+
+            if (adminRole != null) {
+                msgResult.setResult(true);
+                msgResult.setData(adminRole);
+            } else {
+                msgResult.setResult(false);
+                msgResult.setMessage("数据库不存在该记录!");
+            }
+        }
+        catch(Exception ex){
+            logger.error(ex.getMessage(),ex);
+
+            msgResult.setResult(false);
+            msgResult.setMessage(ex.getMessage());
+        }
+
+        return msgResult;
+    }
+
+    @ApiOperation(value="更新")
+    @PostMapping("update")
+    public MessageResult<AdminRole> update(@ModelAttribute AdminRole adminRole){
+        MessageResult<AdminRole> msgResult = new MessageResult<>();
+
+        try {
+            int affectCount = adminRoleService.update(adminRole);
+
+            if (affectCount > 0) {
+                msgResult.setResult(true);
+                msgResult.setData(adminRole);
+            } else {
+                msgResult.setResult(false);
+                msgResult.setMessage("数据库更新失败");
+            }
+        }
+        catch(Exception ex){
+            logger.error(ex.getMessage(),ex);
+
+            msgResult.setResult(false);
+            msgResult.setMessage(ex.getMessage());
+        }
+
+        return msgResult;
+    }
+
+    @ApiOperation(value="删除")
+    @PostMapping("delete/{id}")
+    public MessageResult<AdminRole> delete(@PathVariable("id") String id){
+        MessageResult<AdminRole> msgResult = new MessageResult<>();
+
+        try {
+            int affectCount = adminRoleService.delete(id);
+
+            if (affectCount > 0) {
+                msgResult.setResult(true);
+            } else {
+                msgResult.setResult(false);
+                msgResult.setMessage("数据库删除失败");
+            }
+        }
+        catch(Exception ex){
+            logger.error(ex.getMessage(),ex);
+
+            msgResult.setResult(false);
+            msgResult.setMessage(ex.getMessage());
+        }
+
+        return msgResult;
+    }
+
+
+    @ApiOperation(value="批量删除")
+    @PostMapping("batchDelete/{id}")
+    public MessageResult<AdminRole> batchDelete(@PathVariable("id") String id){
+        MessageResult<AdminRole> msgResult = new MessageResult<>();
+
+        msgResult.setResult(false);
+        msgResult.setMessage("未实现");
+
+        return msgResult;
+    }
+
+    @ApiOperation(value="列表")
+    @RequestMapping(value = "list",method = RequestMethod.POST)
+    public MessageResult<Map> list(
+            String id,
+            @RequestParam(value="draw",defaultValue="1") int draw,
+            @RequestParam(value="start",defaultValue="1") int start,
+            @RequestParam(value="length",defaultValue="20") int length,
+            HttpServletRequest request){
+        String subject = (String)request.getAttribute("subject");
+
+        //当前用户ID
+        System.out.println(subject);
+
+        MessageResult<Map> msgResult = new MessageResult<>();
+
+        Map<String,Object> searchParms = new HashMap<>();
+
+        List<Sort> sortList = new ArrayList<>();
+        sortList.add(new Sort("id_","asc"));
+
+        if (StringUtils.isNotEmpty(id)) {
+            searchParms.put("id","%" + id + "%");
+        }
+
+        int pageNum = start / length;
+
+        if (start % length != 0) {
+            pageNum++;
+        }
+
+        int pageSize = length;
+
+        Page<AdminRole> page = adminRoleService.pageSearch(searchParms,pageNum,pageSize,sortList);
+
+        HashMap<String, Object> wrapper = new HashMap<String, Object>();
+        wrapper.put("draw",draw);
+        wrapper.put("recordsTotal", page.getTotal());
+        wrapper.put("recordsFiltered", page.getTotal());
+        wrapper.put("data", page.getResult());
+
+        msgResult.setResult(true);
+        msgResult.setData(wrapper);
+
+        return msgResult;
+    }
+}

+ 193 - 0
src/main/java/com/jpsoft/ipcps/controller/DepartmentController.java

@@ -0,0 +1,193 @@
+package com.jpsoft.ipcps.controller;
+
+import com.github.pagehelper.Page;
+import com.jpsoft.ipcps.common.Sort;
+import com.jpsoft.ipcps.dto.MessageResult;
+import com.jpsoft.ipcps.entity.Department;
+import com.jpsoft.ipcps.service.DepartmentService;
+import io.swagger.annotations.ApiOperation;
+import org.activiti.engine.repository.Deployment;
+import org.activiti.engine.repository.ProcessDefinition;
+import org.activiti.engine.repository.ProcessDefinitionQuery;
+import org.apache.commons.lang3.StringUtils;
+import org.apache.ibatis.mapping.ResultMap;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+
+import javax.servlet.http.HttpServletRequest;
+import java.text.SimpleDateFormat;
+import java.util.*;
+
+@RestController
+@RequestMapping("/department")
+public class DepartmentController {
+    private Logger logger = LoggerFactory.getLogger(getClass());
+
+    @Autowired
+    private DepartmentService departmentService;
+
+    @ApiOperation(value="添加信息")
+    @PostMapping("add")
+    public MessageResult<Department> add(@ModelAttribute Department department){
+        MessageResult<Department> msgResult = new MessageResult<>();
+
+        try {
+            department.setId(UUID.randomUUID().toString());
+
+            int affectCount = departmentService.insert(department);
+
+            if (affectCount > 0) {
+                msgResult.setResult(true);
+                msgResult.setData(department);
+            } else {
+                msgResult.setResult(false);
+                msgResult.setMessage("数据库添加失败");
+            }
+        }
+        catch(Exception ex){
+            logger.error(ex.getMessage(),ex);
+
+            msgResult.setResult(false);
+            msgResult.setMessage(ex.getMessage());
+        }
+
+        return msgResult;
+    }
+
+    @ApiOperation(value="获取信息")
+    @GetMapping("detail/{id}")
+    public MessageResult<Department> detail(@PathVariable("id") String id){
+        MessageResult<Department> msgResult = new MessageResult<>();
+
+        try {
+            Department department = departmentService.get(id);
+
+            if (department != null) {
+                msgResult.setResult(true);
+                msgResult.setData(department);
+            } else {
+                msgResult.setResult(false);
+                msgResult.setMessage("数据库不存在该记录!");
+            }
+        }
+        catch(Exception ex){
+            logger.error(ex.getMessage(),ex);
+
+            msgResult.setResult(false);
+            msgResult.setMessage(ex.getMessage());
+        }
+
+        return msgResult;
+    }
+
+    @ApiOperation(value="更新用户")
+    @PostMapping("update")
+    public MessageResult<Department> update(@ModelAttribute Department department){
+        MessageResult<Department> msgResult = new MessageResult<>();
+
+        try {
+            int affectCount = departmentService.update(department);
+
+            if (affectCount > 0) {
+                msgResult.setResult(true);
+                msgResult.setData(department);
+            } else {
+                msgResult.setResult(false);
+                msgResult.setMessage("数据库更新失败");
+            }
+        }
+        catch(Exception ex){
+            logger.error(ex.getMessage(),ex);
+
+            msgResult.setResult(false);
+            msgResult.setMessage(ex.getMessage());
+        }
+
+        return msgResult;
+    }
+
+    @ApiOperation(value="删除用户")
+    @PostMapping("delete/{id}")
+    public MessageResult<Department> delete(@PathVariable("id") String id){
+        MessageResult<Department> msgResult = new MessageResult<>();
+
+        try {
+            int affectCount = departmentService.delete(id);
+
+            if (affectCount > 0) {
+                msgResult.setResult(true);
+            } else {
+                msgResult.setResult(false);
+                msgResult.setMessage("数据库删除失败");
+            }
+        }
+        catch(Exception ex){
+            logger.error(ex.getMessage(),ex);
+
+            msgResult.setResult(false);
+            msgResult.setMessage(ex.getMessage());
+        }
+
+        return msgResult;
+    }
+
+
+    @ApiOperation(value="批量删除")
+    @PostMapping("batchDelete/{id}")
+    public MessageResult<Department> batchDelete(@PathVariable("id") String id){
+        MessageResult<Department> msgResult = new MessageResult<>();
+
+        msgResult.setResult(false);
+        msgResult.setMessage("未实现");
+
+        return msgResult;
+    }
+
+    @ApiOperation(value="列表")
+    @RequestMapping(value = "list",method = RequestMethod.POST)
+    public MessageResult<Map> list(
+            String id,
+            @RequestParam(value="draw",defaultValue="1") int draw,
+            @RequestParam(value="start",defaultValue="1") int start,
+            @RequestParam(value="length",defaultValue="20") int length,
+            HttpServletRequest request){
+        String subject = (String)request.getAttribute("subject");
+
+        //当前用户ID
+        System.out.println(subject);
+
+        MessageResult<Map> msgResult = new MessageResult<>();
+
+        Map<String,Object> searchParms = new HashMap<>();
+
+        List<Sort> sortList = new ArrayList<>();
+        sortList.add(new Sort("id_","asc"));
+
+        if (StringUtils.isNotEmpty(id)) {
+            searchParms.put("id","%" + id + "%");
+        }
+
+        int pageNum = start / length;
+
+        if (start % length != 0) {
+            pageNum++;
+        }
+
+        int pageSize = length;
+
+        Page<Department> page = departmentService.pageSearch(searchParms,pageNum,pageSize,sortList);
+
+        HashMap<String, Object> wrapper = new HashMap<String, Object>();
+        wrapper.put("draw",draw);
+        wrapper.put("recordsTotal", page.getTotal());
+        wrapper.put("recordsFiltered", page.getTotal());
+        wrapper.put("data", page.getResult());
+
+        msgResult.setResult(true);
+        msgResult.setData(wrapper);
+
+        return msgResult;
+    }
+}

+ 673 - 0
src/main/java/com/jpsoft/ipcps/controller/JpAdminController.java

@@ -0,0 +1,673 @@
+package com.jpsoft.ipcps.controller;
+
+import com.github.pagehelper.Page;
+import com.jpsoft.ipcps.common.DESEncoding;
+import com.jpsoft.ipcps.common.PojoUtils;
+import com.jpsoft.ipcps.common.Sort;
+import com.jpsoft.ipcps.common.WechatUtils;
+import com.jpsoft.ipcps.dto.MessageResult;
+import com.jpsoft.ipcps.entity.*;
+import com.jpsoft.ipcps.service.AdminRoleService;
+import com.jpsoft.ipcps.service.JpAdminService;
+import com.jpsoft.ipcps.service.MenuService;
+import com.jpsoft.ipcps.service.RoleService;
+import com.jpsoft.ipcps.utils.FileUtils;
+import com.jpsoft.ipcps.utils.ServerConfig;
+import io.swagger.annotations.ApiOperation;
+
+import org.apache.commons.lang3.StringUtils;
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+import org.springframework.web.multipart.MultipartFile;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpSession;
+import java.net.URLEncoder;
+import java.util.*;
+
+@RestController
+@RequestMapping("/jpAdmin")
+public class JpAdminController {
+    private Logger logger = LoggerFactory.getLogger(getClass());
+
+    @Autowired
+    private JpAdminService jpAdminService;
+
+    @Autowired
+    private AdminRoleService adminRoleService;
+
+    @Autowired
+    private RoleService roleService;
+
+    @Autowired
+    private MenuService menuService;
+
+    @ApiOperation(value="添加信息")
+    @PostMapping("add")
+    public MessageResult<JpAdmin> add(@ModelAttribute JpAdmin jpAdmin,@RequestAttribute String subject,HttpServletRequest req){
+        MessageResult<JpAdmin> msgResult = new MessageResult<>();
+
+        try {
+
+            String[] roleArray = req.getParameterValues("checkbox2");
+
+            jpAdmin.setId(UUID.randomUUID().toString());
+
+            String userName = jpAdmin.getUserName();
+            int count = jpAdminService.getUserByName(userName);
+            if(count>0){
+                msgResult.setResult(false);
+                msgResult.setMessage("用户名已经存在!");
+                return msgResult;
+            }
+
+            jpAdmin.setCreateBy(subject);
+            jpAdmin.setCreateDate(new Date());
+            jpAdmin.setUpdateBy(subject);
+            jpAdmin.setUpdateDate(new Date());
+
+            jpAdmin.setDelFlag(false);
+
+
+            List<AdminRole> adminRoleList = new ArrayList<AdminRole>();
+
+            for (String roleId:roleArray){
+                Role role = roleService.get(roleId);
+                AdminRole item = new AdminRole();
+                item.setId(UUID.randomUUID().toString());
+                item.setAdminId(jpAdmin.getId());
+                item.setRoleId(roleId);
+                item.setRoleName(role.getRoleName());
+                item.setRoleDescription(role.getRoleDescription());
+                adminRoleList.add(item);
+            }
+
+            int affectCount = jpAdminService.insertAndAdminRole(jpAdmin,adminRoleList);
+
+            if (affectCount > 0) {
+                msgResult.setResult(true);
+                msgResult.setData(jpAdmin);
+            } else {
+                msgResult.setResult(false);
+                msgResult.setMessage("数据库添加失败");
+            }
+        }
+        catch(Exception ex){
+            logger.error(ex.getMessage(),ex);
+
+            msgResult.setResult(false);
+            msgResult.setMessage(ex.getMessage());
+        }
+
+        return msgResult;
+    }
+
+    @ApiOperation(value="获取信息")
+    @GetMapping("detail/{id}")
+    public MessageResult<JpAdmin> detail(@PathVariable("id") String id){
+        MessageResult<JpAdmin> msgResult = new MessageResult<>();
+
+        try {
+            JpAdmin jpAdmin = jpAdminService.get(id);
+
+            List<AdminRole> adminRoleList = adminRoleService.listByAdminId(id);
+
+            jpAdmin.setAdminRoleList(adminRoleList);
+
+            if (jpAdmin != null) {
+                msgResult.setResult(true);
+                msgResult.setData(jpAdmin);
+            } else {
+                msgResult.setResult(false);
+                msgResult.setMessage("数据库不存在该记录!");
+            }
+        }
+        catch(Exception ex){
+            logger.error(ex.getMessage(),ex);
+
+            msgResult.setResult(false);
+            msgResult.setMessage(ex.getMessage());
+        }
+
+        return msgResult;
+    }
+
+    @ApiOperation(value="更新用户")
+    @PostMapping("update")
+    public MessageResult<JpAdmin> update(@ModelAttribute JpAdmin jpAdmin,@RequestAttribute String subject,HttpServletRequest req){
+        MessageResult<JpAdmin> msgResult = new MessageResult<>();
+
+        try {
+            if(StringUtils.isEmpty(jpAdmin.getId())){
+                jpAdmin.setId(subject);
+            }
+            jpAdmin.setUpdateBy(subject);
+            jpAdmin.setUpdateDate(new Date());
+
+            String[] roleArray = req.getParameterValues("checkbox2");
+
+            List<AdminRole> adminRoleList = new ArrayList<AdminRole>();
+
+            if(roleArray!=null){
+                for (String roleId:roleArray){
+                    Role role = roleService.get(roleId);
+                    AdminRole item = new AdminRole();
+                    item.setId(UUID.randomUUID().toString());
+                    item.setAdminId(jpAdmin.getId());
+                    item.setRoleId(roleId);
+                    item.setRoleName(role.getRoleName());
+                    item.setRoleDescription(role.getRoleDescription());
+                    adminRoleList.add(item);
+                }
+            }
+
+            int affectCount = jpAdminService.updateAndAdminRole(jpAdmin,adminRoleList);
+
+            if (affectCount > 0) {
+                msgResult.setResult(true);
+                msgResult.setData(jpAdmin);
+            } else {
+                msgResult.setResult(false);
+                msgResult.setMessage("数据库更新失败");
+            }
+        }
+        catch(Exception ex){
+            logger.error(ex.getMessage(),ex);
+
+            msgResult.setResult(false);
+            msgResult.setMessage(ex.getMessage());
+        }
+
+        return msgResult;
+    }
+
+    @ApiOperation(value="删除用户")
+    @PostMapping("delete/{id}")
+    public MessageResult<JpAdmin> delete(@PathVariable("id") String id,@RequestAttribute String subject){
+        MessageResult<JpAdmin> msgResult = new MessageResult<>();
+
+        try {
+            if(id.equals(subject)){
+                msgResult.setResult(false);
+                msgResult.setMessage("不能删除用户自身的账户!");
+                return msgResult;
+            }
+
+            JpAdmin jpAdmin = jpAdminService.get(id);
+
+            jpAdmin.setDelFlag(true);
+
+            int affectCount = jpAdminService.update(jpAdmin);
+
+            if (affectCount > 0) {
+                msgResult.setResult(true);
+            } else {
+                msgResult.setResult(false);
+                msgResult.setMessage("数据库删除失败");
+            }
+        }
+        catch(Exception ex){
+            logger.error(ex.getMessage(),ex);
+
+            msgResult.setResult(false);
+            msgResult.setMessage(ex.getMessage());
+        }
+
+        return msgResult;
+    }
+
+
+    @ApiOperation(value="恢复删除用户")
+    @PostMapping("recoveryDel/{id}")
+    public MessageResult<JpAdmin> recoveryDel(@PathVariable("id") String id,@RequestAttribute String subject){
+        MessageResult<JpAdmin> msgResult = new MessageResult<>();
+
+        try {
+
+            JpAdmin jpAdmin = jpAdminService.get(id);
+
+            jpAdmin.setDelFlag(false);
+
+            int affectCount = jpAdminService.update(jpAdmin);
+
+            if (affectCount > 0) {
+                msgResult.setResult(true);
+            } else {
+                msgResult.setResult(false);
+                msgResult.setMessage("数据库恢复删除失败");
+            }
+        }
+        catch(Exception ex){
+            logger.error(ex.getMessage(),ex);
+
+            msgResult.setResult(false);
+            msgResult.setMessage(ex.getMessage());
+        }
+
+        return msgResult;
+    }
+
+
+    @ApiOperation(value="批量删除")
+    @PostMapping("batchDelete")
+    public MessageResult<JpAdmin> batchDelete(String ids,@RequestAttribute String subject){
+        MessageResult<JpAdmin> msgResult = new MessageResult<>();
+
+        try{
+            if(ids.contains(subject)){
+                msgResult.setResult(false);
+                msgResult.setMessage("不能删除用户自身的账户!");
+                return msgResult;
+            }
+
+            String[] arr = ids.split(",");
+            for(String id : arr){
+                JpAdmin jpAdmin = jpAdminService.get(id);
+                jpAdmin.setDelFlag(true);
+                jpAdminService.update(jpAdmin);
+            }
+            msgResult.setResult(true);
+        }catch (Exception ex) {
+            logger.error(ex.getMessage(), ex);
+            msgResult.setResult(false);
+            msgResult.setMessage(ex.getMessage());
+        }
+
+        return msgResult;
+    }
+
+    @ApiOperation(value="列表")
+    @RequestMapping(value = "list",method = RequestMethod.POST)
+    public MessageResult<Map> list(
+            @RequestParam(value="userName",defaultValue="")String userName,
+            @RequestParam(value="realName",defaultValue="")String realName,
+            @RequestParam(value="roleName",defaultValue="")String roleName,
+            @RequestParam(value="orgName",defaultValue="")String orgName,
+            @RequestParam(value="isDel",defaultValue="")String isDel,
+            @RequestParam(value="start",defaultValue="0") int start,
+            @RequestParam(value="length",defaultValue="20") int length,
+            HttpServletRequest request){
+        String subject = (String)request.getAttribute("subject");
+
+        //当前用户ID
+        System.out.println(subject);
+
+        MessageResult<Map> msgResult = new MessageResult<>();
+
+        Map<String,Object> searchParms = new HashMap<>();
+
+        List<Sort> sortList = new ArrayList<>();
+        sortList.add(new Sort("create_date_","desc"));
+
+        if (StringUtils.isNotEmpty(userName)) {
+            searchParms.put("userName","%" + userName + "%");
+        }
+        if (StringUtils.isNotEmpty(realName)) {
+            searchParms.put("realName","%" + realName + "%");
+        }
+        if (StringUtils.isNotEmpty(roleName)) {
+            searchParms.put("roleDesc","%" + roleName + "%");
+        }
+        if (StringUtils.isNotEmpty(orgName)) {
+            searchParms.put("orgName","%" + orgName + "%");
+        }
+
+        searchParms.put("isDel",isDel);
+
+
+        int pageNum = start / length;
+
+        pageNum++;
+/*
+        if (start % length != 0) {
+            pageNum++;
+        }*/
+
+        int pageSize = length;
+
+        Page<JpAdmin> page = jpAdminService.pageSearch(searchParms,pageNum,pageSize,sortList);
+
+        for (JpAdmin item:page){
+            String id = item.getId();
+            List<AdminRole> adminRoleList = adminRoleService.listByAdminId(id);
+            item.setAdminRoleList(adminRoleList);
+        }
+
+        msgResult.setResult(true);
+        msgResult.setData(PojoUtils.pageWrapper(page));
+
+        return msgResult;
+    }
+
+
+
+    @ApiOperation(value="微信ID列表")
+    @RequestMapping(value = "forWechatList",method = RequestMethod.POST)
+    public MessageResult<Map> forWechatList(
+            @RequestParam(value="start",defaultValue="0") int start,
+            @RequestParam(value="length",defaultValue="20") int length,
+            HttpServletRequest request){
+        String subject = (String)request.getAttribute("subject");
+
+        //当前用户ID
+        System.out.println(subject);
+
+        MessageResult<Map> msgResult = new MessageResult<>();
+
+        Map<String,Object> searchParms = new HashMap<>();
+
+        List<Sort> sortList = new ArrayList<>();
+        sortList.add(new Sort("create_date_","desc"));
+
+        searchParms.put("openId","true");
+
+        int pageNum = start / length;
+
+        pageNum++;
+/*
+        if (start % length != 0) {
+            pageNum++;
+        }*/
+
+        int pageSize = length;
+
+        Page<JpAdmin> page = jpAdminService.pageSearch(searchParms,pageNum,pageSize,sortList);
+
+        for (JpAdmin item:page){
+            String id = item.getId();
+            List<AdminRole> adminRoleList = adminRoleService.listByAdminId(id);
+            item.setAdminRoleList(adminRoleList);
+        }
+
+        msgResult.setResult(true);
+        msgResult.setData(PojoUtils.pageWrapper(page));
+
+        return msgResult;
+    }
+
+
+    @ApiOperation(value="获取用户信息")
+    @PostMapping("getAdminData")
+    public MessageResult<JpAdmin> getAdminData(@RequestAttribute String subject){
+        MessageResult<JpAdmin> msgResult = new MessageResult<>();
+
+        try{
+            JpAdmin user = jpAdminService.get(subject);
+
+            List<AdminRole> adminRoleList = adminRoleService.listByAdminId(subject);
+
+            user.setAdminRoleList(adminRoleList);
+            msgResult.setResult(true);
+            msgResult.setData(user);
+        }
+        catch(Exception ex){
+            logger.error(ex.getMessage(),ex);
+            msgResult.setResult(false);
+            msgResult.setMessage(ex.getMessage());
+        }
+
+        return msgResult;
+    }
+
+
+
+    @ApiOperation(value="修改密码")
+    @PostMapping("saveNewPwd")
+    public MessageResult<JpAdmin> saveNewPwd(@RequestAttribute String subject,String oldPwd,String newPwd){
+        MessageResult<JpAdmin> msgResult = new MessageResult<>();
+        try{
+            JpAdmin user = jpAdminService.get(subject);
+            if(user.getPwd().equals(oldPwd)){
+                user.setPwd(newPwd);
+                int affectCount = jpAdminService.update(user);
+
+                if (affectCount > 0) {
+                    msgResult.setResult(true);
+                } else {
+                    msgResult.setResult(false);
+                    msgResult.setMessage("数据库删除失败");
+                }
+            }
+            else{
+                msgResult.setResult(false);
+                msgResult.setMessage("原密码错误,请重新输入!");
+            }
+        }
+        catch(Exception ex){
+            logger.error(ex.getMessage(),ex);
+            msgResult.setResult(false);
+            msgResult.setMessage(ex.getMessage());
+        }
+
+        return msgResult;
+    }
+
+    @ApiOperation(value="重置密码")
+    @RequestMapping(value = "restPwd",method = RequestMethod.POST)
+    public MessageResult<JpAdmin> restPwd(String id){
+        MessageResult<JpAdmin> msgResult = new MessageResult<>();
+        JpAdmin admin = jpAdminService.get(id);
+
+        admin.setPwd("123456");
+
+        try{
+            int affectCount = jpAdminService.update(admin);
+            if (affectCount > 0) {
+                msgResult.setResult(true);
+                msgResult.setData(admin);
+            } else {
+                msgResult.setResult(false);
+                msgResult.setMessage("数据库删除失败");
+            }
+        }
+        catch (Exception ex){
+            logger.error(ex.getMessage(),ex);
+            msgResult.setResult(false);
+            msgResult.setMessage(ex.getMessage());
+        }
+
+
+        return msgResult;
+    }
+
+    @ApiOperation(value="全部列表")
+    @RequestMapping(value = "allList",method = RequestMethod.POST)
+    public MessageResult<List<JpAdmin>> allList(HttpServletRequest request){
+        MessageResult<List<JpAdmin>> msgResult = new MessageResult<>();
+        List<JpAdmin> list = jpAdminService.list();
+        msgResult.setResult(true);
+        msgResult.setData(list);
+        return msgResult;
+    }
+
+
+    @ApiOperation(value="搜索")
+    @RequestMapping(value = "userData",method = RequestMethod.POST)
+    public MessageResult<Map> userData(
+            @RequestParam(value = "pageIndex", defaultValue = "1") Integer pageIndex,
+            @RequestParam(value = "pageSize", defaultValue = "10") Integer pageSize,
+            @RequestParam(value="userName",defaultValue="")String userName){
+        MessageResult<Map> msgResult = new MessageResult<>();
+        Map<String,Object> pageMap = new HashMap<>();
+        try{
+            if(!StringUtils.isNotBlank(userName)){
+                msgResult.setResult(false);
+                msgResult.setMessage("不能为空!");
+                return msgResult;
+            }
+            List<Map>  adminsList= jpAdminService.findByName("%" + userName + "%",pageIndex,pageSize);
+            pageMap.put("dataMapList", adminsList);
+            pageMap.put("totalRows", adminsList.size());//总条数
+
+            msgResult.setResult(true);
+            msgResult.setData(pageMap);
+        }catch (Exception e) {
+            logger.error(e.getMessage(),e);
+        }
+        return msgResult;
+    }
+
+    @ApiOperation(value="查询用户")
+    @PostMapping(value = "selectUser")
+    public List<Map> selectUser(String term){
+        Map<String,Object> searchParams = new HashMap<>();
+
+        if (StringUtils.isNotEmpty(term)) {
+            searchParams.put("key", "%" + term + "%");
+        }
+
+        return jpAdminService.selectUser(searchParams);
+    }
+
+    @ApiOperation(value="查询园区办用户")
+    @PostMapping(value = "selectUserForPark")
+    public List<Map> selectUserForPark(String term){
+        List<Sort> sortList = new ArrayList<>();
+        sortList.add(new Sort("id_","asc"));
+        Map<String,Object> searchParamsAdmin = new HashMap<>();
+        searchParamsAdmin.put("ROLEID", "5e99a5ba-1196-47af-8333-b2f69868e168");
+        Page<AdminRole> page = adminRoleService.pageSearch(searchParamsAdmin,1,1000,sortList);
+        List<String> ids = new ArrayList<>();
+        for(AdminRole row : page.getResult()){
+            ids.add(row.getAdminId());
+        }
+
+        Map<String,Object> searchParams = new HashMap<>();
+        searchParams.put("ADMINIDLIST", ids);
+
+        if (StringUtils.isNotEmpty(term)) {
+            searchParams.put("key", "%" + term + "%");
+        }
+
+        List<Map> map = new ArrayList<>();
+        map = jpAdminService.selectUser(searchParams);
+
+        return map;
+    }
+
+    @ApiOperation(value = "当前用户获取已授权菜单")
+    @GetMapping("relatedMenuList")
+    public MessageResult<List> relatedMenuList(@RequestAttribute("subject") String subject) {
+        MessageResult<List> msgResult = new MessageResult<>();
+
+        List<Menu> list = menuService.findAllocMenu(subject,null);
+
+        findChildrenLoop(list,subject,0,5);
+
+        msgResult.setData(list);
+        msgResult.setResult(true);
+
+        return msgResult;
+    }
+
+    private void findChildrenLoop(List<Menu> list, String subject,int deep,int max) {
+        if (deep<max) {
+            for (Menu menu : list) {
+                List<Menu> children = menuService.findAllocMenu(subject,menu.getId());
+
+                menu.setChildren(children);
+
+                findChildrenLoop(children,subject,deep+1,max);
+            }
+        }
+    }
+
+    @ApiOperation(value="角色园区办下的用户")
+    @RequestMapping(value = "findAdminListByRoleName")
+    public MessageResult<List<JpAdmin>> findAdminListByRoleName(@RequestParam(name="roleName",defaultValue = "YQB") String roleName){
+        MessageResult<List<JpAdmin>> msgResult = new MessageResult<>();
+
+        Map<String,Object> searchParams = new HashMap<>();
+        searchParams.put("roleName",roleName);
+        searchParams.put("isDel",0);
+
+        List<Sort> sortList = new ArrayList<>();
+        sortList.add(new Sort("create_date_","desc"));
+
+        Page<JpAdmin> page = jpAdminService.pageSearch(searchParams,1,1000,sortList);
+
+        msgResult.setResult(true);
+        msgResult.setData(page.getResult());
+
+        return msgResult;
+    }
+
+
+
+    @ApiOperation(value="获取openId")
+    @RequestMapping(value = "getOpenId",method = RequestMethod.POST)
+    public String getCR(String reurl,HttpServletRequest request,HttpSession session){
+        ResourceBundle rb = ResourceBundle.getBundle("server");
+        String appid = rb.getString("appId");
+        session.setAttribute("returnUrl", reurl);
+        StringBuffer url = request.getRequestURL();
+        String tempContextUrl = url.delete(url.length() - request.getRequestURI().length(), url.length()).append(request.getContextPath()).toString();
+        String newpath = WechatUtils.getCodeRequest(appid,tempContextUrl+"/jpAdmin/getAT", "snsapi_userinfo");//	snsapi_base是静默授权	snsapi_userinfo需要客户点击授权
+        return "redirect:"+newpath;
+    }
+
+
+    @RequestMapping(value = "getAT",method = RequestMethod.POST)
+    public String getAT(HttpServletRequest req){
+        String code = req.getParameter("code");
+        ResourceBundle rb = ResourceBundle.getBundle("server");
+        String appid = rb.getString("appId");
+        String appSecret = rb.getString("appSecret");
+        String returnUrl =  (String) req.getSession().getAttribute("returnUrl");
+        String openid = null;
+
+        if(StringUtils.isNotEmpty(code)){
+            AccessToken at = WechatUtils.getAccessToken(appid, appSecret, code);
+            if(at!=null){
+                openid = at.getOpenid();
+            }
+        }
+
+        String jumpUrl = "";
+
+        if(returnUrl.indexOf("?") > 0){
+            jumpUrl = returnUrl + "&openid=" +openid;
+        }else{
+            jumpUrl = returnUrl + "?openid=" +openid;
+        }
+
+        return "redirect:"+jumpUrl;
+    }
+
+    @ApiOperation(value="部门列表")
+    @RequestMapping(value = "findDepartmentByOrgId")
+    public MessageResult<List<Map>> findDepartmentByOrgId(String orgId){
+        MessageResult<List<Map>> msgResult = new MessageResult<>();
+
+        List<JpAdmin> adminList = jpAdminService.findUserByOrgId(orgId);
+
+        Set<String> departmentSet = new HashSet<>();
+
+        for (JpAdmin jpAdmin : adminList) {
+            String key = jpAdmin.getOrgId() + "|" + jpAdmin.getDepartment();
+
+            if (StringUtils.isNotEmpty(jpAdmin.getDepartment()) && !departmentSet.contains(key)){
+                departmentSet.add(key);
+            }
+        }
+
+        List<Map> mapList = new ArrayList<>();
+
+        for (String key : departmentSet) {
+            Map<String,Object> map = new HashMap<>();
+
+            map.put("townId",key);
+            map.put("townName",key.split("\\|")[1]);
+
+            mapList.add(map);
+        }
+
+        msgResult.setResult(true);
+        msgResult.setData(mapList);
+
+        return msgResult;
+    }
+}

+ 224 - 0
src/main/java/com/jpsoft/ipcps/controller/LoginController.java

@@ -0,0 +1,224 @@
+package com.jpsoft.ipcps.controller;
+
+import com.github.pagehelper.util.StringUtil;
+import com.jpsoft.ipcps.common.WechatUtils;
+import com.jpsoft.ipcps.dto.MessageResult;
+import com.jpsoft.ipcps.entity.AccessToken;
+import com.jpsoft.ipcps.entity.JpAdmin;
+import com.jpsoft.ipcps.service.JpAdminService;
+import io.jsonwebtoken.Jwts;
+import javax.servlet.http.HttpServletRequest;
+import io.jsonwebtoken.security.Keys;
+import io.swagger.annotations.ApiOperation;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.annotation.Value;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestMethod;
+import org.springframework.web.bind.annotation.RequestParam;
+import org.springframework.web.bind.annotation.RestController;
+
+import javax.servlet.http.HttpSession;
+import java.security.Key;
+import java.util.Base64;
+import java.util.Date;
+import java.util.ResourceBundle;
+
+import org.apache.commons.lang3.StringUtils;
+
+@RestController
+public class LoginController {
+    @Value("${jwt.secret}")
+    private String jwtSecret;
+
+    @Autowired
+    private JpAdminService jpAdminService;
+
+    private Logger logger = LoggerFactory.getLogger(getClass());
+
+    @RequestMapping(value = "/getToken",method = RequestMethod.POST)
+    @ApiOperation(value="获取token,在swagger ui中获取token时将写入session,调用其它接口时不用再设置header")
+    public MessageResult<String> getToken(@RequestParam("userName") String userName,
+                                          @RequestParam("password") String password,HttpSession session){
+        MessageResult<String> msgResult =  new MessageResult<>();
+
+
+        try {
+            JpAdmin user = jpAdminService.getUser(userName,password);
+
+            if(user!=null){
+                //生成token
+                Date now = new Date();
+                //3600 *
+                long expiration = now.getTime() +  3600*6000; //6个小时后,该客户端的token过期
+
+                byte[] privateKey = Base64.getDecoder().decode(jwtSecret);
+
+                Key key = Keys.hmacShaKeyFor(privateKey);
+
+//            Map<String,Object> extraInfo = new HashMap<>();
+//            extraInfo.put("key","test");
+
+                String token = Jwts.builder()
+                        .setSubject(user.getId())
+                        //设置自定义claims后,setSubject值将失效
+//               .setClaims(extraInfo)
+                        .signWith(key)
+                        .setExpiration(new Date(expiration))
+                        .compact();
+
+                session.setAttribute("token","Bearer " + token);
+
+                msgResult.setResult(true);
+                msgResult.setData("Bearer " + token);
+            }
+            else{
+                msgResult.setResult(false);
+                msgResult.setMessage("用户不存在或密码错误!");
+            }
+
+        }
+        catch(Exception ex){
+            msgResult.setResult(false);
+            msgResult.setMessage(ex.getMessage());
+        }
+
+        return msgResult;
+    }
+
+
+    @RequestMapping(value = "wechatGetToken",method = RequestMethod.POST)
+    @ApiOperation(value="获取token")
+    public MessageResult<String> wechatGetToken(@RequestParam("userName") String userName,
+                                          @RequestParam("password") String password,String openid,HttpSession session){
+        MessageResult<String> msgResult =  new MessageResult<>();
+
+
+        try {
+            JpAdmin user = jpAdminService.getUser(userName,password);
+
+            if(user!=null){
+                if(StringUtil.isNotEmpty(openid)) {
+                    JpAdmin curUser = jpAdminService.getUserByOpenId(openid);
+                    if(curUser == null){
+                        //登录时保存openId
+                        user.setOpenId(openid);
+                        jpAdminService.update(user);
+                    }
+                }
+                //生成token
+                Date now = new Date();
+                long expiration = now.getTime() + 3600 * 6000; //6个小时后,该客户端的token过期
+
+                byte[] privateKey = Base64.getDecoder().decode(jwtSecret);
+
+                Key key = Keys.hmacShaKeyFor(privateKey);
+
+//            Map<String,Object> extraInfo = new HashMap<>();
+//            extraInfo.put("key","test");
+
+                String token = Jwts.builder()
+                        .setSubject(user.getId())
+                        //设置自定义claims后,setSubject值将失效
+//               .setClaims(extraInfo)
+                        .signWith(key)
+                        .setExpiration(new Date(expiration))
+                        .compact();
+
+                session.setAttribute("token","Bearer " + token);
+
+                msgResult.setResult(true);
+                msgResult.setData("Bearer " + token);
+            }
+            else{
+                msgResult.setResult(false);
+                msgResult.setMessage("用户不存在或密码错误!");
+            }
+
+        }
+        catch(Exception ex){
+            msgResult.setResult(false);
+            msgResult.setMessage(ex.getMessage());
+        }
+
+        return msgResult;
+    }
+
+/*    @RequestMapping(value = "wechatLogin",method = RequestMethod.GET)
+    @ApiOperation(value="微信免登录")
+    public String wechatLogin(String reUrl,HttpServletRequest request,HttpSession session){
+        ResourceBundle rb = ResourceBundle.getBundle("server");
+        String appid = rb.getString("appId");
+        String appSecret = rb.getString("appSecret");
+        StringBuffer url = request.getRequestURL();
+        String tempContextUrl = url.delete(url.length() - request.getRequestURI().length(), url.length()).append(request.getContextPath()).toString();
+        String newpath = WechatUtils.getCodeRequest(appid,reUrl+"&back=1", "snsapi_userinfo");//	snsapi_base是静默授权	snsapi_userinfo需要客户点击授权
+        return newpath;
+    }*/
+
+    /**
+     * 回调url中将包含参数code,再使用code换取oauth2的授权access_token
+     * @param req
+     * @return
+     */
+    @RequestMapping(value = "getAT",method = RequestMethod.POST)
+    public MessageResult<String> getAT(String code,HttpServletRequest req,HttpSession session) {
+        System.out.println("getToken");
+        System.out.println("appid");
+        System.out.println("appSecret");
+        System.out.println("code");
+
+        MessageResult<String> msgResult =  new MessageResult<>();
+        //String code = req.getParameter("code");
+        ResourceBundle rb = ResourceBundle.getBundle("server");
+        String appid = rb.getString("appId");
+        String appSecret = rb.getString("appSecret");
+        String openid = null;
+
+        logger.warn("appid:"+appid);
+        logger.warn("appSecret:"+appSecret);
+        logger.warn("code:"+code);
+
+        if (StringUtils.isNotEmpty(code)) {
+            AccessToken at = WechatUtils.getAccessToken(appid, appSecret, code);
+            if (at != null) {
+                openid = at.getOpenid();
+            }
+        }
+
+        if (StringUtil.isNotEmpty(openid)) {
+            msgResult.setData2(openid);
+            JpAdmin user = jpAdminService.getUserByOpenId(openid);
+
+            if(user!=null){
+                //生成token
+                Date now = new Date();
+                long expiration = now.getTime() + 3600 * 6000; //6个小时后,该客户端的token过期
+
+                byte[] privateKey = Base64.getDecoder().decode(jwtSecret);
+
+                Key key = Keys.hmacShaKeyFor(privateKey);
+
+                String token = Jwts.builder()
+                        .setSubject(user.getId())
+                        .signWith(key)
+                        .setExpiration(new Date(expiration))
+                        .compact();
+
+                session.setAttribute("token","Bearer " + token);
+
+                msgResult.setResult(true);
+                msgResult.setData("Bearer " + token);
+
+            }
+            else{
+                msgResult.setResult(false);
+                msgResult.setMessage("用户不存在或未绑定openID!");
+            }
+        }
+
+        return msgResult;
+    }
+
+}

+ 276 - 0
src/main/java/com/jpsoft/ipcps/controller/MenuController.java

@@ -0,0 +1,276 @@
+package com.jpsoft.ipcps.controller;
+
+import com.github.pagehelper.Page;
+import com.jpsoft.ipcps.common.PojoUtils;
+import com.jpsoft.ipcps.common.Sort;
+import com.jpsoft.ipcps.dto.MessageResult;
+import com.jpsoft.ipcps.entity.Menu;
+import com.jpsoft.ipcps.entity.RoleMenu;
+import com.jpsoft.ipcps.service.MenuService;
+import com.jpsoft.ipcps.service.RoleMenuService;
+import io.swagger.annotations.ApiOperation;
+import org.apache.commons.lang3.StringUtils;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+import java.util.*;
+
+@RestController
+@RequestMapping("/menu")
+public class MenuController {
+    private Logger logger = LoggerFactory.getLogger(getClass());
+
+    @Autowired
+    private MenuService menuService;
+
+    @Autowired
+    private RoleMenuService roleMenuService;
+
+    @ApiOperation(value = "创建空记录")
+    @GetMapping("create")
+    public MessageResult<Menu> create() {
+        MessageResult<Menu> msgResult = new MessageResult<>();
+
+        Menu menu = new Menu();
+
+        msgResult.setData(menu);
+        msgResult.setResult(true);
+
+        return msgResult;
+    }
+
+    @ApiOperation(value = "添加信息")
+    @PostMapping("add")
+    public MessageResult<Menu> add(Menu menu, @RequestAttribute String subject) {
+        MessageResult<Menu> msgResult = new MessageResult<>();
+
+        try {
+            menu.setId(UUID.randomUUID().toString());
+
+            if (StringUtils.isEmpty(menu.getParentId())){
+                menu.setParentId(null);
+            }
+
+            menu.setDelFlag(false);
+            menu.setCreateBy(subject);
+            menu.setCreateTime(new Date());
+
+            int affectCount = menuService.insert(menu);
+
+            if (affectCount > 0) {
+                msgResult.setResult(true);
+                msgResult.setData(menu);
+            } else {
+                msgResult.setResult(false);
+                msgResult.setMessage("数据库添加失败");
+            }
+        } catch (Exception ex) {
+            logger.error(ex.getMessage(), ex);
+
+            msgResult.setResult(false);
+            msgResult.setMessage(ex.getMessage());
+        }
+
+        return msgResult;
+    }
+
+    @ApiOperation(value = "获取信息")
+    @GetMapping("detail/{id}")
+    public MessageResult<Menu> detail(@PathVariable("id") String id) {
+        MessageResult<Menu> msgResult = new MessageResult<>();
+
+        try {
+            Menu menu = menuService.get(id);
+
+            if (menu != null) {
+                msgResult.setResult(true);
+                msgResult.setData(menu);
+            } else {
+                msgResult.setResult(false);
+                msgResult.setMessage("数据库不存在该记录!");
+            }
+        } catch (Exception ex) {
+            logger.error(ex.getMessage(), ex);
+
+            msgResult.setResult(false);
+            msgResult.setMessage(ex.getMessage());
+        }
+
+        return msgResult;
+    }
+
+    @ApiOperation(value = "更新用户")
+    @PostMapping("update")
+    public MessageResult<Menu> update(Menu menu, @RequestAttribute String subject) {
+        MessageResult<Menu> msgResult = new MessageResult<>();
+
+        try {
+            if (StringUtils.isEmpty(menu.getParentId())){
+                menu.setParentId(null);
+            }
+
+            menu.setUpdateBy(subject);
+            menu.setUpdateTime(new Date());
+
+            int affectCount = menuService.update(menu);
+
+            if (affectCount > 0) {
+                msgResult.setResult(true);
+                msgResult.setData(menu);
+            } else {
+                msgResult.setResult(false);
+                msgResult.setMessage("数据库更新失败");
+            }
+        } catch (Exception ex) {
+            logger.error(ex.getMessage(), ex);
+
+            msgResult.setResult(false);
+            msgResult.setMessage(ex.getMessage());
+        }
+
+        return msgResult;
+    }
+
+    @ApiOperation(value = "删除")
+    @PostMapping("delete/{id}")
+    public MessageResult<Integer> delete(@PathVariable("id") String id, @RequestAttribute String subject) {
+        MessageResult<Integer> msgResult = new MessageResult<>();
+
+        try {
+            Menu menu = menuService.get(id);
+            menu.setDelFlag(true);
+            menu.setUpdateBy(subject);
+            menu.setUpdateTime(new Date());
+
+            int affectCount = menuService.update(menu);
+
+            if (affectCount > 0) {
+                msgResult.setResult(true);
+                msgResult.setData(affectCount);
+            } else {
+                msgResult.setResult(false);
+                msgResult.setMessage("删除失败");
+            }
+        } catch (Exception ex) {
+            logger.error(ex.getMessage(), ex);
+
+            msgResult.setResult(false);
+            msgResult.setMessage(ex.getMessage());
+        }
+
+        return msgResult;
+    }
+
+
+    @ApiOperation(value = "批量删除")
+    @PostMapping("batchDelete")
+    public MessageResult<Integer> batchDelete(String ids, @RequestAttribute String subject) {
+        MessageResult<Integer> msgResult = new MessageResult<>();
+
+        try {
+            int affectCount = 0;
+
+            String[] idList = ids.split(",");
+
+            for (String id : idList) {
+                Menu menu = menuService.get(id);
+                menu.setDelFlag(true);
+                menu.setUpdateBy(subject);
+                menu.setUpdateTime(new Date());
+
+                affectCount += menuService.update(menu);
+            }
+
+            if (affectCount > 0) {
+                msgResult.setResult(true);
+                msgResult.setData(affectCount);
+            } else {
+                msgResult.setResult(false);
+                msgResult.setMessage("删除失败");
+            }
+        } catch (Exception ex) {
+            logger.error(ex.getMessage(), ex);
+
+            msgResult.setResult(false);
+            msgResult.setMessage(ex.getMessage());
+        }
+
+        return msgResult;
+    }
+
+    @ApiOperation(value = "查询")
+    @RequestMapping(value = "query", method = RequestMethod.POST)
+    public MessageResult<List> query(
+            String term,
+            String excludeId,
+            @RequestParam(value = "length", defaultValue = "20") int limit,
+            @RequestAttribute String subject) {
+        MessageResult<List> msgResult = new MessageResult<>();
+
+        Map<String, Object> searchParams = new HashMap<>();
+
+        List<Sort> sortList = new ArrayList<>();
+        sortList.add(new Sort("a.create_time", "asc"));
+
+        if (StringUtils.isNotEmpty(term)) {
+            searchParams.put("menuName", "%" + term + "%");
+        }
+
+        if (StringUtils.isNotEmpty(excludeId)) {
+            searchParams.put("excludeId", excludeId);
+        }
+
+        List<Menu> menuList = menuService.query(searchParams, limit, sortList);
+
+        msgResult.setResult(true);
+        msgResult.setData(menuList);
+
+        return msgResult;
+    }
+
+    @ApiOperation(value = "列表")
+    @RequestMapping(value = "pageList", method = RequestMethod.POST)
+    public MessageResult<Map> pageList(
+            String menuName,
+            String menuType,
+            String parentId,
+            @RequestParam(value = "start", defaultValue = "0") int start,
+            @RequestParam(value = "length", defaultValue = "20") int length,
+            @RequestAttribute String subject) {
+
+        //当前用户ID
+        System.out.println(subject);
+
+        MessageResult<Map> msgResult = new MessageResult<>();
+
+        Map<String, Object> searchParams = new HashMap<>();
+
+        List<Sort> sortList = new ArrayList<>();
+        sortList.add(new Sort("create_time", "asc"));
+
+        if (StringUtils.isNotEmpty(menuName)) {
+            searchParams.put("menuName", "%" + menuName + "%");
+        }
+
+        if (StringUtils.isNotEmpty(menuType)) {
+            searchParams.put("menuType", menuType);
+        }
+
+        if (StringUtils.isNotEmpty(parentId)) {
+            searchParams.put("parentId", parentId);
+        }
+
+        int pageIndex = start / length;
+        pageIndex++;
+
+        int pageSize = length;
+
+        Page<Menu> page = menuService.pageSearch(searchParams, pageIndex, pageSize, sortList);
+
+        msgResult.setResult(true);
+        msgResult.setData(PojoUtils.pageWrapper(page));
+
+        return msgResult;
+    }
+}

+ 398 - 0
src/main/java/com/jpsoft/ipcps/controller/MessagesController.java

@@ -0,0 +1,398 @@
+package com.jpsoft.ipcps.controller;
+
+import com.github.pagehelper.Page;
+import com.jpsoft.ipcps.common.PojoUtils;
+import com.jpsoft.ipcps.common.Sort;
+import com.jpsoft.ipcps.dto.MessageResult;
+import com.jpsoft.ipcps.entity.JpAdmin;
+import com.jpsoft.ipcps.entity.Messages;
+import com.jpsoft.ipcps.entity.ProjectQuestion;
+import com.jpsoft.ipcps.entity.Role;
+import com.jpsoft.ipcps.service.JpAdminService;
+import com.jpsoft.ipcps.service.MessagesService;
+import com.jpsoft.ipcps.service.ProcInstService;
+import com.jpsoft.ipcps.service.ProjectQuestionService;
+import io.swagger.annotations.ApiImplicitParam;
+import io.swagger.annotations.ApiImplicitParams;
+import io.swagger.annotations.ApiOperation;
+import org.activiti.engine.repository.Deployment;
+import org.activiti.engine.repository.ProcessDefinition;
+import org.activiti.engine.repository.ProcessDefinitionQuery;
+import org.apache.commons.lang3.StringUtils;
+import org.apache.ibatis.mapping.ResultMap;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+
+import javax.servlet.http.HttpServletRequest;
+import java.text.SimpleDateFormat;
+import java.util.*;
+
+@RestController
+@RequestMapping("/messages")
+public class MessagesController {
+    private Logger logger = LoggerFactory.getLogger(getClass());
+
+    @Autowired
+    private MessagesService messagesService;
+    @Autowired
+    private ProjectQuestionService projectQuestionService;
+    @Autowired
+    private ProcInstService procInstService;
+    @Autowired
+    private JpAdminService jpAdminService;
+
+    @ApiOperation(value="添加信息")
+    @PostMapping("add")
+    public MessageResult<Messages> add(@ModelAttribute Messages messages,@RequestAttribute String subject){
+        MessageResult<Messages> msgResult = new MessageResult<>();
+
+        try {
+            messages.setId(UUID.randomUUID().toString());
+            messages.setHaveRead(false);
+            messages.setDelFlag(false);
+            messages.setCreateBy(subject);
+            messages.setCreateDate(new Date());
+            messages.setUpdateBy(subject);
+            messages.setUpdateDate(new Date());
+
+            int affectCount = messagesService.insert(messages);
+
+            if (affectCount > 0) {
+                msgResult.setResult(true);
+                msgResult.setData(messages);
+            } else {
+                msgResult.setResult(false);
+                msgResult.setMessage("数据库添加失败");
+            }
+        }
+        catch(Exception ex){
+            logger.error(ex.getMessage(),ex);
+
+            msgResult.setResult(false);
+            msgResult.setMessage(ex.getMessage());
+        }
+
+        return msgResult;
+    }
+
+    @ApiOperation(value="获取信息")
+    @GetMapping("detail/{id}")
+    public MessageResult<Messages> detail(@PathVariable("id") String id){
+        MessageResult<Messages> msgResult = new MessageResult<>();
+
+        try {
+            Messages messages = messagesService.get(id);
+
+            if (messages != null) {
+                msgResult.setResult(true);
+                msgResult.setData(messages);
+            } else {
+                msgResult.setResult(false);
+                msgResult.setMessage("数据库不存在该记录!");
+            }
+        }
+        catch(Exception ex){
+            logger.error(ex.getMessage(),ex);
+
+            msgResult.setResult(false);
+            msgResult.setMessage(ex.getMessage());
+        }
+
+        return msgResult;
+    }
+
+    @ApiOperation(value="更新用户")
+    @PostMapping("update")
+    public MessageResult<Messages> update(@ModelAttribute Messages messages,@RequestAttribute String subject){
+        MessageResult<Messages> msgResult = new MessageResult<>();
+
+        try {
+            messages.setUpdateBy(subject);
+            messages.setUpdateDate(new Date());
+
+            int affectCount = messagesService.update(messages);
+
+            if (affectCount > 0) {
+                msgResult.setResult(true);
+                msgResult.setData(messages);
+            } else {
+                msgResult.setResult(false);
+                msgResult.setMessage("数据库更新失败");
+            }
+        }
+        catch(Exception ex){
+            logger.error(ex.getMessage(),ex);
+
+            msgResult.setResult(false);
+            msgResult.setMessage(ex.getMessage());
+        }
+
+        return msgResult;
+    }
+
+    @ApiOperation(value="伪删除用户")
+    @PostMapping("forgedDelete/{id}")
+    public MessageResult<Messages> forgedDelete(@PathVariable("id") String id,@RequestAttribute String subject){
+        MessageResult<Messages> msgResult = new MessageResult<>();
+
+        try {
+            Messages messages = messagesService.get(id);
+
+            messages.setDelFlag(true);
+            messages.setUpdateBy(subject);
+            messages.setUpdateDate(new Date());
+
+            int affectCount = messagesService.update(messages);
+
+            if (affectCount > 0) {
+                msgResult.setResult(true);
+                msgResult.setData(messages);
+            } else {
+                msgResult.setResult(false);
+                msgResult.setMessage("数据库更新失败");
+            }
+        }
+        catch(Exception ex){
+            logger.error(ex.getMessage(),ex);
+
+            msgResult.setResult(false);
+            msgResult.setMessage(ex.getMessage());
+        }
+
+        return msgResult;
+    }
+
+    @ApiOperation(value="删除用户")
+    @PostMapping("delete/{id}")
+    public MessageResult<Messages> delete(@PathVariable("id") String id){
+        MessageResult<Messages> msgResult = new MessageResult<>();
+
+        try {
+            int affectCount = messagesService.delete(id);
+
+            if (affectCount > 0) {
+                msgResult.setResult(true);
+            } else {
+                msgResult.setResult(false);
+                msgResult.setMessage("数据库删除失败");
+            }
+        }
+        catch(Exception ex){
+            logger.error(ex.getMessage(),ex);
+
+            msgResult.setResult(false);
+            msgResult.setMessage(ex.getMessage());
+        }
+
+        return msgResult;
+    }
+
+    @ApiOperation(value="批量删除")
+    @PostMapping("batchDelete")
+    public MessageResult<Messages> batchDelete(@RequestParam(value="ids") String ids,@RequestAttribute String subject){
+        MessageResult<Messages> msgResult = new MessageResult<>();
+
+        try{
+            msgResult.setResult(true);
+            String[] idArray = ids.split(",");
+            for(String id : idArray){
+                Messages messages = messagesService.get(id);
+                messages.setDelFlag(true);
+                messages.setUpdateBy(subject);
+                messages.setUpdateDate(new Date());
+
+                int affectCount = messagesService.update(messages);
+                if (affectCount <= 0) {
+                    msgResult.setResult(false);
+                    msgResult.setMessage("数据库删除失败");
+                }
+            }
+        }
+        catch(Exception ex) {
+            logger.error(ex.getMessage(),ex);
+
+            msgResult.setResult(false);
+            msgResult.setMessage(ex.getMessage());
+        }
+
+        return msgResult;
+    }
+
+    @ApiOperation(value="列表")
+    @RequestMapping(value = "list",method = RequestMethod.POST)
+    @ApiImplicitParams({
+            @ApiImplicitParam(name="selSendMes", paramType="query", value="消息发送人ID"),
+            @ApiImplicitParam(name="selReceiveMes", paramType="query", value="消息接收人ID"),
+            @ApiImplicitParam(name="selTitle", paramType="query", value="消息标题"),
+            @ApiImplicitParam(name="start", paramType="query", value="起始条数"),
+            @ApiImplicitParam(name="length", paramType="query", value="每页条数")
+    })
+    public MessageResult<Map> list(
+            @RequestParam(value="selSendMes",defaultValue="")String selSendMes,
+            @RequestParam(value="selReceiveMes",defaultValue="")String selReceiveMes,
+            @RequestParam(value="selTitle",defaultValue="")String selTitle,
+            @RequestParam(value="start",defaultValue="0") int start,
+            @RequestParam(value="length",defaultValue="20") int length,
+            HttpServletRequest request){
+        String subject = (String)request.getAttribute("subject");
+
+        //当前用户ID
+        System.out.println(subject);
+
+        MessageResult<Map> msgResult = new MessageResult<>();
+
+        Map<String,Object> searchParms = new HashMap<>();
+        searchParms.put("delFlag",false);
+
+        List<Sort> sortList = new ArrayList<>();
+        sortList.add(new Sort("create_date_","desc"));
+
+        if (StringUtils.isNotEmpty(selSendMes)) {
+            searchParms.put("createBy",selSendMes);
+        }
+        if (StringUtils.isNotEmpty(selReceiveMes)) {
+            searchParms.put("adminId",selReceiveMes);
+        }
+        if (StringUtils.isNotEmpty(selTitle)) {
+            searchParms.put("title","%" + selTitle + "%");
+        }
+
+        start = start + 1;
+        int pageNum = start / length;
+
+        if (pageNum == 0 || start % length != 0) {
+            pageNum++;
+        }
+
+        int pageSize = length;
+
+        Page<Messages> page = messagesService.pageSearch(searchParms,pageNum,pageSize,sortList);
+
+        msgResult.setResult(true);
+        msgResult.setData(PojoUtils.pageWrapper(page));
+
+        return msgResult;
+    }
+
+    @ApiOperation(value="消息标记已读")
+    @PostMapping("changeHaveRead/{id}")
+    public MessageResult<Messages> changeHaveRead(@PathVariable("id") String id){
+        MessageResult<Messages> msgResult = new MessageResult<>();
+
+        try {
+            Messages messages = messagesService.get(id);
+
+            messages.setHaveRead(true);
+
+            int affectCount = messagesService.update(messages);
+
+            if (affectCount > 0) {
+                msgResult.setResult(true);
+                msgResult.setData(messages);
+            } else {
+                msgResult.setResult(false);
+                msgResult.setMessage("数据库更新失败");
+            }
+        }
+        catch(Exception ex){
+            logger.error(ex.getMessage(),ex);
+
+            msgResult.setResult(false);
+            msgResult.setMessage(ex.getMessage());
+        }
+
+        return msgResult;
+    }
+
+    @ApiOperation(value="单个用户未读消息列表")
+    @PostMapping("listMessage")
+    @ApiImplicitParams({
+            @ApiImplicitParam(name="haveRead", paramType="query", value="消息已读"),
+    })
+    public MessageResult<Map> listMessage(
+            @RequestParam(value="haveRead",defaultValue="")Boolean haveRead,
+            @RequestAttribute String subject){
+        MessageResult<Map> msgResult = new MessageResult<>();
+
+        Map<String,Object> searchParms = new HashMap<>();
+        searchParms.put("delFlag",false);
+        searchParms.put("adminId",subject);
+
+        if (haveRead != null) {
+            searchParms.put("haveRead",haveRead);
+        }
+
+        List<Sort> sortList = new ArrayList<>();
+        sortList.add(new Sort("create_date_","desc"));
+
+        Page<Messages> page = messagesService.pageSearch(searchParms,1,1000,sortList);
+
+        msgResult.setResult(true);
+        msgResult.setData(PojoUtils.pageWrapper(page));
+
+        return msgResult;
+    }
+
+    @ApiOperation(value="消息转发")
+    @PostMapping("forwardedMessage")
+    @ApiImplicitParams({
+            @ApiImplicitParam(name="inRoleId", paramType="query", value="接收消息角色(部门)ID"),
+            @ApiImplicitParam(name="inQuestionId", paramType="query", value="需要转发的问题ID"),
+    })
+    public MessageResult<Messages> forwardedMessage(
+            @RequestParam(value="inRoleId",defaultValue="")String inRoleId,
+            @RequestParam(value="inQuestionId",defaultValue="")String inQuestionId,
+            @RequestAttribute String subject){
+        MessageResult<Messages> msgResult = new MessageResult<>();
+        ProjectQuestion question = projectQuestionService.get(inQuestionId);
+        JpAdmin jpAdmin = jpAdminService.get(subject);
+        List<JpAdmin> jpAdminList = jpAdminService.findUserByRoleId(inRoleId);
+
+        int affectCount = 0;
+        for(JpAdmin li : jpAdminList) {
+            Messages newMessage = new Messages();
+            newMessage.setId(UUID.randomUUID().toString());
+            newMessage.setAdminId(li.getId());
+            newMessage.setTitle("转发自" + jpAdmin.getRealName());
+            newMessage.setDetail(question.getDetail());
+            newMessage.setHaveRead(false);
+            newMessage.setDelFlag(false);
+            newMessage.setCreateBy(subject);
+            newMessage.setCreateDate(new Date());
+            newMessage.setUpdateBy(subject);
+            newMessage.setUpdateDate(new Date());
+            messagesService.insert(newMessage);
+            affectCount++;
+        }
+
+        if (affectCount > 0) {
+            msgResult.setResult(true);
+            msgResult.setMessage("发送" + affectCount + "条消息。");
+        } else {
+            msgResult.setResult(false);
+            msgResult.setMessage("数据库添加失败");
+        }
+
+        return msgResult;
+    }
+
+    @ApiOperation(value="转发人员")
+    @PostMapping("forwardedUser")
+    @ApiImplicitParams({
+            @ApiImplicitParam(name="questionId", paramType="query", value="问题ID")
+    })
+    public MessageResult<List<Role>> forwardedUser(
+            @RequestParam(value="questionId",defaultValue="")String questionId){
+        MessageResult<List<Role>> msgResult = new MessageResult<>();
+
+        ProjectQuestion question = projectQuestionService.get(questionId);
+        List<Role> roleList = procInstService.findRelatedRole(question.getProjectId());
+
+        msgResult.setResult(true);
+        msgResult.setData(roleList);
+
+        return msgResult;
+    }
+}

+ 910 - 0
src/main/java/com/jpsoft/ipcps/controller/MonthPlanController.java

@@ -0,0 +1,910 @@
+package com.jpsoft.ipcps.controller;
+
+import com.github.pagehelper.Page;
+import com.jpsoft.ipcps.common.PojoUtils;
+import com.jpsoft.ipcps.common.Sort;
+import com.jpsoft.ipcps.dto.MessageResult;
+import com.jpsoft.ipcps.entity.*;
+import com.jpsoft.ipcps.service.*;
+import io.swagger.annotations.ApiImplicitParam;
+import io.swagger.annotations.ApiImplicitParams;
+import io.swagger.annotations.ApiOperation;
+import org.activiti.engine.repository.Deployment;
+import org.activiti.engine.repository.ProcessDefinition;
+import org.activiti.engine.repository.ProcessDefinitionQuery;
+import org.apache.commons.lang3.StringUtils;
+import org.apache.ibatis.mapping.ResultMap;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+
+import javax.servlet.http.HttpServletRequest;
+import java.text.ParseException;
+import java.text.SimpleDateFormat;
+import java.util.*;
+
+@RestController
+@RequestMapping("/monthPlan")
+public class MonthPlanController {
+    private Logger logger = LoggerFactory.getLogger(getClass());
+
+    @Autowired
+    private MonthPlanService monthPlanService;
+    @Autowired
+    private MonthPlanMatterService monthPlanMatterService;
+    @Autowired
+    private ProcInstToDoService procInstToDoService;
+    @Autowired
+    private ProjectService projectService;
+    @Autowired
+    private ProcInstTemplateService procInstTemplateService;
+    @Autowired
+    private ProcDefTemplateStepService procDefTemplateStepService;
+    @Autowired
+    private ProcDefStepToDoService procDefStepToDoService;
+    @Autowired
+    private ParkService parkService;
+    @Autowired
+    private JpAdminService jpAdminService;
+    @Autowired
+    private AdminRoleService adminRoleService;
+
+    @ApiOperation(value="获取信息")
+    @GetMapping("detail")
+    @ApiImplicitParams({
+            @ApiImplicitParam(name="selProjectId", paramType="query", required=true, value="项目ID"),
+            @ApiImplicitParam(name="selYear", paramType="query", required=true, value="年份"),
+            @ApiImplicitParam(name="selMonth", paramType="query", required=true, value="月份")
+    })
+    public MessageResult<Map> detail(
+            @RequestParam(value="selProjectId",defaultValue="")String selProjectId,
+            @RequestParam(value="selYear",defaultValue="")String selYear,
+            @RequestParam(value="selMonth",defaultValue="")String selMonth,
+            @RequestAttribute String subject){
+        MessageResult<Map> msgResult = new MessageResult<>();
+
+        try {
+            List<Sort> sortList = new ArrayList<>();
+            sortList.add(new Sort("id_","asc"));
+
+            Map<String,Object> searchParms = new HashMap<>();
+            searchParms.put("delFlag",false);
+            searchParms.put("adminId",subject);
+            searchParms.put("projectId",selProjectId);
+            searchParms.put("year",selYear);
+            searchParms.put("month",selMonth);
+
+            Page<MonthPlan> page = monthPlanService.pageSearch(searchParms,1,10,sortList);
+            MonthPlan monthPlan = new MonthPlan();
+            List<MonthPlanMatter> listMonthPlanMatter = new ArrayList();
+            Map<String,Object> map = new HashMap<>();
+            if (page.getTotal() > 0) {
+                monthPlan = page.get(0);
+
+                Map<String,Object> searchParmsM = new HashMap<>();
+                searchParmsM.put("planId",monthPlan.getId());
+                Page<MonthPlanMatter> pageM = monthPlanMatterService.pageSearch(searchParmsM,1,100,sortList);
+                listMonthPlanMatter = pageM.getResult();
+            }
+            map.put("monthPlan",monthPlan);
+            map.put("listMonthPlanMatter",queryTodoListByProjectId(selProjectId,listMonthPlanMatter));
+
+            msgResult.setResult(true);
+            msgResult.setData(map);
+        }
+        catch(Exception ex){
+            logger.error(ex.getMessage(),ex);
+
+            msgResult.setResult(false);
+            msgResult.setMessage(ex.getMessage());
+        }
+
+        return msgResult;
+    }
+
+    @ApiOperation(value="保存")
+    @PostMapping("save")
+    @ApiImplicitParams({
+            @ApiImplicitParam(name="todoids", paramType="query", value="事项ID"),
+    })
+    public MessageResult<Map> save(
+            @RequestParam(value="todoids",defaultValue="")String todoids,
+            @ModelAttribute MonthPlan monthPlan,
+            @RequestAttribute String subject){
+        MessageResult<Map> msgResult = new MessageResult<>();
+
+        try {
+            int affectCount = 0;
+            if(StringUtils.isBlank(monthPlan.getId())){
+                monthPlan.setId(UUID.randomUUID().toString());
+                monthPlan.setAdminId(subject);
+                monthPlan.setFinished(false);
+                monthPlan.setDelFlag(false);
+                monthPlan.setCreateBy(subject);
+                monthPlan.setCreateDate(new Date());
+                monthPlan.setUpdateBy(subject);
+                monthPlan.setUpdateDate(new Date());
+
+                affectCount = monthPlanService.insert(monthPlan);
+            }
+            else {
+                monthPlan.setUpdateBy(subject);
+                monthPlan.setUpdateDate(new Date());
+
+                affectCount = monthPlanService.update(monthPlan);
+            }
+
+            Map<String,Object> map = new HashMap<>();
+            map.put("monthPlan",monthPlan);
+            map.put("listMonthPlanMatter",saveMatter(monthPlan.getProjectId(),monthPlan.getId(),todoids));
+
+            if (affectCount > 0) {
+                msgResult.setResult(true);
+                msgResult.setData(map);
+            } else {
+                msgResult.setResult(false);
+                msgResult.setMessage("数据库提交失败");
+            }
+        }
+        catch(Exception ex){
+            logger.error(ex.getMessage(),ex);
+
+            msgResult.setResult(false);
+            msgResult.setMessage(ex.getMessage());
+        }
+
+        return msgResult;
+    }
+
+    public List<Map<String,Object>> queryTodoListByProjectId(String projectId, List<MonthPlanMatter> list){
+        List<Map<String,Object>> mapList = new ArrayList<>();
+
+//        projectId = "e985c6ae-3eac-44d4-8dcc-804a4a99e37b";
+
+        Project project = projectService.get(projectId);
+
+        String procInstId = project.getProcInstId();
+
+        ProcInstTemplate template = procInstTemplateService.get(procInstId);
+
+        String templateId = template.getTemplateId();
+
+        //根据模板查询每一步的待办(排除已经在流程中勾选的事项)
+        List<ProcDefTemplateStep> stepList = procDefTemplateStepService.findByTemplateId(templateId);
+
+        for (ProcDefTemplateStep step : stepList) {
+            System.out.println(step.getNo() + "步骤:" + step.getTitle());
+
+            List<ProcDefStepToDo> stepTodoList  = procDefStepToDoService.findByStepId(step.getId());
+
+            List<Map> doneList = procInstToDoService.findByProcInstIdAndTaskDefKey(procInstId,step.getTaskDefKey());
+
+            HashSet<String> doneSet = new HashSet<>();
+
+            for (Map map : doneList) {
+                String todoId = (String)map.get("todoId");
+                Boolean checked = (Boolean)map.get("checked");
+
+                if (checked){
+                    doneSet.add(todoId);
+                }
+            }
+
+            for (ProcDefStepToDo todo :stepTodoList) {
+                // 未完成事项
+                if (!doneSet.contains(todo.getId())) {
+                    Map<String,Object> map = new HashMap<>();
+                    map.put("todoid",todo.getId());
+                    map.put("todotitle",step.getTitle());
+                    map.put("tododetail",todo.getDetail());
+                    map.put("selected",false);
+                    for (MonthPlanMatter li : list){
+                        if(li.getTodoId().equals(todo.getId())){
+                            map.put("selected",true);
+                            break;
+                        }
+                    }
+                    mapList.add(map);
+                }
+            }
+        }
+
+        return mapList;
+    }
+
+    public List<Map<String,Object>> saveMatter(String projectId,String planId, String todoIds){
+        List<Map<String,Object>> mapList = new ArrayList<>();
+        Map<String, Object> searchParms = new HashMap<>();
+        searchParms.put("planId",planId);
+        List<Sort> sortList = new ArrayList<>();
+        sortList.add(new Sort("id_","asc"));
+
+        Page<MonthPlanMatter> page = monthPlanMatterService.pageSearch(searchParms, 1, 100, sortList);
+        for(MonthPlanMatter matter : page.getResult()){
+            monthPlanMatterService.delete(matter.getId());
+        }
+
+        String[] todoid = todoIds.split(",");
+        for (String id : todoid){
+                MonthPlanMatter monthPlanMatter = new MonthPlanMatter();
+                monthPlanMatter.setId(UUID.randomUUID().toString());
+                monthPlanMatter.setPlanId(planId);
+                monthPlanMatter.setTodoId(id);
+                monthPlanMatterService.insert(monthPlanMatter);
+
+                Map<String,Object> map = new HashMap<>();
+                map.put("id",monthPlanMatter.getId());
+                map.put("planid",monthPlanMatter.getPlanId());
+                map.put("todoid",monthPlanMatter.getTodoId());
+                mapList.add(map);
+        }
+
+        return mapList;
+    }
+
+    @ApiOperation(value="秘书工作完成情况")
+    @GetMapping("secretaryWork")
+    @ApiImplicitParams({
+            @ApiImplicitParam(name="selYear", paramType="query", required=true, value="年份"),
+            @ApiImplicitParam(name="selMonth", paramType="query", required=true, value="月份")
+    })
+    public MessageResult<List<Map<String,Object>>> secretaryWork(
+            @RequestParam(value="selYear",defaultValue="")String selYear,
+            @RequestParam(value="selMonth",defaultValue="")String selMonth){
+        MessageResult<List<Map<String,Object>>> msgResult = new MessageResult<>();
+        List<Map<String,Object>> mapList = new ArrayList<>();
+
+        try {
+            List<String> selAdminIds = projectService.listAdminId();
+            for(String li : selAdminIds){
+                JpAdmin jpAdmin = jpAdminService.get(li);
+
+                List<Sort> sortList = new ArrayList<>();
+                sortList.add(new Sort("id_","asc"));
+                Map<String,Object> searchParms = new HashMap<>();
+                searchParms.put("delFlag",false);
+                searchParms.put("adminId",li);
+                searchParms.put("year",selYear);
+                searchParms.put("month",selMonth);
+
+                int finished = 0;
+                int unfinished = 0;
+                Page<MonthPlan> page = monthPlanService.pageSearch(searchParms,1,1000,sortList);
+                for(MonthPlan plan : page.getResult()){
+                    if(plan.getFinished())
+                        finished++;
+                    else
+                        unfinished++;
+                }
+                Map<String,Object> map = new HashMap<>();
+                map.put("adminId",jpAdmin.getId());
+                map.put("adminName",jpAdmin.getRealName());
+                map.put("adminOrg",jpAdmin.getOrg().getOrgName());
+                map.put("adminTel",jpAdmin.getTel());
+                map.put("total",page.getTotal());
+                map.put("finished",finished);
+                map.put("unfinished",unfinished);
+                mapList.add(map);
+            }
+
+            msgResult.setResult(true);
+            msgResult.setData(mapList);
+        }
+        catch(Exception ex){
+            logger.error(ex.getMessage(),ex);
+
+            msgResult.setResult(false);
+            msgResult.setMessage(ex.getMessage());
+        }
+
+        return msgResult;
+    }
+
+    @ApiOperation(value="月份事项推进")
+    @GetMapping("mattersProgress")
+    @ApiImplicitParams({
+            @ApiImplicitParam(name="selYear", paramType="query", required=true, value="年份"),
+            @ApiImplicitParam(name="selMonth", paramType="query", required=true, value="月份")
+    })
+    public MessageResult<List<Map<String,Object>>> mattersProgress(
+            @RequestParam(value="selYear",defaultValue="")String selYear,
+            @RequestParam(value="selMonth",defaultValue="")String selMonth,
+            @RequestAttribute String subject){
+        MessageResult<List<Map<String,Object>>> msgResult = new MessageResult<>();
+        List<Map<String,Object>> mapList = new ArrayList<>();
+
+        try {
+            List<Sort> sortList = new ArrayList<>();
+            sortList.add(new Sort("id_","asc"));
+            List<Sort> sortList1 = new ArrayList<>();
+            sortList1.add(new Sort("project_id_","asc"));
+            Map<String,Object> searchParms = new HashMap<>();
+            searchParms.put("delFlag",false);
+            searchParms.put("BLLD",subject);
+
+            Page<Project> page = projectService.pageSearch(searchParms,1,1000,sortList1);
+            for(Project project : page.getResult()){
+                List<String> listTodo = new ArrayList<>();
+                Map<String,Object> map = new HashMap<>();
+
+                Map<String,Object> searchParmsP = new HashMap<>();
+                searchParmsP.put("delFlag",false);
+                searchParmsP.put("projectId",project.getProjectId());
+                searchParmsP.put("year",selYear);
+                searchParmsP.put("month",selMonth);
+                Page<MonthPlan> pageP = monthPlanService.pageSearch(searchParmsP,1,1000,sortList);
+                for(MonthPlan monthPlan : pageP.getResult()){
+                    Map<String,Object> searchParmsM = new HashMap<>();
+                    searchParmsM.put("planId",monthPlan.getId());
+                    Page<MonthPlanMatter> pageM = monthPlanMatterService.pageSearch(searchParmsM,1,1000,sortList);
+                    for(MonthPlanMatter monthPlanMatter : pageM.getResult()){
+                        ProcDefStepToDo stepTodoList  = procDefStepToDoService.get(monthPlanMatter.getTodoId());
+                        listTodo.add(stepTodoList.getDetail());
+                    }
+                }
+
+                if(listTodo.size() != 0) {
+                    map.put("title", project.getTitle());
+                    map.put("unit", project.getUnit());
+                    map.put("listTodo", listTodo);
+                    mapList.add(map);
+                }
+            }
+
+            msgResult.setResult(true);
+            msgResult.setData(mapList);
+        }
+        catch(Exception ex){
+            logger.error(ex.getMessage(),ex);
+
+            msgResult.setResult(false);
+            msgResult.setMessage(ex.getMessage());
+        }
+
+        return msgResult;
+    }
+
+    @ApiOperation(value="园区项目推进")
+    @GetMapping("parkProjectAdvance")
+    public MessageResult<Map<String,Object>> parkProjectAdvance(@RequestAttribute String subject){
+        MessageResult<Map<String,Object>> msgResult = new MessageResult<>();
+        List<Map<String,Object>> mapList = new ArrayList<>();
+
+        try {
+            List<Sort> sortList = new ArrayList<>();
+            sortList.add(new Sort("create_date_","asc"));
+            Map<String,Object> searchParms1 = new HashMap<>();
+            searchParms1.put("delFlag",false);
+
+            Boolean bl = false;
+            List<AdminRole> adminRoleList = adminRoleService.listByAdminId(subject);
+            for(AdminRole adminRole : adminRoleList){
+                //包联领导
+                if(adminRole.getRoleId().equals("3322648c-0923-4064-a208-e2d944e2eaa4")){
+                    Map<String,Object> searchParms = new HashMap<>();
+                    searchParms.put("delFlag", false);
+                    searchParms.put("BLLD",subject);
+                    Page<Project> page = projectService.pageSearch2(searchParms,1,1000,sortList);
+                    if(page.getResult().size() > 0){
+                        searchParms1.put("id",page.getResult().get(0).getParkId());
+                        bl = true;
+                    }
+                }
+                //园区办
+                if(adminRole.getRoleId().equals("5e99a5ba-1196-47af-8333-b2f69868e168")){
+                    searchParms1.put("adminId",subject);
+                    bl = true;
+                }
+                //总领导、投资促进中心
+                if(adminRole.getRoleId().equals("9e4d7f91-ce1e-4e88-92b7-9799dd130a15") || adminRole.getRoleId().equals("8787ebf1-ce72-4e47-9ab1-a71b7e6d8ad5")){
+                    bl = true;
+                }
+            }
+            searchParms1.put("show",bl);
+
+            Map<String,Object> searchParms2 = new HashMap<>();
+            searchParms2.put("delFlag",false);
+
+            int sum0 = 0;
+            int sum1 = 0;
+            int sum2 = 0;
+            int sum3 = 0;
+            int sumTotal = 0;
+            Page<Park> page1 = parkService.pageSearch(searchParms1,1,1000,sortList);
+            for(Park park : page1.getResult()){
+                searchParms2.put("parkId",park.getParkId());
+//                searchParms2.put("BLLD",subject);
+                Page<Project> page2 = projectService.pageSearch2(searchParms2,1,1000,sortList);
+                int t0 = 0;
+                int t1 = 0;
+                int t2 = 0;
+                int t3 = 0;
+                int tTotal = 0;
+                for(Project project : page2.getResult()){
+                    if("ProjectPerformanceTransfer".equals(project.getProcDefKey())) {
+                        t1++;
+                    }
+                    if("ProjectStartUpConstruction".equals(project.getProcDefKey())) {
+                        t2++;
+                    }
+                    if("ProjectCompletedAndPutIntoOperation".equals(project.getProcDefKey())){
+                        if("3".equals(project.getStatus())){
+                            t0++;
+                        }
+                        else{
+                            t3++;
+                        }
+                    }
+                }
+                tTotal = t3 + t2;
+
+                Map<String,Object> mapli = new HashMap<>();
+                mapli.put("parkId",park.getParkId());
+                mapli.put("parkName",park.getTitle());
+                mapli.put("t0",t0);
+                mapli.put("t1",t1);
+                mapli.put("t2",t2);
+                mapli.put("t3",t3);
+                mapli.put("tTotal",tTotal);
+                mapList.add(mapli);
+
+                sum0 += t0;
+                sum1 += t1;
+                sum2 += t2;
+                sum3 += t3;
+                sumTotal += tTotal;
+            }
+            Map<String,Object> map = new HashMap<>();
+            map.put("sum0",sum0);
+            map.put("sum1",sum1);
+            map.put("sum2",sum2);
+            map.put("sum3",sum3);
+            map.put("sumTotal",sumTotal);
+            map.put("list",mapList);
+
+            msgResult.setResult(true);
+            msgResult.setData(map);
+        }
+        catch(Exception ex){
+            logger.error(ex.getMessage(),ex);
+
+            msgResult.setResult(false);
+            msgResult.setMessage(ex.getMessage());
+        }
+
+        return msgResult;
+    }
+
+    @ApiOperation(value="项目月度统计")
+    @GetMapping("projectMonthlyStatistics")
+    @ApiImplicitParams({
+            @ApiImplicitParam(name="selYear", paramType="query", required=true, value="年份"),
+            @ApiImplicitParam(name="selMonth", paramType="query", required=true, value="月份")
+    })
+    public MessageResult<Map<String,Object>> projectMonthlyStatistics(
+            @RequestParam(value="selYear",defaultValue="")String selYear,
+            @RequestParam(value="selMonth",defaultValue="")String selMonth,
+            @RequestAttribute String subject){
+        MessageResult<Map<String,Object>> msgResult = new MessageResult<>();
+        List<Map<String,Object>> mapList = new ArrayList<>();
+        selMonth = String.format("%02d", Integer.parseInt(selMonth));
+
+        try {
+            SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
+            Date date = dateFormat.parse(selYear + "-" + selMonth + "-01 00:00:00");
+            Calendar rightNow = Calendar.getInstance();
+            rightNow.setTime(date);
+            rightNow.add(Calendar.MONTH,1);
+            rightNow.add(Calendar.SECOND,-1);
+            date = rightNow.getTime();
+
+            List<AdminRole> adminRole = adminRoleService.listByAdminId(subject);
+            List<Sort> sortList = new ArrayList<>();
+            sortList.add(new Sort("create_date_","asc"));
+            Map<String,Object> searchParms = new HashMap<>();
+            searchParms.put("delFlag",false);
+            //searchParms.put("timeNode3",dateFormat.format(date));
+            for(AdminRole li : adminRole) {
+                //包联领导
+                if ("3322648c-0923-4064-a208-e2d944e2eaa4".equals(li.getRoleId())) {
+                    searchParms.put("BLLD", subject);
+                }
+                //园区办
+                if ("5e99a5ba-1196-47af-8333-b2f69868e168".equals(li.getRoleId())) {
+                    Map<String, Object> searchParmsPark = new HashMap<>();
+                    searchParmsPark.put("delFlag", false);
+                    searchParmsPark.put("adminId", subject);
+                    Page<Park> pagePark = parkService.pageSearch(searchParmsPark, 1, 1000, sortList);
+                    if (pagePark.getTotal() > 0) {
+                        searchParms.put("parkId", pagePark.getResult().get(0).getParkId());
+                    }
+                }
+            }
+
+            List<Project> list0 = new ArrayList<>();
+            List<Project> list1 = new ArrayList<>();
+            List<Project> list2 = new ArrayList<>();
+            Page<Project> page = projectService.pageSearch2(searchParms,1,1000,sortList);
+            int now = Integer.parseInt(selYear + selMonth);
+            int sum0 = 0;
+            int sum1 = 0;
+            int sum2 = 0;
+            int sumTotal = (int) page.getTotal();
+            for(Project project : page.getResult()){
+                SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyyMM");
+                if(project.getTimeNode1() != null){
+                    int date1 = Integer.parseInt(simpleDateFormat.format(project.getTimeNode1()));
+                    if(now == date1) {
+                        sum0++;
+                        list0.add(project);
+                    }
+                    if(project.getTimeNode2() != null){
+                        int date2 = Integer.parseInt(simpleDateFormat.format(project.getTimeNode2()));
+                        if(now == date2) {
+                            sum1++;
+                            list1.add(project);
+                        }
+                        if(project.getTimeNode3() != null){
+                            int date3 = Integer.parseInt(simpleDateFormat.format(project.getTimeNode3()));
+                            if(now == date3){
+                                sum2++;
+                                list2.add(project);
+                            }
+                        }
+                    }
+                }
+            }
+
+            Map<String,Object> map = new HashMap<>();
+            map.put("sum0",sum0);
+            map.put("sort0",sorting(list0));
+            map.put("sum1",sum1);
+            map.put("sort1",sorting(list1));
+            map.put("sum2",sum2);
+            map.put("sort2",sorting(list2));
+            map.put("sumTotal",sumTotal);
+
+            msgResult.setResult(true);
+            msgResult.setData(map);
+        }
+        catch(Exception ex){
+            logger.error(ex.getMessage(),ex);
+
+            msgResult.setResult(false);
+            msgResult.setMessage(ex.getMessage());
+        }
+
+        return msgResult;
+    }
+
+    private Map<String,Object> sorting(List<Project> list){
+        Map<String,Object> map = new HashMap<>();
+        int count = 0 ;
+        for(Project project : list){
+            if(map.get(project.getPark().getTitle()) == null){
+                map.put(project.getPark().getTitle(), 1);
+
+                List<Project> listProject = new ArrayList<>();
+                listProject.add(project);
+                map.put("list" + project.getPark().getTitle(), listProject);
+            }
+            else{
+                count = (Integer) map.get(project.getPark().getTitle()) + 1;
+                map.put(project.getPark().getTitle(), count);
+
+                List<Project> listProject = (List<Project>)map.get("list" + project.getPark().getTitle());
+                listProject.add(project);
+                map.put("list" + project.getPark().getTitle(), listProject);
+            }
+        }
+
+        return map;
+    }
+
+    private List<Map<String,Object>> sortingNum(List<Project> list){
+        List<Map<String,Object>> reList = new ArrayList<>();
+
+        List<Park> parkList = parkService.list();
+        for(Park park : parkList){
+            int num = 0;
+            for(Project project : list){
+                if(project.getParkId().equals(park.getParkId())){
+                    num++;
+                }
+            }
+
+            Map<String,Object> map = new HashMap<>();
+            map.put("id", park.getParkId());
+            map.put("name", park.getTitle());
+            map.put("num", num);
+            reList.add(map);
+        }
+
+        return reList;
+    }
+
+    @ApiOperation(value="项目月度统计-所有园区")
+    @GetMapping("projectMonthlyStatisticsAll")
+    @ApiImplicitParams({
+            @ApiImplicitParam(name="selYear", paramType="query", required=true, value="年份"),
+            @ApiImplicitParam(name="selMonth", paramType="query", required=true, value="月份")
+    })
+    public MessageResult<Map<String,Object>> projectMonthlyStatisticsAll(
+            @RequestParam(value="selYear",defaultValue="")String selYear,
+            @RequestParam(value="selMonth",defaultValue="")String selMonth,
+            @RequestAttribute String subject){
+        MessageResult<Map<String,Object>> msgResult = new MessageResult<>();
+        List<Map<String,Object>> mapList = new ArrayList<>();
+
+        try {
+            List<Project> list0 = projectService.listForTimeNode(1, selYear, selMonth);
+            List<Project> list1 = projectService.listForTimeNode(2, selYear, selMonth);
+            List<Project> list2 = projectService.listForTimeNode(3, selYear, selMonth);
+
+            Map<String,Object> map = new HashMap<>();
+            map.put("sum0",list0.size());
+            map.put("sort0",list0);
+            map.put("sum1",list1.size());
+            map.put("sort1",list1);
+            map.put("sum2",list2.size());
+            map.put("sort2",list2);
+            map.put("sumTotal",list0.size() + list1.size() + list2.size());
+
+            msgResult.setResult(true);
+            msgResult.setData(map);
+        }
+        catch(Exception ex){
+            logger.error(ex.getMessage(),ex);
+
+            msgResult.setResult(false);
+            msgResult.setMessage(ex.getMessage());
+        }
+
+        return msgResult;
+    }
+
+    @ApiOperation(value="项目统计-所有园区")
+    @GetMapping("projectStatisticsAll")
+    @ApiImplicitParams({
+            @ApiImplicitParam(name = "year", paramType = "query", value = "年份")
+    })
+    public MessageResult<Map<String,Object>> projectStatisticsAll(
+            @RequestParam(value = "year", defaultValue = "") String year,
+            @RequestAttribute String subject) throws ParseException {
+        MessageResult<Map<String,Object>> msgResult = new MessageResult<>();
+        List<Map<String,Object>> mapList = new ArrayList<>();
+
+        if(StringUtils.isEmpty(year)){
+            Calendar date = Calendar.getInstance();
+            year = String.valueOf(date.get(Calendar.YEAR));
+        }
+
+        try {
+            List<Project> list0 = projectService.listForTimeNode(1, year, null);
+            List<Project> list1 = projectService.listForTimeNode(2, year, null);
+            List<Project> list2 = projectService.listForTimeNode(3, year, null);
+
+            Map<String,Object> map = new HashMap<>();
+            map.put("sum0",list0.size());
+            map.put("sort0",sortingNum(list0));
+            map.put("sum1",list1.size());
+            map.put("sort1",sortingNum(list1));
+            map.put("sum2",list2.size());
+            map.put("sort2",sortingNum(list2));
+            map.put("sumTotal",list0.size() + list1.size() + list2.size());
+
+            msgResult.setResult(true);
+            msgResult.setData(map);
+        }
+        catch(Exception ex){
+            logger.error(ex.getMessage(),ex);
+
+            msgResult.setResult(false);
+            msgResult.setMessage(ex.getMessage());
+        }
+
+        return msgResult;
+    }
+
+    @ApiOperation(value="在建列表")
+    @RequestMapping(value = "listBuilding",method = RequestMethod.POST)
+    @ApiImplicitParams({
+            @ApiImplicitParam(name = "parkId", paramType = "query", value = "园区ID"),
+            @ApiImplicitParam(name = "projectName", paramType = "query", value = "项目名称"),
+            @ApiImplicitParam(name = "startTime", paramType = "query", value = "开始时间"),
+            @ApiImplicitParam(name = "endTime", paramType = "query", value = "结束时间"),
+            @ApiImplicitParam(name="start", paramType="query", value="起始条数"),
+            @ApiImplicitParam(name="length", paramType="query", value="每页条数")
+    })
+    public MessageResult<Map> listBuilding(
+            @RequestParam(value = "parkId", defaultValue = "") String parkId,
+            @RequestParam(value = "projectName", defaultValue = "") String projectName,
+            @RequestParam(value = "startTime", defaultValue = "") String startTime,
+            @RequestParam(value = "endTime", defaultValue = "") String endTime,
+            @RequestParam(value="start",defaultValue="0")int start,
+            @RequestParam(value="length",defaultValue="20")int length,
+            @RequestAttribute String subject){
+        //当前用户ID
+        System.out.println(subject);
+
+        Boolean bl = false;
+        List<AdminRole> adminRole = adminRoleService.listByAdminId(subject);
+
+        MessageResult<Map> msgResult = new MessageResult<>();
+
+        List<Sort> sortList = new ArrayList<>();
+        sortList.add(new Sort("park_id_","asc"));
+
+        Map<String,Object> searchParms = new HashMap<>();
+        searchParms.put("delFlag",false);
+        searchParms.put("status",2);
+        searchParms.put("procDefKey","ProjectCompletedAndPutIntoOperation");
+        if(StringUtils.isNoneEmpty(parkId)){
+            searchParms.put("parkId", parkId);
+        }
+
+        for(AdminRole li : adminRole){
+            //包联领导
+            if ("3322648c-0923-4064-a208-e2d944e2eaa4".equals(li.getRoleId())) {
+                Map<String, Object> searchParmsProject = new HashMap<>();
+                searchParmsProject.put("delFlag", false);
+                searchParmsProject.put("BLLD", subject);
+                Page<Project> pageProject = projectService.pageSearch(searchParmsProject, 1, 1000, sortList);
+                if (pageProject.getTotal() > 0) {
+                    searchParms.put("parkId", pageProject.getResult().get(0).getParkId());
+                }
+            }
+            //园区办
+            if ("5e99a5ba-1196-47af-8333-b2f69868e168".equals(li.getRoleId())) {
+                Map<String, Object> searchParmsPark = new HashMap<>();
+                searchParmsPark.put("delFlag", false);
+                searchParmsPark.put("adminId", subject);
+                Page<Park> pagePark = parkService.pageSearch(searchParmsPark, 1, 1000, sortList);
+                if (pagePark.getTotal() > 0) {
+                    searchParms.put("parkId", pagePark.getResult().get(0).getParkId());
+                }
+            }
+            //总领导、投资促进中心
+            if(li.getRoleId().equals("9e4d7f91-ce1e-4e88-92b7-9799dd130a15") || li.getRoleId().equals("8787ebf1-ce72-4e47-9ab1-a71b7e6d8ad5")){
+                bl = true;
+            }
+        }
+        searchParms.put("show",bl);
+
+//        if (StringUtils.isNotEmpty(selParkId)) {
+//            searchParms.put("parkId",selParkId);
+//        }
+        if (StringUtils.isNotEmpty(projectName)) {
+            //标题
+            searchParms.put("projectName", "%" + projectName + "%");
+        }
+        if (StringUtils.isNotEmpty(startTime)) {
+            //起始时间-起
+            searchParms.put("startTime", startTime);
+        }
+        if (StringUtils.isNotEmpty(endTime)) {
+            //起始时间-止
+            searchParms.put("endTime", endTime);
+        }
+
+        start = start + 1;
+        int pageNum = start / length;
+
+        if (pageNum == 0 || start % length != 0) {
+            pageNum++;
+        }
+
+        int pageSize = length;
+
+        Page<Project> page = projectService.pageSearch(searchParms,pageNum,pageSize,sortList);
+
+        msgResult.setResult(true);
+        msgResult.setData(PojoUtils.pageWrapper(page));
+
+        return msgResult;
+    }
+
+    @ApiOperation(value="拟建列表")
+    @RequestMapping(value = "listReadyBuild",method = RequestMethod.POST)
+    @ApiImplicitParams({
+            @ApiImplicitParam(name = "parkId", paramType = "query", value = "园区ID"),
+            @ApiImplicitParam(name = "projectName", paramType = "query", value = "项目名称"),
+            @ApiImplicitParam(name = "startTime", paramType = "query", value = "开始时间"),
+            @ApiImplicitParam(name = "endTime", paramType = "query", value = "结束时间"),
+            @ApiImplicitParam(name="start", paramType="query", value="起始条数"),
+            @ApiImplicitParam(name="length", paramType="query", value="每页条数")
+    })
+    public MessageResult<Map> listReadyBuild(
+            @RequestParam(value = "parkId", defaultValue = "") String parkId,
+            @RequestParam(value = "projectName", defaultValue = "") String projectName,
+            @RequestParam(value = "startTime", defaultValue = "") String startTime,
+            @RequestParam(value = "endTime", defaultValue = "") String endTime,
+            @RequestParam(value="start",defaultValue="0")int start,
+            @RequestParam(value="length",defaultValue="20")int length,
+            @RequestAttribute String subject){
+        //当前用户ID
+        System.out.println(subject);
+
+        Boolean bl = false;
+        List<AdminRole> adminRole = adminRoleService.listByAdminId(subject);
+
+        MessageResult<Map> msgResult = new MessageResult<>();
+
+        List<String> inList = new ArrayList<>();
+        inList.add("ProjectPerformanceTransfer");
+        inList.add("ProjectStartUpConstruction");
+
+        List<Sort> sortList = new ArrayList<>();
+        sortList.add(new Sort("park_id_","asc"));
+
+        Map<String,Object> searchParms = new HashMap<>();
+        searchParms.put("delFlag",false);
+        searchParms.put("ready",1);
+        //searchParms.put("timeNode1Null",true);
+        searchParms.put("procDefKeyIn",inList);
+        if(StringUtils.isNoneEmpty(parkId)){
+            searchParms.put("parkId", parkId);
+        }
+
+        for(AdminRole li : adminRole){
+            //包联领导
+            if ("3322648c-0923-4064-a208-e2d944e2eaa4".equals(li.getRoleId())) {
+                Map<String, Object> searchParmsProject = new HashMap<>();
+                searchParmsProject.put("delFlag", false);
+                searchParmsProject.put("BLLD", subject);
+                Page<Project> pageProject = projectService.pageSearch(searchParmsProject, 1, 1000, sortList);
+                if (pageProject.getTotal() > 0) {
+                    searchParms.put("parkId", pageProject.getResult().get(0).getParkId());
+                }
+            }
+            //园区办
+            if ("5e99a5ba-1196-47af-8333-b2f69868e168".equals(li.getRoleId())) {
+                Map<String, Object> searchParmsPark = new HashMap<>();
+                searchParmsPark.put("delFlag", false);
+                searchParmsPark.put("adminId", subject);
+                Page<Park> pagePark = parkService.pageSearch(searchParmsPark, 1, 1000, sortList);
+                if (pagePark.getTotal() > 0) {
+                    searchParms.put("parkId", pagePark.getResult().get(0).getParkId());
+                }
+            }
+            //总领导、投资促进中心
+            if(li.getRoleId().equals("9e4d7f91-ce1e-4e88-92b7-9799dd130a15") || li.getRoleId().equals("8787ebf1-ce72-4e47-9ab1-a71b7e6d8ad5")){
+                bl = true;
+            }
+        }
+        searchParms.put("show",bl);
+
+//        if (StringUtils.isNotEmpty(selParkId)) {
+//            searchParms.put("parkId",selParkId);
+//        }
+        if (StringUtils.isNotEmpty(projectName)) {
+            //标题
+            searchParms.put("projectName", "%" + projectName + "%");
+        }
+        if (StringUtils.isNotEmpty(startTime)) {
+            //起始时间-起
+            searchParms.put("startTime", startTime);
+        }
+        if (StringUtils.isNotEmpty(endTime)) {
+            //起始时间-止
+            searchParms.put("endTime", endTime);
+        }
+
+        start = start + 1;
+        int pageNum = start / length;
+
+        if (pageNum == 0 || start % length != 0) {
+            pageNum++;
+        }
+
+        int pageSize = length;
+
+        Page<Project> page = projectService.pageSearch(searchParms,pageNum,pageSize,sortList);
+
+        msgResult.setResult(true);
+        msgResult.setData(PojoUtils.pageWrapper(page));
+
+        return msgResult;
+    }
+}

+ 193 - 0
src/main/java/com/jpsoft/ipcps/controller/MonthPlanMatterController.java

@@ -0,0 +1,193 @@
+package com.jpsoft.ipcps.controller;
+
+import com.github.pagehelper.Page;
+import com.jpsoft.ipcps.common.Sort;
+import com.jpsoft.ipcps.dto.MessageResult;
+import com.jpsoft.ipcps.entity.MonthPlanMatter;
+import com.jpsoft.ipcps.service.MonthPlanMatterService;
+import io.swagger.annotations.ApiOperation;
+import org.activiti.engine.repository.Deployment;
+import org.activiti.engine.repository.ProcessDefinition;
+import org.activiti.engine.repository.ProcessDefinitionQuery;
+import org.apache.commons.lang3.StringUtils;
+import org.apache.ibatis.mapping.ResultMap;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+
+import javax.servlet.http.HttpServletRequest;
+import java.text.SimpleDateFormat;
+import java.util.*;
+
+@RestController
+@RequestMapping("/monthPlanMatter")
+public class MonthPlanMatterController {
+    private Logger logger = LoggerFactory.getLogger(getClass());
+
+    @Autowired
+    private MonthPlanMatterService monthPlanMatterService;
+
+    @ApiOperation(value="添加信息")
+    @PostMapping("add")
+    public MessageResult<MonthPlanMatter> add(@ModelAttribute MonthPlanMatter monthPlanMatter){
+        MessageResult<MonthPlanMatter> msgResult = new MessageResult<>();
+
+        try {
+            monthPlanMatter.setId(UUID.randomUUID().toString());
+
+            int affectCount = monthPlanMatterService.insert(monthPlanMatter);
+
+            if (affectCount > 0) {
+                msgResult.setResult(true);
+                msgResult.setData(monthPlanMatter);
+            } else {
+                msgResult.setResult(false);
+                msgResult.setMessage("数据库添加失败");
+            }
+        }
+        catch(Exception ex){
+            logger.error(ex.getMessage(),ex);
+
+            msgResult.setResult(false);
+            msgResult.setMessage(ex.getMessage());
+        }
+
+        return msgResult;
+    }
+
+    @ApiOperation(value="获取信息")
+    @GetMapping("detail/{id}")
+    public MessageResult<MonthPlanMatter> detail(@PathVariable("id") String id){
+        MessageResult<MonthPlanMatter> msgResult = new MessageResult<>();
+
+        try {
+            MonthPlanMatter monthPlanMatter = monthPlanMatterService.get(id);
+
+            if (monthPlanMatter != null) {
+                msgResult.setResult(true);
+                msgResult.setData(monthPlanMatter);
+            } else {
+                msgResult.setResult(false);
+                msgResult.setMessage("数据库不存在该记录!");
+            }
+        }
+        catch(Exception ex){
+            logger.error(ex.getMessage(),ex);
+
+            msgResult.setResult(false);
+            msgResult.setMessage(ex.getMessage());
+        }
+
+        return msgResult;
+    }
+
+    @ApiOperation(value="更新用户")
+    @PostMapping("update")
+    public MessageResult<MonthPlanMatter> update(@ModelAttribute MonthPlanMatter monthPlanMatter){
+        MessageResult<MonthPlanMatter> msgResult = new MessageResult<>();
+
+        try {
+            int affectCount = monthPlanMatterService.update(monthPlanMatter);
+
+            if (affectCount > 0) {
+                msgResult.setResult(true);
+                msgResult.setData(monthPlanMatter);
+            } else {
+                msgResult.setResult(false);
+                msgResult.setMessage("数据库更新失败");
+            }
+        }
+        catch(Exception ex){
+            logger.error(ex.getMessage(),ex);
+
+            msgResult.setResult(false);
+            msgResult.setMessage(ex.getMessage());
+        }
+
+        return msgResult;
+    }
+
+    @ApiOperation(value="删除用户")
+    @PostMapping("delete/{id}")
+    public MessageResult<MonthPlanMatter> delete(@PathVariable("id") String id){
+        MessageResult<MonthPlanMatter> msgResult = new MessageResult<>();
+
+        try {
+            int affectCount = monthPlanMatterService.delete(id);
+
+            if (affectCount > 0) {
+                msgResult.setResult(true);
+            } else {
+                msgResult.setResult(false);
+                msgResult.setMessage("数据库删除失败");
+            }
+        }
+        catch(Exception ex){
+            logger.error(ex.getMessage(),ex);
+
+            msgResult.setResult(false);
+            msgResult.setMessage(ex.getMessage());
+        }
+
+        return msgResult;
+    }
+
+
+    @ApiOperation(value="批量删除")
+    @PostMapping("batchDelete/{id}")
+    public MessageResult<MonthPlanMatter> batchDelete(@PathVariable("id") String id){
+        MessageResult<MonthPlanMatter> msgResult = new MessageResult<>();
+
+        msgResult.setResult(false);
+        msgResult.setMessage("未实现");
+
+        return msgResult;
+    }
+
+    @ApiOperation(value="列表")
+    @RequestMapping(value = "list",method = RequestMethod.POST)
+    public MessageResult<Map> list(
+            String id,
+            @RequestParam(value="draw",defaultValue="1") int draw,
+            @RequestParam(value="start",defaultValue="1") int start,
+            @RequestParam(value="length",defaultValue="20") int length,
+            HttpServletRequest request){
+        String subject = (String)request.getAttribute("subject");
+
+        //当前用户ID
+        System.out.println(subject);
+
+        MessageResult<Map> msgResult = new MessageResult<>();
+
+        Map<String,Object> searchParms = new HashMap<>();
+
+        List<Sort> sortList = new ArrayList<>();
+        sortList.add(new Sort("id_","asc"));
+
+        if (StringUtils.isNotEmpty(id)) {
+            searchParms.put("id","%" + id + "%");
+        }
+
+        int pageNum = start / length;
+
+        if (start % length != 0) {
+            pageNum++;
+        }
+
+        int pageSize = length;
+
+        Page<MonthPlanMatter> page = monthPlanMatterService.pageSearch(searchParms,pageNum,pageSize,sortList);
+
+        HashMap<String, Object> wrapper = new HashMap<String, Object>();
+        wrapper.put("draw",draw);
+        wrapper.put("recordsTotal", page.getTotal());
+        wrapper.put("recordsFiltered", page.getTotal());
+        wrapper.put("data", page.getResult());
+
+        msgResult.setResult(true);
+        msgResult.setData(wrapper);
+
+        return msgResult;
+    }
+}

+ 286 - 0
src/main/java/com/jpsoft/ipcps/controller/OrgController.java

@@ -0,0 +1,286 @@
+package com.jpsoft.ipcps.controller;
+
+import com.github.pagehelper.Page;
+import com.jpsoft.ipcps.common.Sort;
+import com.jpsoft.ipcps.dto.MessageResult;
+import com.jpsoft.ipcps.entity.Org;
+import com.jpsoft.ipcps.service.JpAdminService;
+import com.jpsoft.ipcps.service.OrgService;
+import io.swagger.annotations.ApiOperation;
+import org.activiti.engine.repository.Deployment;
+import org.activiti.engine.repository.ProcessDefinition;
+import org.activiti.engine.repository.ProcessDefinitionQuery;
+import org.apache.commons.lang3.StringUtils;
+import org.apache.ibatis.mapping.ResultMap;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+
+import javax.servlet.http.HttpServletRequest;
+import java.text.SimpleDateFormat;
+import java.util.*;
+
+@RestController
+@RequestMapping("/org")
+public class OrgController {
+    private Logger logger = LoggerFactory.getLogger(getClass());
+
+    @Autowired
+    private OrgService orgService;
+
+    @ApiOperation(value="添加信息")
+    @PostMapping("add")
+    public MessageResult<Org> add(@ModelAttribute Org org){
+        MessageResult<Org> msgResult = new MessageResult<>();
+
+        try {
+            org.setOrgId(UUID.randomUUID().toString());
+
+            List<Org> list = orgService.listByOrder();
+
+            if(list.size()>0){
+                int num = list.get(0).getOrgOrder();
+                org.setOrgOrder(num+1);
+            }
+            else{
+                org.setOrgOrder(1);
+            }
+
+            org.setDelFlag(false);
+            org.setType(0);
+            int affectCount = orgService.insert(org);
+
+            if (affectCount > 0) {
+                msgResult.setResult(true);
+                msgResult.setData(org);
+            } else {
+                msgResult.setResult(false);
+                msgResult.setMessage("数据库添加失败");
+            }
+        }
+        catch(Exception ex){
+            logger.error(ex.getMessage(),ex);
+
+            msgResult.setResult(false);
+            msgResult.setMessage(ex.getMessage());
+        }
+
+        return msgResult;
+    }
+
+    @ApiOperation(value="获取信息")
+    @GetMapping("detail/{id}")
+    public MessageResult<Org> detail(@PathVariable("id") String id){
+        MessageResult<Org> msgResult = new MessageResult<>();
+
+        try {
+            Org org = orgService.get(id);
+
+            if (org != null) {
+                msgResult.setResult(true);
+                msgResult.setData(org);
+            } else {
+                msgResult.setResult(false);
+                msgResult.setMessage("数据库不存在该记录!");
+            }
+        }
+        catch(Exception ex){
+            logger.error(ex.getMessage(),ex);
+
+            msgResult.setResult(false);
+            msgResult.setMessage(ex.getMessage());
+        }
+
+        return msgResult;
+    }
+
+    @ApiOperation(value="更新用户")
+    @PostMapping("update")
+    public MessageResult<Org> update(@ModelAttribute Org org){
+        MessageResult<Org> msgResult = new MessageResult<>();
+
+        try {
+            int affectCount = orgService.update(org);
+
+            if (affectCount > 0) {
+                msgResult.setResult(true);
+                msgResult.setData(org);
+            } else {
+                msgResult.setResult(false);
+                msgResult.setMessage("数据库更新失败");
+            }
+        }
+        catch(Exception ex){
+            logger.error(ex.getMessage(),ex);
+
+            msgResult.setResult(false);
+            msgResult.setMessage(ex.getMessage());
+        }
+
+        return msgResult;
+    }
+
+    @ApiOperation(value="删除用户")
+    @PostMapping("delete/{id}")
+    public MessageResult<Org> delete(@PathVariable("id") String id){
+        MessageResult<Org> msgResult = new MessageResult<>();
+
+        try {
+            Org org = orgService.get(id);
+
+            org.setDelFlag(true);
+
+            int affectCount = orgService.update(org);
+
+            if (affectCount > 0) {
+                msgResult.setResult(true);
+            } else {
+                msgResult.setResult(false);
+                msgResult.setMessage("数据库删除失败");
+            }
+        }
+        catch(Exception ex){
+            logger.error(ex.getMessage(),ex);
+
+            msgResult.setResult(false);
+            msgResult.setMessage(ex.getMessage());
+        }
+
+        return msgResult;
+    }
+
+
+    @ApiOperation(value="批量删除")
+    @PostMapping("batchDelete")
+    public MessageResult<Org> batchDelete(String ids){
+        MessageResult<Org> msgResult = new MessageResult<>();
+
+        try{
+            String[] arr = ids.split(",");
+            for(String id : arr){
+                Org org = orgService.get(id);
+                org.setDelFlag(true);
+                orgService.update(org);
+            }
+            msgResult.setResult(true);
+        }catch (Exception ex) {
+            logger.error(ex.getMessage(), ex);
+            msgResult.setResult(false);
+            msgResult.setMessage(ex.getMessage());
+        }
+
+        return msgResult;
+    }
+
+    @ApiOperation(value="列表")
+    @RequestMapping(value = "list",method = RequestMethod.POST)
+    public MessageResult<Map> list(
+            @RequestParam(value="orgName",defaultValue="")String orgName,
+            @RequestParam(value="draw",defaultValue="1") int draw,
+            @RequestParam(value="start",defaultValue="1") int start,
+            @RequestParam(value="length",defaultValue="20") int length,
+            HttpServletRequest request){
+        String subject = (String)request.getAttribute("subject");
+
+        //当前用户ID
+        System.out.println(subject);
+
+        MessageResult<Map> msgResult = new MessageResult<>();
+
+        Map<String,Object> searchParms = new HashMap<>();
+
+        List<Sort> sortList = new ArrayList<>();
+        sortList.add(new Sort("org_order_","desc"));
+
+        if (StringUtils.isNotEmpty(orgName)) {
+            searchParms.put("orgName","%" + orgName + "%");
+        }
+
+        int pageNum = start / length;
+
+        pageNum++;
+
+        int pageSize = length;
+
+        Page<Org> page = orgService.pageSearch(searchParms,pageNum,pageSize,sortList);
+
+        HashMap<String, Object> wrapper = new HashMap<String, Object>();
+        wrapper.put("draw",draw);
+        wrapper.put("recordsTotal", page.getTotal());
+        wrapper.put("recordsFiltered", page.getTotal());
+        wrapper.put("data", page.getResult());
+
+        msgResult.setResult(true);
+        msgResult.setData(wrapper);
+
+        return msgResult;
+    }
+
+
+    @ApiOperation(value="全部列表")
+    @RequestMapping(value = "allList")
+    public MessageResult<List<Org>> allList(HttpServletRequest request){
+        MessageResult<List<Org>> msgResult = new MessageResult<>();
+        List<Org> list = orgService.list();
+        msgResult.setResult(true);
+        msgResult.setData(list);
+        return msgResult;
+    }
+
+    @ApiOperation(value="调整单位顺序")
+    @RequestMapping(value = "move",method = RequestMethod.POST)
+    public MessageResult<Org> move(String parm,String orgId){
+        MessageResult<Org> msgResult = new MessageResult<>();
+        Org org = orgService.get(orgId);
+        List<Org> list = orgService.listByOrder();
+        boolean rs = false;
+        String msg = "";
+
+        int max = list.get(0).getOrgOrder();
+        int order = org.getOrgOrder();
+
+        if("up".equals(parm)){
+            //向上移动
+            if(order == max){
+                msg = "已经是最后一行了!";
+            }
+            else{
+                Org temp = orgService.getByOrder(order+1);
+                temp.setOrgOrder(order);
+                int affectCount = orgService.update(temp);
+                org.setOrgOrder(order+1);
+                int affectCount2 = orgService.update(org);
+                if(affectCount==1&&affectCount2==1){
+                    rs = true;
+                }
+                else{
+                    msgResult.setMessage("数据库更新失败");
+                }
+            }
+        }
+        else{
+            //向下移动
+            if(order == 1){
+                msg ="已经是第一行了!";
+            }
+            else{
+                Org temp = orgService.getByOrder(order-1);
+                temp.setOrgOrder(order);
+                int affectCount = orgService.update(temp);
+                org.setOrgOrder(order-1);
+                int affectCount2 = orgService.update(org);
+                if(affectCount==1&&affectCount2==1){
+                    rs = true;
+                }
+                else{
+                    msgResult.setMessage("数据库更新失败");
+                }
+            }
+        }
+        msgResult.setResult(rs);
+        msgResult.setMessage(msg);
+
+        return msgResult;
+    }
+}

+ 435 - 0
src/main/java/com/jpsoft/ipcps/controller/ParkController.java

@@ -0,0 +1,435 @@
+package com.jpsoft.ipcps.controller;
+
+import com.github.pagehelper.Page;
+import com.jpsoft.ipcps.common.PojoUtils;
+import com.jpsoft.ipcps.common.Sort;
+import com.jpsoft.ipcps.dto.MessageResult;
+import com.jpsoft.ipcps.entity.*;
+import com.jpsoft.ipcps.service.*;
+import io.swagger.annotations.ApiImplicitParam;
+import io.swagger.annotations.ApiImplicitParams;
+import io.swagger.annotations.ApiOperation;
+import org.activiti.engine.repository.Deployment;
+import org.activiti.engine.repository.ProcessDefinition;
+import org.activiti.engine.repository.ProcessDefinitionQuery;
+import org.apache.commons.lang3.StringUtils;
+import org.apache.ibatis.mapping.ResultMap;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+
+import javax.servlet.http.HttpServletRequest;
+import java.text.SimpleDateFormat;
+import java.util.*;
+
+@RestController
+@RequestMapping("/park")
+public class ParkController {
+    private Logger logger = LoggerFactory.getLogger(getClass());
+
+    @Autowired
+    private ParkService parkService;
+
+    @Autowired
+    private JpAdminService jpAdminService;
+
+    @Autowired
+    private ParkAdminService parkAdminService;
+
+    @Autowired
+    private ParkOrgService parkOrgService;
+
+    @Autowired
+    private DepartmentService departmentService;
+
+    @ApiOperation(value="添加信息")
+    @PostMapping("add")
+    public MessageResult<Park> add(@ModelAttribute Park park,
+                                   String[] checkedAdmins,
+                                   String[] checkedOrgs,
+                                   String[] checkedTowns,
+                                   @RequestAttribute String subject,HttpServletRequest req){
+        MessageResult<Park> msgResult = new MessageResult<>();
+
+        try {
+            park.setParkId(UUID.randomUUID().toString());
+            park.setDelFlag(false);
+            park.setCreateBy(subject);
+            park.setCreateDate(new Date());
+            park.setUpdateBy(subject);
+            park.setUpdateDate(new Date());
+
+            int affectCount = parkService.insert(park);
+
+            if (affectCount > 0) {
+                for (String adminId : checkedAdmins){
+                    JpAdmin jpAdmin = jpAdminService.get(adminId);
+                    ParkAdmin item = new ParkAdmin();
+
+                    item.setId(UUID.randomUUID().toString());
+                    item.setParkId(park.getParkId());
+                    item.setAdminId(jpAdmin.getId());
+                    item.setAdminName(jpAdmin.getRealName());
+
+                    parkAdminService.insert(item);
+                }
+
+                if(checkedOrgs!=null) {
+                    for (String orgId : checkedOrgs) {
+                        ParkOrg item = new ParkOrg();
+
+                        item.setId(UUID.randomUUID().toString());
+                        item.setParkId(park.getParkId());
+                        item.setOrgId(orgId);
+
+                        parkOrgService.insert(item);
+                    }
+                }
+
+                if(checkedTowns!=null){
+                    for (String item : checkedTowns) {
+                        String[] arr = item.split("\\|");
+
+                        Department department = new Department();
+
+                        department.setId(UUID.randomUUID().toString());
+                        department.setParkId(park.getParkId());
+                        department.setOrgId(arr[0]);
+                        department.setName(arr[1]);
+
+                        departmentService.insert(department);
+                    }
+                }
+
+                msgResult.setResult(true);
+                msgResult.setData(park);
+            } else {
+                msgResult.setResult(false);
+                msgResult.setMessage("数据库添加失败");
+            }
+        }
+        catch(Exception ex){
+            logger.error(ex.getMessage(),ex);
+
+            msgResult.setResult(false);
+            msgResult.setMessage(ex.getMessage());
+        }
+
+        return msgResult;
+    }
+
+    @ApiOperation(value="获取信息")
+    @GetMapping("detail/{id}")
+    public MessageResult<Park> detail(@PathVariable("id") String id){
+        MessageResult<Park> msgResult = new MessageResult<>();
+
+        try {
+            Park park = parkService.get(id);
+
+            List<ParkAdmin> parkAdminList = parkAdminService.findParkAdminByParkId(id);
+            park.setParkAdminList(parkAdminList);
+
+            List<ParkOrg> parkOrgList = parkOrgService.findParkOrgByParkId(id);
+            park.setParkOrgList(parkOrgList);
+
+            List<Department> parkTownList = departmentService.findByParkId(id);
+            park.setParkTownList(parkTownList);
+
+            if (park != null) {
+                msgResult.setResult(true);
+                msgResult.setData(park);
+            } else {
+                msgResult.setResult(false);
+                msgResult.setMessage("数据库不存在该记录!");
+            }
+        }
+        catch(Exception ex){
+            logger.error(ex.getMessage(),ex);
+
+            msgResult.setResult(false);
+            msgResult.setMessage(ex.getMessage());
+        }
+
+        return msgResult;
+    }
+
+    @ApiOperation(value="根据Token获取园区信息")
+    @RequestMapping(value = "detailForToken",method = RequestMethod.POST)
+    public MessageResult<Park> detailForToken(@RequestAttribute String subject){
+        //当前用户ID
+        System.out.println(subject);
+
+        MessageResult<Park> msgResult = new MessageResult<>();
+
+        Map<String,Object> searchParams = new HashMap<>();
+        searchParams.put("delFlag",false);
+        searchParams.put("adminId",subject);
+        List<Sort> sortList = new ArrayList<>();
+        sortList.add(new Sort("order_id_","desc"));
+
+        Park park = new Park();
+        Page<Park> page = parkService.pageSearch(searchParams,1,1000,sortList);
+        if(page.getTotal() > 0){
+            park = page.get(0);
+        }
+
+        msgResult.setResult(true);
+        msgResult.setData(park);
+
+        return msgResult;
+    }
+
+    @ApiOperation(value="更新用户")
+    @PostMapping("update")
+    public MessageResult<Park> update(@ModelAttribute Park park,
+                                      String[] checkedAdmins,
+                                      String[] checkedOrgs,
+                                      String[] checkedTowns,
+                                      @RequestAttribute String subject,HttpServletRequest req){
+        MessageResult<Park> msgResult = new MessageResult<>();
+
+        try {
+            park.setUpdateBy(subject);
+            park.setUpdateDate(new Date());
+
+            int affectCount = parkService.update(park);
+
+            if (affectCount > 0) {
+                parkAdminService.deleteByParkId(park.getParkId());
+
+                for (String adminId : checkedAdmins){
+                    JpAdmin jpAdmin = jpAdminService.get(adminId);
+                    ParkAdmin item = new ParkAdmin();
+
+                    item.setId(UUID.randomUUID().toString());
+                    item.setParkId(park.getParkId());
+                    item.setAdminId(jpAdmin.getId());
+                    item.setAdminName(jpAdmin.getRealName());
+
+                    parkAdminService.insert(item);
+                }
+
+                parkOrgService.deleteByParkId(park.getParkId());
+
+                if(checkedOrgs!=null) {
+                    for (String orgId : checkedOrgs) {
+                        ParkOrg item = new ParkOrg();
+
+                        item.setId(UUID.randomUUID().toString());
+                        item.setParkId(park.getParkId());
+                        item.setOrgId(orgId);
+
+                        parkOrgService.insert(item);
+                    }
+                }
+
+                departmentService.deleteByParkId(park.getParkId());
+
+                if(checkedTowns!=null){
+                    for (String item : checkedTowns) {
+                        String[] arr = item.split("\\|");
+
+                        Department department = new Department();
+
+                        department.setId(UUID.randomUUID().toString());
+                        department.setParkId(park.getParkId());
+                        department.setOrgId(arr[0]);
+                        department.setName(arr[1]);
+
+                        departmentService.insert(department);
+                    }
+                }
+
+                msgResult.setResult(true);
+                msgResult.setData(park);
+            } else {
+                msgResult.setResult(false);
+                msgResult.setMessage("数据库更新失败");
+            }
+        }
+        catch(Exception ex){
+            logger.error(ex.getMessage(),ex);
+
+            msgResult.setResult(false);
+            msgResult.setMessage(ex.getMessage());
+        }
+
+        return msgResult;
+    }
+
+    @ApiOperation(value="伪删除用户")
+    @PostMapping("forgedDelete/{id}")
+    public MessageResult<Park> forgedDelete(@PathVariable("id") String id,@RequestAttribute String subject){
+        MessageResult<Park> msgResult = new MessageResult<>();
+
+        try {
+            Park park = parkService.get(id);
+
+            park.setDelFlag(true);
+            park.setUpdateBy(subject);
+            park.setUpdateDate(new Date());
+
+            int affectCount = parkService.update(park);
+
+            if (affectCount > 0) {
+                msgResult.setResult(true);
+                msgResult.setData(park);
+            } else {
+                msgResult.setResult(false);
+                msgResult.setMessage("数据库更新失败");
+            }
+        }
+        catch(Exception ex){
+            logger.error(ex.getMessage(),ex);
+
+            msgResult.setResult(false);
+            msgResult.setMessage(ex.getMessage());
+        }
+
+        return msgResult;
+    }
+
+    @ApiOperation(value="删除用户")
+    @PostMapping("delete/{id}")
+    public MessageResult<Park> delete(@PathVariable("id") String id){
+        MessageResult<Park> msgResult = new MessageResult<>();
+
+        try {
+            int affectCount = parkService.delete(id);
+
+            if (affectCount > 0) {
+                msgResult.setResult(true);
+            } else {
+                msgResult.setResult(false);
+                msgResult.setMessage("数据库删除失败");
+            }
+        }
+        catch(Exception ex){
+            logger.error(ex.getMessage(),ex);
+
+            msgResult.setResult(false);
+            msgResult.setMessage(ex.getMessage());
+        }
+
+        return msgResult;
+    }
+
+
+    @ApiOperation(value="批量删除")
+    @PostMapping("batchDelete")
+    public MessageResult<Park> batchDelete(@RequestParam(value="ids") String ids,@RequestAttribute String subject){
+        MessageResult<Park> msgResult = new MessageResult<>();
+
+        try{
+            msgResult.setResult(true);
+            String[] idArray = ids.split(",");
+            for(String id : idArray){
+                Park park = parkService.get(id);
+                park.setDelFlag(true);
+                park.setUpdateBy(subject);
+                park.setUpdateDate(new Date());
+
+                int affectCount = parkService.update(park);
+                if (affectCount <= 0) {
+                    msgResult.setResult(false);
+                    msgResult.setMessage("数据库删除失败");
+                }
+            }
+        }
+        catch(Exception ex) {
+            logger.error(ex.getMessage(),ex);
+
+            msgResult.setResult(false);
+            msgResult.setMessage(ex.getMessage());
+        }
+
+        return msgResult;
+    }
+
+    @ApiOperation(value="列表")
+    @RequestMapping(value = "list",method = RequestMethod.POST)
+    @ApiImplicitParams({
+            @ApiImplicitParam(name="selAdminName", paramType="query", value="包联领导ID"),
+            @ApiImplicitParam(name="selTitle", paramType="query", value="园区名称"),
+            @ApiImplicitParam(name="start", paramType="query", value="起始条数"),
+            @ApiImplicitParam(name="length", paramType="query", value="每页条数")
+    })
+    public MessageResult<Map> list(
+            @RequestParam(value="selTitle",defaultValue="")String selTitle,
+            @RequestParam(value="selAdminName",defaultValue="")String selAdminName,
+            @RequestParam(value="start",defaultValue="0")int start,
+            @RequestParam(value="length",defaultValue="20")int length,
+            @RequestAttribute String subject){
+        //当前用户ID
+        System.out.println(subject);
+
+        MessageResult<Map> msgResult = new MessageResult<>();
+
+        Map<String,Object> searchParms = new HashMap<>();
+        searchParms.put("delFlag",false);
+
+        List<Sort> sortList = new ArrayList<>();
+        sortList.add(new Sort("order_id_","desc"));
+
+        if (StringUtils.isNotEmpty(selAdminName)) {
+            searchParms.put("adminId",selAdminName);
+        }
+        if (StringUtils.isNotEmpty(selTitle)) {
+            searchParms.put("title","%" + selTitle + "%");
+        }
+
+        start = start + 1;
+        int pageNum = start / length;
+
+        if (pageNum == 0 || start % length != 0) {
+            pageNum++;
+        }
+
+        int pageSize = length;
+
+        Page<Park> page = parkService.pageSearch(searchParms,pageNum,pageSize,sortList);
+        for (Park item : page){
+            String id = item.getParkId();
+            List<ParkAdmin> parkAdminList = parkAdminService.findParkAdminByParkId(id);
+            item.setParkAdminList(parkAdminList);
+        }
+
+        msgResult.setResult(true);
+        msgResult.setData(PojoUtils.pageWrapper(page));
+
+        return msgResult;
+    }
+
+    @ApiOperation(value="全部列表")
+    @RequestMapping(value = "allList",method = RequestMethod.POST)
+    public MessageResult<List<Park>> allList(HttpServletRequest request){
+        MessageResult<List<Park>> msgResult = new MessageResult<>();
+        List<Park> list = parkService.list();
+        msgResult.setResult(true);
+        msgResult.setData(list);
+        return msgResult;
+    }
+
+//    @ApiOperation(value="AdminId转一对多数据写入")
+//    @RequestMapping(value = "aaaaaa",method = RequestMethod.POST)
+//    public MessageResult<Map> aaaaaa(HttpServletRequest request){
+//        MessageResult<Map> msgResult = new MessageResult<>();
+//
+//        List<Park> list = parkService.list();
+//        for(Park park : list){
+//            if(StringUtils.isNotEmpty(park.getAdminId())) {
+//                JpAdmin jpAdmin = jpAdminService.get(park.getAdminId());
+//                ParkAdmin item = new ParkAdmin();
+//                item.setId(UUID.randomUUID().toString());
+//                item.setParkId(park.getParkId());
+//                item.setAdminId(jpAdmin.getId());
+//                item.setAdminName(jpAdmin.getRealName());
+//                parkAdminService.insert(item);
+//            }
+//        }
+//
+//        msgResult.setResult(true);
+//        return msgResult;
+//    }
+}

+ 310 - 0
src/main/java/com/jpsoft/ipcps/controller/ProcDefController.java

@@ -0,0 +1,310 @@
+package com.jpsoft.ipcps.controller;
+
+import com.jpsoft.ipcps.common.PojoUtils;
+import com.jpsoft.ipcps.common.WorkflowConstants;
+import com.jpsoft.ipcps.dto.MessageResult;
+import com.jpsoft.ipcps.entity.ProcDefTemplate;
+import com.jpsoft.ipcps.entity.ProcDefTemplateStep;
+import com.jpsoft.ipcps.service.ProcDefTemplateService;
+import com.jpsoft.ipcps.service.ProcDefTemplateStepService;
+import com.jpsoft.ipcps.utils.ProcDefLoader;
+import io.swagger.annotations.ApiImplicitParam;
+import io.swagger.annotations.ApiImplicitParams;
+import io.swagger.annotations.ApiOperation;
+import org.activiti.engine.RepositoryService;
+import org.activiti.engine.repository.Deployment;
+import org.activiti.engine.repository.ProcessDefinition;
+import org.activiti.engine.repository.ProcessDefinitionQuery;
+import org.apache.commons.lang3.StringUtils;
+import org.dom4j.Document;
+import org.dom4j.io.SAXReader;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+import org.springframework.web.multipart.MultipartFile;
+
+import javax.servlet.http.HttpServletRequest;
+import java.io.InputStream;
+import java.net.URLDecoder;
+import java.text.SimpleDateFormat;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+@RequestMapping(value = "procDef")
+@RestController
+public class ProcDefController {
+    @Autowired
+    private RepositoryService repositoryService;
+
+    @Autowired
+    private ProcDefTemplateStepService tmplStepService;
+
+    @Autowired
+    private ProcDefTemplateService procDefTemplateService;
+
+    private Logger logger = LoggerFactory.getLogger(getClass());
+
+    @ApiOperation(value="发布")
+    @RequestMapping(value = "deploy",method = RequestMethod.POST)
+    public MessageResult<String> deploy(MultipartFile procDefFile){
+        MessageResult msgResult = new MessageResult<>();
+
+        try {
+            repositoryService.createDeployment()
+                    .addInputStream(procDefFile.getOriginalFilename(), procDefFile.getInputStream())
+                    .tenantId("jpsoft")
+                    .deploy();
+
+            msgResult.setResult(true);
+        }
+        catch(Exception ex){
+            msgResult.setResult(false);
+            msgResult.setMessage(ex.getMessage());
+        }
+
+        return msgResult;
+    }
+
+    @ApiOperation(value="流程定义列表")
+    @RequestMapping(value = "list",method = RequestMethod.POST)
+    public MessageResult<Map> list(
+            String name,
+            @RequestParam(value="draw",defaultValue="1") int draw,
+            @RequestParam(value="start",defaultValue="0") int start,
+            @RequestParam(value="length",defaultValue="20") int length,
+            HttpServletRequest request){
+        String subject = (String)request.getAttribute("subject");
+
+        System.out.println(subject);
+
+        MessageResult<Map> msgResult = new MessageResult<>();
+
+        ProcessDefinitionQuery query = repositoryService.createProcessDefinitionQuery()
+                .processDefinitionTenantId(WorkflowConstants.TENANT)
+                .latestVersion();
+
+        if (StringUtils.isNotEmpty(name)) {
+            query.processDefinitionNameLike("%" + name + "%");
+        }
+
+        long count = query.count();
+
+        List<ProcessDefinition> list  = query.orderByProcessDefinitionName().asc().listPage(start, length);
+
+        List<Map> mapList = new ArrayList<Map>();
+
+        SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
+
+        //查询流程定义部署时间
+        for (ProcessDefinition pd : list) {
+            HashMap<String,Object> map = processDef2Map(pd);
+
+            Deployment deployment =	repositoryService.createDeploymentQuery()
+                    .deploymentId(pd.getDeploymentId())
+                    .singleResult();
+
+            map.put("deploymentTime", df.format(deployment.getDeploymentTime()));
+
+            mapList.add(map);
+        }
+
+        HashMap<String, Object> resultMap = new HashMap<String, Object>();
+        resultMap.put("draw",draw);
+        resultMap.put("recordsTotal", count);
+        resultMap.put("recordsFiltered", count);
+        resultMap.put("data", mapList);
+
+        msgResult.setResult(true);
+        msgResult.setData(resultMap);
+
+        return msgResult;
+    }
+
+    private HashMap<String, Object> processDef2Map(ProcessDefinition pd) {
+        HashMap<String,Object> map = new HashMap<>();
+
+        map.put("id", pd.getId());
+        map.put("key", pd.getKey());
+        map.put("deploymentId", pd.getDeploymentId());
+        map.put("name", pd.getName());
+        map.put("description", pd.getDescription());
+        map.put("version", pd.getVersion());
+        map.put("suspended", pd.isSuspended());
+
+        return map;
+    }
+
+    @ApiOperation(value="删除流程定义")
+    @RequestMapping(value = "delete/{id}",method = RequestMethod.GET)
+    public MessageResult<String> delete(@PathVariable(value="id") String id){
+        MessageResult<String> msgResult = new MessageResult<>();
+
+        try{
+            repositoryService.deleteDeployment(id, true);
+            msgResult.setResult(true);
+        }
+        catch(Exception ex){
+            msgResult.setResult(false);
+            msgResult.setMessage(ex.getMessage());
+
+            logger.error(ex.getMessage(),ex);
+        }
+
+        return msgResult;
+    }
+
+    @ApiOperation(value="获取")
+    @GetMapping("detail/{id}")
+    public MessageResult<Map> detail(@PathVariable("id") String id){
+        MessageResult<Map> msgResult = new MessageResult<>();
+
+        try {
+            ProcessDefinition pd = repositoryService
+                    .createProcessDefinitionQuery()
+                    .processDefinitionId(id).singleResult();
+
+            if (pd != null) {
+                msgResult.setResult(true);
+                msgResult.setData(processDef2Map(pd));
+            } else {
+                msgResult.setResult(false);
+                msgResult.setMessage("数据库不存在该记录!");
+            }
+        }
+        catch(Exception ex){
+            logger.error(ex.getMessage(),ex);
+
+            msgResult.setResult(false);
+            msgResult.setMessage(ex.getMessage());
+        }
+
+        return msgResult;
+    }
+
+    @GetMapping(value = "loadDiagram")
+    @ResponseBody
+    @ApiImplicitParams({
+            @ApiImplicitParam(name="procDefKey", paramType="query",required = true, value="流程定义关键字"),
+            @ApiImplicitParam(name="templateId", paramType="query",required = false, value="流程模板编号")
+    })
+    public MessageResult<Map> loadDiagram(@RequestParam  String procDefKey,String templateId){
+        MessageResult<Map> msgResult = new MessageResult<>();
+        HashMap<String,Object> map = new HashMap<String, Object>();
+
+        try{
+            ProcessDefinition pd = repositoryService.createProcessDefinitionQuery()
+                    .processDefinitionKey(procDefKey)
+                    .latestVersion()
+                    .singleResult();
+
+            InputStream inputStream = repositoryService.getResourceAsStream(pd.getDeploymentId(),pd.getResourceName());
+
+            SAXReader reader = new SAXReader();
+
+            reader.setEncoding("UTF-8");
+            Document doc = reader.read(inputStream);
+
+            //查找start
+            List<Map> startNodeList = ProcDefLoader.findElements(doc,"startEvent");
+            map.put("startNodeList", startNodeList);
+
+            //查找end
+            List<Map> endNodeList = ProcDefLoader.findElements(doc,"endEvent");
+            map.put("endNodeList", endNodeList);
+
+            //查找所有用户节点
+            List<Map> taskList = ProcDefLoader.findUserTasks(doc);
+
+            if (StringUtils.isNotEmpty(templateId)) {
+                List<ProcDefTemplateStep> stepList = tmplStepService.findByTemplateId(templateId);
+
+                for (ProcDefTemplateStep step: stepList) {
+                    for (Map taskMap: taskList) {
+                        if (step.getTaskDefKey().equals(taskMap.get("id").toString())){
+                            taskMap.put("step",step);
+                            break;
+                        }
+                    }
+                }
+            }
+
+            map.put("taskList", taskList);
+
+            //查找所连接线
+            List<Map> seqFlowList = ProcDefLoader.findSequenceFlows(doc);
+            map.put("seqFlowList", seqFlowList);
+
+            //查询exclusiveGateway
+            List<Map> exclusiveGatewayList = ProcDefLoader.findElements(doc,"exclusiveGateway");
+            map.put("exclusiveGatewayList",exclusiveGatewayList);
+
+            //查询parallelGateway
+            List<Map> parallelGatewayList = ProcDefLoader.findElements(doc, "parallelGateway");
+            map.put("parallelGatewayList",parallelGatewayList);
+
+            msgResult.setData(map);
+            msgResult.setResult(true);
+        }
+        catch(Exception ex){
+            msgResult.setResult(false);
+            msgResult.setMessage(ex.getMessage());
+
+            ex.printStackTrace();
+            logger.error(ex.getMessage(),ex);
+        }
+
+        return msgResult;
+    }
+
+
+    @ApiOperation(value="流程定义列表")
+    @GetMapping(value = "listWithTmpl")
+    public MessageResult<List> listWithTmpl(String procDefKeys){
+        MessageResult<List> msgResult = new MessageResult<>();
+
+        ProcessDefinitionQuery query = repositoryService.createProcessDefinitionQuery()
+                .processDefinitionTenantId(WorkflowConstants.TENANT)
+                .latestVersion();
+
+        List<ProcessDefinition> list  = query.orderByProcessDefinitionName().asc().list();
+
+        List<Map> mapList = new ArrayList<Map>();
+
+        //查询流程定义部署时间
+        for (ProcessDefinition pd : list) {
+            HashMap<String,Object> map = processDef2Map(pd);
+
+            if(StringUtils.isNotEmpty(procDefKeys) && procDefKeys.indexOf(pd.getKey())==-1){
+                continue;
+            }
+
+            //查询模板
+            List<ProcDefTemplate> templateList = procDefTemplateService.findByProcDefKey(pd.getKey());
+
+            for (ProcDefTemplate template: templateList) {
+                if (template.getDefaultFlag() != null && template.getDefaultFlag()) {
+                    map.put("selectedTemplateId" , template.getId());
+
+                    //显示步骤
+                    List<Map> stepList  =  tmplStepService.listWithStep(template);
+                    map.put("stepList",stepList);
+//                  map.put("stepList",new ArrayList<>()); //在前台异步获取
+                    break;
+                }
+            }
+
+            map.put("templateList",templateList);
+
+            mapList.add(map);
+        }
+
+        msgResult.setResult(true);
+        msgResult.setData(mapList);
+
+        return msgResult;
+    }
+}
+

+ 366 - 0
src/main/java/com/jpsoft/ipcps/controller/ProcDefTmplController.java

@@ -0,0 +1,366 @@
+package com.jpsoft.ipcps.controller;
+
+import com.github.pagehelper.Page;
+import com.jpsoft.ipcps.common.Sort;
+import com.jpsoft.ipcps.dto.MessageResult;
+import com.jpsoft.ipcps.entity.*;
+import com.jpsoft.ipcps.service.*;
+import io.swagger.annotations.ApiOperation;
+import org.apache.commons.lang3.StringUtils;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+import javax.servlet.http.HttpServletRequest;
+import java.util.*;
+
+@RestController
+@RequestMapping("/procDefTmpl")
+public class ProcDefTmplController {
+    private Logger logger = LoggerFactory.getLogger(getClass());
+
+    @Autowired
+    private ProcDefTemplateService procDefTemplateService;
+
+    @Autowired
+    private ProcDefTemplateStepService templateStepService;
+
+    @Autowired
+    private ProcDefStepAssigneeService stepAssigneeService;
+
+    @Autowired
+    private ProcDefStepNoticeService stepNoticeService;
+
+    @Autowired
+    private ProcDefStepToDoService stepToDoService;
+
+    @ApiOperation(value="添加")
+    @PostMapping("add")
+    public MessageResult<ProcDefTemplate> add(@ModelAttribute ProcDefTemplate procDefTemplate,@RequestAttribute String subject){
+        MessageResult<ProcDefTemplate> msgResult = new MessageResult<>();
+
+        try {
+            procDefTemplate.setId(UUID.randomUUID().toString());
+            procDefTemplate.setDelFlag(false);
+            procDefTemplate.setCreateDate(new Date());
+            procDefTemplate.setCreateBy(subject);
+
+            int affectCount = procDefTemplateService.insert(procDefTemplate);
+
+            if (affectCount > 0) {
+                msgResult.setResult(true);
+                msgResult.setData(procDefTemplate);
+            } else {
+                msgResult.setResult(false);
+                msgResult.setMessage("数据库添加失败");
+            }
+        }
+        catch(Exception ex){
+            logger.error(ex.getMessage(),ex);
+
+            msgResult.setResult(false);
+            msgResult.setMessage(ex.getMessage());
+        }
+
+        return msgResult;
+    }
+
+    @ApiOperation(value="获取")
+    @GetMapping("detail/{id}")
+    public MessageResult<ProcDefTemplate> detail(@PathVariable("id") String id){
+        MessageResult<ProcDefTemplate> msgResult = new MessageResult<>();
+
+        try {
+            ProcDefTemplate procDefTemplate = procDefTemplateService.get(id);
+
+            if (procDefTemplate != null) {
+                msgResult.setResult(true);
+                msgResult.setData(procDefTemplate);
+            } else {
+                msgResult.setResult(false);
+                msgResult.setMessage("数据库不存在该记录!");
+            }
+        }
+        catch(Exception ex){
+            logger.error(ex.getMessage(),ex);
+
+            msgResult.setResult(false);
+            msgResult.setMessage(ex.getMessage());
+        }
+
+        return msgResult;
+    }
+
+    @ApiOperation(value="设置默认")
+    @PostMapping("setDefault")
+    public MessageResult<ProcDefTemplate> setDefault(String procDefKey,String templateId){
+        MessageResult<ProcDefTemplate> msgResult = new MessageResult<>();
+
+        try {
+            int affectCount = procDefTemplateService.setDefault(procDefKey,templateId);
+
+            if (affectCount > 0) {
+                msgResult.setResult(true);
+            } else {
+                msgResult.setResult(false);
+                msgResult.setMessage("数据库更新失败");
+            }
+        }
+        catch(Exception ex){
+            logger.error(ex.getMessage(),ex);
+
+            msgResult.setResult(false);
+            msgResult.setMessage(ex.getMessage());
+        }
+
+        return msgResult;
+    }
+
+    @ApiOperation(value="更新")
+    @PostMapping("update")
+    public MessageResult<ProcDefTemplate> update(@ModelAttribute ProcDefTemplate procDefTemplate,@RequestAttribute String subject){
+        MessageResult<ProcDefTemplate> msgResult = new MessageResult<>();
+
+        try {
+            procDefTemplate.setUpdateDate(new Date());
+            procDefTemplate.setUpdateBy(subject);
+
+            int affectCount = procDefTemplateService.update(procDefTemplate);
+
+            if (affectCount > 0) {
+                msgResult.setResult(true);
+                msgResult.setData(procDefTemplate);
+            } else {
+                msgResult.setResult(false);
+                msgResult.setMessage("数据库更新失败");
+            }
+        }
+        catch(Exception ex){
+            logger.error(ex.getMessage(),ex);
+
+            msgResult.setResult(false);
+            msgResult.setMessage(ex.getMessage());
+        }
+
+        return msgResult;
+    }
+
+    @ApiOperation(value="删除")
+    @PostMapping("delete/{id}")
+    public MessageResult<ProcDefTemplate> delete(@PathVariable("id") String id){
+        MessageResult<ProcDefTemplate> msgResult = new MessageResult<>();
+
+        try {
+            int affectCount = procDefTemplateService.delete(id);
+
+            if (affectCount > 0) {
+                msgResult.setResult(true);
+            } else {
+                msgResult.setResult(false);
+                msgResult.setMessage("数据库删除失败");
+            }
+        }
+        catch(Exception ex){
+            logger.error(ex.getMessage(),ex);
+
+            msgResult.setResult(false);
+            msgResult.setMessage(ex.getMessage());
+        }
+
+        return msgResult;
+    }
+
+    @ApiOperation(value="删除")
+    @PostMapping("copy")
+    public MessageResult<ProcDefTemplate> copy(String srcTmplId,String tmplName,@RequestAttribute String subject){
+        MessageResult<ProcDefTemplate> msgResult = new MessageResult<>();
+
+        try {
+            ProcDefTemplate tmpl = procDefTemplateService.get(srcTmplId);
+
+            ProcDefTemplate newTmpl = new ProcDefTemplate();
+            newTmpl.setId(UUID.randomUUID().toString());
+            newTmpl.setTitle(tmplName);
+            newTmpl.setProcDefKey(tmpl.getProcDefKey());
+            newTmpl.setCreateDate(new Date());
+            newTmpl.setCreateBy(subject);
+            newTmpl.setDefaultFlag(false);
+            newTmpl.setDelFlag(false);
+
+            int affectCount = procDefTemplateService.insert(newTmpl);
+
+            List<ProcDefTemplateStep> stepList = templateStepService.findByTemplateId(tmpl.getId());
+
+            for (ProcDefTemplateStep step : stepList) {
+                ProcDefTemplateStep newStep = new ProcDefTemplateStep();
+
+                newStep.setId(UUID.randomUUID().toString());
+                newStep.setNo(step.getNo());
+                newStep.setTemplateId(newTmpl.getId());
+                newStep.setTaskDefKey(step.getTaskDefKey());
+                newStep.setTitle(step.getTitle());
+                newStep.setDay(step.getDay());
+                newStep.setIgnore(step.getIgnore());
+                newStep.setCreateDate(new Date());
+                newStep.setCreateBy(subject);
+
+                affectCount = templateStepService.insert(newStep);
+
+                if(affectCount>0) {
+                    List<Map> assignedList = stepAssigneeService.findUserByStepId(step.getId());
+//                    List<Map> noticedList = stepNoticeService.findUserByStepId(step.getId());
+                    List<Map> assignedRoleList = stepAssigneeService.findRoleByStepId(step.getId());
+//                    List<Map> noticedRoleList = stepNoticeService.findRoleByStepId(step.getId());
+
+                    List<ProcDefStepToDo> todoList = stepToDoService.findByStepId(step.getId());
+
+                    if (assignedList != null) {
+                        for (Map map : assignedList) {
+                            ProcDefStepAssignee assignee = new ProcDefStepAssignee();
+
+                            assignee.setId(UUID.randomUUID().toString());
+                            assignee.setStepId(newStep.getId());
+                            assignee.setUserId(map.get("userId").toString());
+                            assignee.setCreateDate(new Date());
+                            assignee.setCreateBy(subject);
+                            assignee.setDelFlag(false);
+
+                            stepAssigneeService.insert(assignee);
+                        }
+                    }
+
+//                    if (noticedList != null) {
+//                        for (Map map : noticedList) {
+//                            ProcDefStepNotice notice = new ProcDefStepNotice();
+//
+//                            notice.setId(UUID.randomUUID().toString());
+//                            notice.setStepId(newStep.getId());
+//                            notice.setUserId(map.get("userId").toString());
+//                            notice.setCreateDate(new Date());
+//                            notice.setCreateBy(subject);
+//                            notice.setDelFlag(false);
+//
+//                            stepNoticeService.insert(notice);
+//                        }
+//                    }
+
+                    if (assignedRoleList != null) {
+                        for (Map map : assignedRoleList) {
+                            ProcDefStepAssignee assignee = new ProcDefStepAssignee();
+
+                            assignee.setId(UUID.randomUUID().toString());
+                            assignee.setStepId(newStep.getId());
+                            assignee.setRoleId(map.get("roleId").toString());
+                            assignee.setCreateDate(new Date());
+                            assignee.setCreateBy(subject);
+                            assignee.setDelFlag(false);
+
+                            stepAssigneeService.insert(assignee);
+                        }
+                    }
+
+//                    if (noticedRoleList != null) {
+//                        for (Map map : noticedRoleList) {
+//                            ProcDefStepNotice notice = new ProcDefStepNotice();
+//
+//                            notice.setId(UUID.randomUUID().toString());
+//                            notice.setStepId(newStep.getId());
+//                            notice.setRoleId(map.get("roleId").toString());
+//                            notice.setCreateDate(new Date());
+//                            notice.setCreateBy(subject);
+//                            notice.setDelFlag(false);
+//
+//                            stepNoticeService.insert(notice);
+//                        }
+//                    }
+
+                    if (todoList != null) {
+                        for (ProcDefStepToDo src : todoList) {
+                            ProcDefStepToDo todo = new ProcDefStepToDo();
+
+                            todo.setId(UUID.randomUUID().toString());
+                            todo.setStepId(newStep.getId());
+                            todo.setDetail(src.getDetail());
+                            todo.setCreateDate(new Date());
+                            todo.setCreateBy(subject);
+                            todo.setDelFlag(false);
+
+                            stepToDoService.insert(todo);
+                        }
+                    }
+                }
+            }
+
+            if (affectCount > 0) {
+                msgResult.setResult(true);
+            } else {
+                msgResult.setResult(false);
+                msgResult.setMessage("数据库删除失败");
+            }
+        }
+        catch(Exception ex){
+            logger.error(ex.getMessage(),ex);
+
+            msgResult.setResult(false);
+            msgResult.setMessage(ex.getMessage());
+        }
+
+        return msgResult;
+    }
+
+    @ApiOperation(value="列表")
+    @RequestMapping(value = "list",method = RequestMethod.POST)
+    public MessageResult<Map> list(
+            String title,
+            String procDefKey,
+            @RequestParam(value="draw",defaultValue="1") int draw,
+            @RequestParam(value="start",defaultValue="1") int start,
+            @RequestParam(value="length",defaultValue="20") int length,
+            HttpServletRequest request){
+        String subject = (String)request.getAttribute("subject");
+
+        //当前用户ID
+        System.out.println(subject);
+
+        MessageResult<Map> msgResult = new MessageResult<>();
+
+        try {
+            Map<String, Object> searchParms = new HashMap<>();
+
+            List<Sort> sortList = new ArrayList<>();
+            sortList.add(new Sort("create_date_", "asc"));
+
+            searchParms.put("procDefKey", procDefKey);
+
+            if (StringUtils.isNotEmpty(title)) {
+                searchParms.put("title", "%" + title + "%");
+            }
+
+            int pageNum = start / length;
+
+            if (start % length != 0) {
+                pageNum++;
+            }
+
+            int pageSize = length;
+
+            Page<ProcDefTemplate> page = procDefTemplateService.pageSearch(searchParms, pageNum, pageSize, sortList);
+
+            HashMap<String, Object> wrapper = new HashMap<String, Object>();
+            wrapper.put("draw", draw);
+            wrapper.put("recordsTotal", page.getTotal());
+            wrapper.put("recordsFiltered", page.getTotal());
+            wrapper.put("data", page.getResult());
+
+            msgResult.setResult(true);
+            msgResult.setData(wrapper);
+        }
+        catch(Exception ex){
+            msgResult.setResult(false);
+            msgResult.setMessage(ex.getMessage());
+            logger.error(ex.getMessage(),ex);
+        }
+
+        return msgResult;
+    }
+}

+ 290 - 0
src/main/java/com/jpsoft/ipcps/controller/ProcDefTmplStepController.java

@@ -0,0 +1,290 @@
+package com.jpsoft.ipcps.controller;
+
+import com.github.pagehelper.Page;
+import com.jpsoft.ipcps.common.Sort;
+import com.jpsoft.ipcps.dto.MessageResult;
+import com.jpsoft.ipcps.dto.ProcDefStepDTO;
+import com.jpsoft.ipcps.entity.*;
+import com.jpsoft.ipcps.service.*;
+import io.swagger.annotations.ApiOperation;
+import org.activiti.engine.TaskService;
+import org.activiti.engine.repository.Deployment;
+import org.activiti.engine.repository.ProcessDefinition;
+import org.activiti.engine.repository.ProcessDefinitionQuery;
+import org.activiti.engine.task.Task;
+import org.apache.commons.lang3.StringUtils;
+import org.apache.ibatis.mapping.ResultMap;
+import org.joda.time.DateTime;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+
+import javax.servlet.http.HttpServletRequest;
+import java.text.SimpleDateFormat;
+import java.util.*;
+
+@RestController
+@RequestMapping("/procDefTmpl/step")
+public class ProcDefTmplStepController {
+    private Logger logger = LoggerFactory.getLogger(getClass());
+
+    @Autowired
+    private ProcDefTemplateService procDefTemplateService;
+
+    @Autowired
+    private ProcDefTemplateStepService tmplStepService;
+
+    @Autowired
+    private ProcDefStepAssigneeService stepAssigneeService;
+
+    @Autowired
+    private ProcDefStepNoticeService stepNoticeService;
+
+    @Autowired
+    private ProcDefStepToDoService stepToDoService;
+
+    @Autowired
+    private TaskService taskService;
+
+    @ApiOperation(value="获取步骤列表")
+    @GetMapping("list")
+    public MessageResult<List> list(String templateId){
+        MessageResult<List> msgResult = new MessageResult<>();
+
+        try {
+            ProcDefTemplate template = procDefTemplateService.get(templateId);
+
+            List<Map> stepList  =  tmplStepService.listWithStep(template);
+
+            msgResult.setData(stepList);
+            msgResult.setResult(true);
+        }
+        catch(Exception ex){
+            logger.error(ex.getMessage(),ex);
+
+            msgResult.setResult(false);
+            msgResult.setMessage(ex.getMessage());
+        }
+
+        return msgResult;
+    }
+
+    @ApiOperation(value="保存信息")
+    @PostMapping("save")
+    public MessageResult<String> save(@RequestBody ProcDefStepDTO stepDTO,@RequestAttribute String subject){
+        MessageResult<String> msgResult = new MessageResult<>();
+
+        try {
+            ProcDefTemplateStep step = stepDTO.getStep();
+
+            if (step.getDay()==null){
+                step.setDay(0);
+            }
+
+            step.setDelFlag(false);
+
+            if (!tmplStepService.existByTemplateIdAndTaskDefKey(step.getTemplateId(),step.getTaskDefKey())) {
+                stepDTO.getStep().setCreateDate(new Date());
+                stepDTO.getStep().setCreateBy(subject);
+
+                tmplStepService.insert(stepDTO.getStep());
+            }
+            else{
+                stepDTO.getStep().setUpdateDate(new Date());
+                stepDTO.getStep().setUpdateBy(subject);
+
+                tmplStepService.update(stepDTO.getStep());
+            }
+
+            stepAssigneeService.deleteByStepId(stepDTO.getStep().getId());
+
+            if (stepDTO.getAssigneeList()!=null){
+                for (String userId: stepDTO.getAssigneeList()) {
+                    ProcDefStepAssignee assignee = new ProcDefStepAssignee();
+                    assignee.setId(UUID.randomUUID().toString());
+                    assignee.setStepId(stepDTO.getStep().getId());
+                    assignee.setUserId((userId));
+                    assignee.setCreateDate(new Date());
+                    assignee.setCreateBy(subject);
+                    assignee.setDelFlag(false);
+
+                    stepAssigneeService.insert(assignee);
+                }
+            }
+
+            if (stepDTO.getAssigneeRoleList()!=null) {
+                for (String roleId : stepDTO.getAssigneeRoleList()) {
+                    ProcDefStepAssignee assignee = new ProcDefStepAssignee();
+                    assignee.setId(UUID.randomUUID().toString());
+                    assignee.setStepId(stepDTO.getStep().getId());
+                    assignee.setRoleId(roleId);
+                    assignee.setCreateDate(new Date());
+                    assignee.setCreateBy(subject);
+                    assignee.setDelFlag(false);
+
+                    stepAssigneeService.insert(assignee);
+                }
+            }
+
+//            stepNoticeService.deleteByStepId(stepDTO.getStep().getId());
+
+//            if (stepDTO.getNoticeList()!=null){
+//                for (String userId : stepDTO.getNoticeList()) {
+//                    ProcDefStepNotice notice = new ProcDefStepNotice();
+//                    notice.setId(UUID.randomUUID().toString());
+//                    notice.setUserId(userId);
+//                    notice.setStepId(stepDTO.getStep().getId());
+//                    notice.setCreateDate(new Date());
+//                    notice.setCreateBy(subject);
+//                    notice.setDelFlag(false);
+//
+//                    stepNoticeService.insert(notice);
+//                }
+//            }
+//
+//            if (stepDTO.getNoticeRoleList()!=null){
+//                for (String roleId : stepDTO.getNoticeRoleList()) {
+//                    ProcDefStepNotice notice = new ProcDefStepNotice();
+//                    notice.setId(UUID.randomUUID().toString());
+//                    notice.setRoleId(roleId);
+//                    notice.setStepId(stepDTO.getStep().getId());
+//                    notice.setCreateDate(new Date());
+//                    notice.setCreateBy(subject);
+//                    notice.setDelFlag(false);
+//
+//                    stepNoticeService.insert(notice);
+//                }
+//            }
+
+            if (stepDTO.getTodoList()!=null){
+                // 假删除
+                int index = 1;
+
+                for (ProcDefStepToDo todo : stepDTO.getTodoList()) {
+                    todo.setNo(index++);
+
+                    if(todo.getCreateDate()==null) {
+                        todo.setId(UUID.randomUUID().toString());
+                        todo.setStepId(stepDTO.getStep().getId());
+                        todo.setCreateDate(new Date());
+                        todo.setCreateBy(subject);
+
+                        todo.setDelFlag(false);
+                        stepToDoService.insert(todo);
+                    }
+                    else{
+                        todo.setUpdateDate(new Date());
+                        todo.setUpdateBy(subject);
+
+                        stepToDoService.update(todo);
+                    }
+                }
+            }
+
+            //不同流程可以对应不同的模板
+            //修改模板步骤中的时间后,同时修改当前待办事项中该步骤的规定完成时间
+            if(step.getDay()>0){
+                ProcDefTemplate procDefTemplate = procDefTemplateService.get(stepDTO.getStep().getTemplateId());
+
+                List<Task> taskList = taskService.createTaskQuery()
+                        .processDefinitionKey(procDefTemplate.getProcDefKey())
+                        .taskDefinitionKey(stepDTO.getStep().getTaskDefKey())
+                        .list();
+
+                for (Task task : taskList) {
+                    DateTime createTime = new DateTime(task.getCreateTime());
+                    Date dueDate = createTime.plusDays(step.getDay()).toDate();
+
+                    task.setDueDate(dueDate);
+
+                    taskService.saveTask(task);
+                }
+            }
+
+            msgResult.setResult(true);
+        }
+        catch(Exception ex){
+            logger.error(ex.getMessage(),ex);
+
+            msgResult.setResult(false);
+            msgResult.setMessage(ex.getMessage());
+        }
+
+        return msgResult;
+    }
+
+    @ApiOperation(value="获取信息")
+    @GetMapping("detail")
+    public MessageResult<Map> detail(@RequestParam("templateId") String templateId,@RequestParam("taskDefKey") String taskDefKey,@RequestAttribute String subject){
+        MessageResult<Map> msgResult = new MessageResult<>();
+        Map<String,Object> dataMap = new HashMap<>();
+
+        try {
+            ProcDefStepDTO stepDTO = new ProcDefStepDTO();
+            ProcDefTemplateStep step = tmplStepService.findByTemplateIdAndTaskDefKey(templateId,taskDefKey);
+            List<Map> assignedList = new ArrayList<>();
+//            List<Map> noticedList = new ArrayList<>();
+            List<Map> assignedRoleList = new ArrayList<>();
+//            List<Map> noticedRoleList = new ArrayList<>();
+
+            if (step == null) {
+                step = new ProcDefTemplateStep();
+                step.setId(UUID.randomUUID().toString());
+                step.setTemplateId(templateId);
+                step.setTaskDefKey(taskDefKey);
+
+                stepDTO.setAssigneeList(new ArrayList<>());
+                stepDTO.setAssigneeRoleList(new ArrayList<>());
+                stepDTO.setTodoList(new ArrayList<>());
+            }
+            else{
+                //已选择用户
+                assignedList = stepAssigneeService.findUserByStepId(step.getId());
+//                noticedList = stepNoticeService.findUserByStepId(step.getId());
+                assignedRoleList = stepAssigneeService.findRoleByStepId(step.getId());
+//                noticedRoleList = stepNoticeService.findRoleByStepId(step.getId());
+
+                List<String> assigneeList = new ArrayList<>();
+                List<String> assigneeRoleList = new ArrayList<>();
+//                List<String> noticeList = new ArrayList<>();
+//                List<String> noticeRoleList = new ArrayList<>();
+
+                for (Map map : assignedList) {
+                    assigneeList.add((String)map.get("userId"));
+                }
+
+                for (Map map : assignedRoleList) {
+                    assigneeRoleList.add((String)map.get("roleId"));
+                }
+
+                stepDTO.setStep(step);
+
+                //选中值
+                stepDTO.setAssigneeList(assigneeList);
+                stepDTO.setAssigneeRoleList(assigneeRoleList);
+
+                stepDTO.setTodoList(stepToDoService.findByStepId(step.getId()));
+            }
+
+            stepDTO.setStep(step);
+
+            dataMap.put("dto",stepDTO);
+
+            //已选择值作为初始化参数
+            dataMap.put("assignedList",assignedList);
+            dataMap.put("assignedRoleList",assignedRoleList);
+
+            msgResult.setResult(true);
+            msgResult.setData(dataMap);
+        }
+        catch(Exception ex){
+            logger.error(ex.getMessage(),ex);
+
+            msgResult.setResult(false);
+            msgResult.setMessage(ex.getMessage());
+        }
+
+        return msgResult;
+    }
+}

+ 1306 - 0
src/main/java/com/jpsoft/ipcps/controller/ProcInstController.java

@@ -0,0 +1,1306 @@
+package com.jpsoft.ipcps.controller;
+
+import com.github.pagehelper.Page;
+import com.jpsoft.ipcps.common.PojoUtils;
+import com.jpsoft.ipcps.common.Sort;
+import com.jpsoft.ipcps.common.WorkflowConstants;
+import com.jpsoft.ipcps.dto.MessageResult;
+import com.jpsoft.ipcps.dto.StartProcessDTO;
+import com.jpsoft.ipcps.entity.*;
+import com.jpsoft.ipcps.service.*;
+import io.swagger.annotations.ApiImplicitParam;
+import io.swagger.annotations.ApiImplicitParams;
+import io.swagger.annotations.ApiOperation;
+import org.activiti.engine.HistoryService;
+import org.activiti.engine.RepositoryService;
+import org.activiti.engine.RuntimeService;
+import org.activiti.engine.TaskService;
+import org.activiti.engine.history.HistoricProcessInstance;
+import org.activiti.engine.history.HistoricTaskInstance;
+import org.activiti.engine.history.HistoricVariableInstance;
+import org.activiti.engine.repository.ProcessDefinition;
+import org.activiti.engine.runtime.ProcessInstance;
+import org.activiti.engine.task.IdentityLink;
+import org.activiti.engine.task.Task;
+import org.activiti.engine.task.TaskQuery;
+import org.apache.commons.lang3.StringUtils;
+import org.joda.time.DateTime;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+
+import javax.servlet.http.HttpServletRequest;
+import java.text.SimpleDateFormat;
+import java.util.*;
+import java.util.stream.Collectors;
+
+@RequestMapping("procInst")
+@RestController
+public class ProcInstController {
+    @Autowired
+    private RuntimeService runtimeService;
+
+    @Autowired
+    private TaskService taskService;
+
+    @Autowired
+    private HistoryService historyService;
+
+    @Autowired
+    private ProcInstTemplateService procInstTemplateService;
+
+    @Autowired
+    private ProcDefTemplateService procDefTemplateService;
+
+    @Autowired
+    private ProcDefTemplateStepService procDefTemplateStepService;
+
+    @Autowired
+    private ProjectService projectService;
+
+    @Autowired
+    private ProjectWarningService projectWarningService;
+
+    @Autowired
+    private ProcInstToDoService procInstToDoService;
+
+    @Autowired
+    private ProjectTaskService projectTaskService;
+
+    @Autowired
+    private RepositoryService repositoryService;
+
+    @Autowired
+    private ProcInstService procInstService;
+
+    @Autowired
+    private JpAdminService jpAdminService;
+
+    @Autowired
+    private ProcDefStepAssigneeService procDefStepAssigneeService;
+
+    @Autowired
+    private ProcDefStepToDoService procDefStepToDoService;
+
+    @Autowired
+    private OrgService orgService;
+
+    @Autowired
+    private ProcInstStepService procInstStepService;
+
+    @Autowired
+    private ProcDefTemplateStepService tmplStepService;
+
+    @Autowired
+    private RoleService roleService;
+
+    @Autowired
+    private ProcDefStepAssigneeService stepAssigneeService;
+
+    @Autowired
+    private ParkOrgService parkOrgService;
+
+    @Autowired
+    private ParkService parkService;
+
+    @Autowired
+    private DepartmentService departmentService;
+
+    private Logger logger = LoggerFactory.getLogger(getClass());
+
+    @ApiOperation(value="发起流程")
+    @PostMapping(value = "startProcess")
+    public MessageResult<String> startProcess(@RequestBody StartProcessDTO dto,@RequestAttribute String subject){
+        MessageResult<String> msgResult = new MessageResult<>();
+
+        try {
+            // 读取项目方
+            Project project = projectService.get(dto.getProjectId());
+
+            Map<String,Object> variables = new HashMap<>();
+            variables.put("templateId",dto.getTemplateId());
+            variables.put("templateId2",dto.getTemplateId2());
+            variables.put("templateId3",dto.getTemplateId3());
+            variables.put("projectId",dto.getProjectId());
+            variables.put("starter",subject);
+
+            // 流程启动时第一个步骤要读取ProcInstStep设定的值,因为启动后就会执行第一步,此时流程实例步骤还未保存
+            for (Map map : dto.getStepList()) {
+                ProcInstStep step = new ProcInstStep();
+
+                step.setId(UUID.randomUUID().toString());
+                step.setProjectId(dto.getProjectId());
+                step.setProcDefKey((String)map.get("procDefKey"));
+
+                step.setTemplateId((String)map.get("templateId"));
+                step.setTaskDefKey((String)map.get("taskDefKey"));
+                step.setStepId((String)map.get("stepId"));
+                step.setDay((Integer)map.get("day"));
+                step.setDelFlag(false);
+                step.setCreateDate(new Date());
+                step.setCreateBy(subject);
+
+                procInstStepService.insert(step);
+            }
+
+            if (project.getProjectAdmin()==null){
+                throw new Exception("项目方管理员不能为空!");
+            }
+
+            variables.put("PM",project.getProjectAdmin().getId());
+
+            ProcessInstance processInstance =  runtimeService
+                    .startProcessInstanceByKeyAndTenantId(dto.getProcDefKey(),dto.getProjectId(), variables, WorkflowConstants.TENANT);
+
+            procInstTemplateService.setProcessInstanceStarter(processInstance.getId(),subject);
+
+            // 开启流程后才有ProcInstTemplate
+            ProcInstTemplate instTemplate = new ProcInstTemplate();
+            instTemplate.setProcInstId(processInstance.getId());
+            instTemplate.setProjectId(dto.getProjectId());
+            instTemplate.setTemplateId(dto.getTemplateId());
+            instTemplate.setDelFlag(false);
+            instTemplate.setCreateDate(new Date());
+            instTemplate.setCreateBy(subject);
+
+            procInstTemplateService.insert(instTemplate);
+
+            //更新当前流程实例对应步骤
+            procInstStepService.updateProcInstId(project.getProjectId(),dto.getProcDefKey(),processInstance.getId());
+
+            //更新当前项目对应的流程
+            project.setProcInstId(processInstance.getId());
+            project.setProcDefKey(dto.getProcDefKey());
+            project.setFulfillTime(new Date());//履约时间-流程开启时间
+
+            ProcessDefinition pd =  repositoryService.createProcessDefinitionQuery()
+                    .processDefinitionKey(dto.getProcDefKey())
+                    .latestVersion().singleResult();
+
+            project.setProcessName(pd.getDescription());
+            project.setUpdateDate(new Date());
+
+            projectService.update(project);
+
+            msgResult.setData(processInstance.getId());
+            msgResult.setResult(true);
+        }
+        catch(Exception ex){
+            msgResult.setMessage(ex.getMessage());
+            msgResult.setResult(false);
+
+            logger.error(ex.getMessage(),ex);
+        }
+
+        return msgResult;
+    }
+
+    @ApiOperation(value="流程列表")
+    @RequestMapping(value = "list",method = RequestMethod.POST)
+    public MessageResult<Map> list(
+            String projectName,
+            @RequestParam(value="draw",defaultValue="1") int draw,
+            @RequestParam(value="start",defaultValue="0") int start,
+            @RequestParam(value="length",defaultValue="20") int length,
+            HttpServletRequest request){
+        String subject = (String)request.getAttribute("subject");
+
+        MessageResult<Map> msgResult = new MessageResult<>();
+
+        try {
+            Map<String,Object> searchParams = new HashMap<>();
+
+            if (StringUtils.isNotEmpty(projectName)){
+                searchParams.put("projectName", "%" + projectName + "%");
+            }
+
+            List<Sort> sortList = new ArrayList<>();
+            sortList.add(new Sort("pi.START_TIME_","desc"));
+
+            start += 1;
+            int pageNumber = start / length;
+
+            if (start % length != 0) {
+                pageNumber++;
+            }
+
+            Page<Map> mapList = procInstService.list(searchParams,sortList,pageNumber,length);
+
+            //查询流程定义部署时间
+            for (Map map : mapList) {
+                if(map.get("startTime") != null){
+                    Date startTime = (Date)map.get("startTime");
+                    map.put("startTime",new DateTime(startTime).toString("yyyy-MM-dd HH:mm:ss"));
+                }
+
+                if(map.get("endTime") != null){
+                    Date endTime = (Date)map.get("endTime");
+                    map.put("endTime",new DateTime(endTime).toString("yyyy-MM-dd HH:mm:ss"));
+
+                    map.put("status","已完成");
+                }
+                else {
+                    map.put("endTime",null);
+
+                    //流程状态
+                    ProcessInstance processInstance = runtimeService.createProcessInstanceQuery()
+                            .processInstanceId(map.get("procInstId").toString())
+                            .singleResult();
+
+                    if(processInstance.isSuspended()){
+                        map.put("status","已暂停");
+                    }
+                    else{
+                        map.put("status","运行中");
+                    }
+
+                }
+            }
+
+            msgResult.setResult(true);
+            msgResult.setData(PojoUtils.pageWrapper(mapList));
+        }
+        catch(Exception ex){
+            logger.error(ex.getMessage(),ex);
+
+            msgResult.setResult(false);
+            msgResult.setMessage(ex.getMessage());
+        }
+
+        return msgResult;
+    }
+
+    @ApiOperation(value="获取待办事项")
+    @PostMapping(value = "nativeTaskList")
+    @ApiImplicitParams({
+            @ApiImplicitParam(name="userId", paramType = "query"),
+            @ApiImplicitParam(name="procInstId",paramType = "query")
+    })
+    public MessageResult<List> nativeTaskList(String userId,
+                                              String procInstId){
+        MessageResult<List> msgResult = new MessageResult<>();
+
+        try {
+            TaskQuery query = taskService.createTaskQuery();
+
+            if (StringUtils.isNotEmpty(userId)){
+                query.taskCandidateOrAssigned(userId);
+            }
+
+            if (StringUtils.isNotEmpty(procInstId)) {
+                query.processInstanceId(procInstId);
+            }
+
+            List<Task> taskList = query.active().list();
+
+            SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
+
+            msgResult.setData(taskList.stream().map((task)->{
+                Map<String,Object> map = new HashMap<>();
+                map.put("id",task.getId());
+                map.put("name",task.getName());
+                map.put("assignee",task.getAssignee());
+                map.put("createTime",sdf.format(task.getCreateTime()));
+
+                return map;
+            }).collect(Collectors.toList()));
+
+            msgResult.setResult(true);
+        }
+        catch(Exception ex){
+            msgResult.setMessage(ex.getMessage());
+            msgResult.setResult(false);
+            logger.error(ex.getMessage(),ex);
+        }
+
+        return msgResult;
+    }
+
+    @ApiOperation(value="获取已待事项")
+    @PostMapping(value = "nativeFinishList")
+    public MessageResult<List> nativeFinishList(@RequestAttribute String subject) {
+        MessageResult<List> msgResult = new MessageResult<>();
+
+        try {
+            List<HistoricTaskInstance> histTasks = historyService.createHistoricTaskInstanceQuery()
+                    .finished()
+                    .taskAssignee(subject)
+                    .list();
+
+            List<Map> mapList = new ArrayList<>();
+
+            msgResult.setData(mapList);
+        }
+        catch(Exception ex){
+            msgResult.setMessage(ex.getMessage());
+            msgResult.setResult(false);
+            logger.error(ex.getMessage(),ex);
+        }
+
+        return msgResult;
+    }
+
+
+    @ApiOperation(value="暂停流程")
+    @GetMapping(value = "suspend")
+    public MessageResult<String> suspend(@RequestParam String procInstId){
+        MessageResult<String> msgResult = new MessageResult<>();
+
+        try {
+            runtimeService.suspendProcessInstanceById(procInstId);
+            msgResult.setResult(true);
+        }
+        catch(Exception ex){
+            msgResult.setMessage(ex.getMessage());
+            msgResult.setResult(false);
+            logger.error(ex.getMessage(),ex);
+        }
+
+        return msgResult;
+    }
+
+    @ApiOperation(value="激活流程")
+    @GetMapping(value = "activate")
+    public MessageResult<String> activate(@RequestParam String procInstId){
+        MessageResult<String> msgResult = new MessageResult<>();
+
+        try {
+            runtimeService.activateProcessInstanceById(procInstId);
+            msgResult.setResult(true);
+        }
+        catch(Exception ex){
+            msgResult.setMessage(ex.getMessage());
+            msgResult.setResult(false);
+            logger.error(ex.getMessage(),ex);
+        }
+
+        return msgResult;
+    }
+
+
+    @ApiOperation(value="查询流程信息")
+    @GetMapping("detail/{id}")
+    public MessageResult<Map> detail(@PathVariable("id") String id){
+        MessageResult<Map> msgResult = new MessageResult<>();
+
+        try {
+            HistoricProcessInstance processInstance = historyService.createHistoricProcessInstanceQuery().processInstanceId(id).singleResult();
+
+            Map<String,Object> procInstMap = new HashMap<>();
+
+            procInstMap.put("id", processInstance.getId());
+            procInstMap.put("procDefKey", processInstance.getProcessDefinitionKey());
+
+            msgResult.setData(procInstMap);
+            msgResult.setResult(true);
+        }
+        catch(Exception ex){
+            msgResult.setMessage(ex.getMessage());
+            msgResult.setResult(false);
+            logger.error(ex.getMessage(),ex);
+        }
+
+        return msgResult;
+    }
+
+    private Map getProjectProgressMap(String procInstId){
+        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
+
+        Map<String,Object> procInstMap = new HashMap<>();
+
+        procInstMap.put("procInstId",procInstId);
+
+        //查询正在进行的任务
+        List<Task> taskList = taskService.createTaskQuery().processInstanceId(procInstId).active().list();
+
+        List<Map> pendingTasks = new ArrayList<>();
+        Map<String,Map> pendingTaskMap = new HashMap<>();
+
+        for (Task task : taskList){
+            Map<String,Object> taskMap = new HashMap<>();
+
+            if(!pendingTaskMap.containsKey(task.getTaskDefinitionKey())) {
+                taskMap.put("key", task.getTaskDefinitionKey());
+                taskMap.put("name", task.getName());
+                taskMap.put("id", task.getId());
+
+                pendingTaskMap.put(task.getTaskDefinitionKey(),taskMap);
+                pendingTasks.add(taskMap);
+            }
+            else {
+                taskMap = pendingTaskMap.get(task.getTaskDefinitionKey());
+            }
+
+            if(task.getAssignee() != null){
+                JpAdmin user = jpAdminService.get(task.getAssignee());
+
+                if(taskMap.get("assignee")==null) {
+                    taskMap.put("assignee", user.getRealName() + "(" + user.getUserName() + ")");
+                }
+                else{
+                    taskMap.put("assignee",taskMap.get("assignee") + "," + user.getRealName() + "(" + user.getUserName() + ")");
+                }
+            }
+            else{
+                List<IdentityLink> identityLinkList = taskService.getIdentityLinksForTask(task.getId());
+
+                StringBuilder candidates = new StringBuilder();
+
+                for (IdentityLink identityLink: identityLinkList) {
+                    JpAdmin candidate = jpAdminService.get(identityLink.getUserId());
+
+                    if(candidate!=null) {
+                        if (candidates.length()>0){
+                            candidates.append(",");
+                        }
+
+                        candidates.append(candidate.getRealName() + "("  + candidate.getUserName() + ")");
+                    }
+                }
+
+                if(taskMap.get("candidates")==null) {
+                    taskMap.put("candidates", candidates);
+                }
+                else{
+                    taskMap.put("candidates",taskMap.get("candidates") + "," + candidates);
+                }
+            }
+        }
+
+        List<Map> finishedTasks = new ArrayList<>();
+
+        //查询该流程已完成任务,注意这里需要倒序,将最新的任务发在前面,以便判断任务是先退回还是先完成
+        List<HistoricTaskInstance> histTaskList = historyService.createHistoricTaskInstanceQuery()
+                .processInstanceId(procInstId)
+                .finished()
+                .orderByHistoricTaskInstanceEndTime()
+                .desc()
+                .list();
+
+        // 保存步骤的最后状态(考虑退回会导致同一步多次执行)
+        Map<String,HistoricTaskInstance> lastTaskMap = new HashMap<>();
+
+        for (HistoricTaskInstance task : histTaskList) {
+            Map<String,Object> taskMap = new HashMap<>();
+
+            //如果有正在进行的相同步骤下的任务(会签)则不算完成
+            if(pendingTaskMap.containsKey(task.getTaskDefinitionKey())){
+                continue;
+            }
+
+            HistoricVariableInstance redirectHistVar = historyService.createHistoricVariableInstanceQuery()
+                                                .taskId(task.getId())
+                                                .variableName("redirect")
+                                                .singleResult();
+
+            if(redirectHistVar!=null) {
+                Boolean redirect = (Boolean) redirectHistVar.getValue();
+
+                // 忽略跳转步骤
+                if (redirect != null && redirect) {
+
+                    //记录该步骤最后退回状态
+                    if(lastTaskMap.containsKey(task.getTaskDefinitionKey())){
+                        HistoricTaskInstance lastTask = lastTaskMap.get(task.getTaskDefinitionKey());
+
+                        if(lastTask.getEndTime().compareTo(task.getEndTime())==1){
+                            lastTaskMap.put(task.getTaskDefinitionKey(),task);
+                        }
+                    }
+                    else {
+                        lastTaskMap.put(task.getTaskDefinitionKey(), task);
+                    }
+
+                    continue;
+                }
+            }
+            else{
+                // 如果当前步骤是已完成,但同时存在退回,且退回发生在已完成之后,则最后状态为退回。
+                if(lastTaskMap.containsKey(task.getTaskDefinitionKey())){
+                    HistoricTaskInstance lastTask = lastTaskMap.get(task.getTaskDefinitionKey());
+
+                    if(lastTask.getEndTime().compareTo(task.getEndTime())==1){
+                        continue;
+                    }
+                }
+            }
+
+            taskMap.put("key",task.getTaskDefinitionKey());
+            taskMap.put("name",task.getName());
+
+            //查询完成人
+            if(task.getAssignee()!=null){
+                JpAdmin user = jpAdminService.get(task.getAssignee());
+
+                if (user!=null) {
+                    taskMap.put("assignee", user.getRealName());
+                }
+            }
+
+            taskMap.put("endTime",sdf.format(task.getEndTime()));
+
+            if(task.getDueDate()!=null) {
+                taskMap.put("dueDate", sdf.format(task.getDueDate()));
+            }
+
+            taskMap.put("taskId",task.getId());
+
+            finishedTasks.add(taskMap);
+        }
+
+        //查询当前流程对应模板中已忽略的步骤
+        ProcInstTemplate procInstTemplate = procInstTemplateService.get(procInstId);
+
+        procInstMap.put("template", procDefTemplateService.get(procInstTemplate.getTemplateId()));
+
+        if(procInstTemplate!=null) {
+            List<ProcDefTemplateStep> stepList = procDefTemplateStepService.findByTemplateId(procInstTemplate.getTemplateId());
+
+            List<Map> ignoreTasks = new ArrayList<>();
+
+            for (ProcDefTemplateStep step : stepList) {
+                Map<String, Object> stepMap = new HashMap<>();
+
+                if (step.getIgnore() != null && step.getIgnore() == 1) {
+                    stepMap.put("key", step.getTaskDefKey());
+                    stepMap.put("name", step.getTitle());
+
+                    ignoreTasks.add(stepMap);
+                }
+            }
+
+            procInstMap.put("ignoreTasks",ignoreTasks);
+        }
+
+        //由于存在会签节点,所以在这里对正在进行和已完成的任务进行合并
+
+
+        procInstMap.put("pendingTasks", pendingTasks);
+        procInstMap.put("finishedTasks",finishedTasks);
+
+        //查询已超时的节点
+        Map<String,Object> searchParams = new HashMap<>();
+        searchParams.put("procInstId",procInstId);
+
+        List<Sort> sortList = new ArrayList<>();
+        sortList.add(new Sort("t1.START_TIME_","desc"));
+
+        Page<Map> warningList = projectTaskService.warningList(searchParams,sortList,1,100);
+
+        procInstMap.put("warningTasks",warningList.stream().map((item)->{
+            Map<String,Object> map = new HashMap<>();
+            map.put("key",item.get("taskDefKey"));
+            map.put("name",item.get("taskName"));
+            map.put("taskId", item.get("taskId"));
+
+            return map;
+        }).collect(Collectors.toList()));
+
+        return procInstMap;
+    }
+
+    @ApiOperation(value="流程进度")
+    @GetMapping(value = "processProgress")
+    public MessageResult<Map> processProgress(@RequestParam String procInstId){
+        MessageResult<Map> msgResult = new MessageResult<>();
+
+        try {
+            msgResult.setData(getProjectProgressMap(procInstId));
+
+            msgResult.setResult(true);
+        }
+        catch(Exception ex){
+            msgResult.setMessage(ex.getMessage());
+            msgResult.setResult(false);
+
+            logger.error(ex.getMessage(),ex);
+        }
+
+        return msgResult;
+    }
+
+    @ApiOperation(value="项目进度")
+    @GetMapping(value = "projectProgress")
+    @ApiImplicitParams({
+            @ApiImplicitParam(name="projectId", paramType = "query",value = "项目编号",required = true),
+            @ApiImplicitParam(name="procDefKeys",paramType = "query",value = "流程定义KEY,多个用逗号分隔")
+    })
+    public MessageResult<List> projectProgress(String projectId,
+                                               @RequestParam(name="procDefKeys",defaultValue = "ProjectPerformanceTransfer,ProjectStartUpConstruction,ProjectCompletedAndPutIntoOperation") String procDefKeys){
+        MessageResult<List> msgResult = new MessageResult<>();
+
+        try {
+            if (StringUtils.isEmpty(projectId)){
+                throw new Exception("项目编号不能为空!");
+            }
+
+            String[] keys = procDefKeys.split(",");
+
+            List<Map> mapList = new ArrayList<>();
+
+            for (String key: keys) {
+                List<HistoricProcessInstance> histProcInstList  = historyService.createHistoricProcessInstanceQuery()
+                        .processDefinitionKey(key)
+                        .processInstanceBusinessKey(projectId)
+                        .orderByProcessInstanceStartTime()
+                        .desc()
+                        .listPage(0,1);
+
+                if (histProcInstList.size()>0) {
+                    Map map = getProjectProgressMap(histProcInstList.get(0).getId());
+
+                    map.put("procDefKey",key);
+
+                    mapList.add(map);
+                }
+            }
+
+            msgResult.setData(mapList);
+
+            msgResult.setResult(true);
+        }
+        catch(Exception ex){
+            msgResult.setMessage(ex.getMessage());
+            msgResult.setResult(false);
+
+            logger.error(ex.getMessage(),ex);
+        }
+
+        return msgResult;
+    }
+
+    @ApiOperation(value="获取步骤列表")
+    @GetMapping("stepList")
+    public MessageResult<Map> stepList(String projectId,String procDefKey,String procInstId){
+        MessageResult<Map> msgResult = new MessageResult<>();
+
+        Map<String,Object> dataMap = new HashMap<>();
+
+        try {
+            Project project = projectService.get(projectId);
+            dataMap.put("project",project);
+
+            // List<Map> stepList  =  tmplStepService.listWithStep(template);
+            List<ProcInstStep> instStepList  = procInstStepService.findByProjectIdAndProcDefKey(projectId,procDefKey);
+            List<Map> stepList = new ArrayList<>();
+
+            if(instStepList.size()>0){
+                String templateId = instStepList.get(0).getTemplateId();
+
+                ProcDefTemplate template = procDefTemplateService.get(templateId);
+
+                dataMap.put("template",template);
+            }
+
+            SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
+
+            for (ProcInstStep procInstStep : instStepList) {
+                Map<String,Object> stepMap = new HashMap<>();
+
+                //所有流程共享模板中设置的规定完成人天和待办事项
+                ProcDefTemplateStep step = procDefTemplateStepService.get(procInstStep.getStepId());
+
+                stepMap.put("name",step.getTitle());
+                stepMap.put("taskDefKey",step.getTaskDefKey());
+                stepMap.put("day",step.getDay());
+
+                List<ProcDefStepToDo> todoList = procDefStepToDoService.findByStepId(step.getId());
+
+                stepMap.put("todoList",todoList);
+
+                List<Map> taskList = new ArrayList<>();
+
+                if(StringUtils.isNotEmpty(procInstId)){
+                    String taskDefKey = procInstStep.getTaskDefKey();
+
+                    List<HistoricTaskInstance> histTaskList = historyService.createHistoricTaskInstanceQuery()
+                            .processInstanceId(procInstId)
+                            .taskDefinitionKey(taskDefKey)
+                            .orderByTaskCreateTime()
+                            .asc()
+                            .list();
+
+                    for (HistoricTaskInstance task : histTaskList) {
+                        Map<String,Object> taskMap = new HashMap<>();
+
+                        if(StringUtils.isNotEmpty(task.getAssignee())){
+                            JpAdmin admin = jpAdminService.get(task.getAssignee());
+
+                            if(admin!=null) {
+                                taskMap.put("assignee", admin.getRealName() + "(" + admin.getUserName() + ")");
+                            }
+                            else{
+                                taskMap.put("assignee", task.getAssignee());
+                            }
+                        }
+                        else{
+                            List<IdentityLink> identityLinkList = taskService.getIdentityLinksForTask(task.getId());
+                            StringBuilder candidates = new StringBuilder();
+                            Set<String> candidateSet = new HashSet<>();
+
+                            for (IdentityLink identityLink: identityLinkList) {
+                                if(!candidateSet.contains(identityLink.getUserId())){
+                                    JpAdmin candidate = jpAdminService.get(identityLink.getUserId());
+
+                                    if (candidates.length() > 0) {
+                                        candidates.append(",");
+                                    }
+
+                                    candidates.append(candidate.getRealName() + "(" + candidate.getUserName() + ")");
+                                    candidateSet.add(candidate.getId());
+                                }
+                            }
+
+                            taskMap.put("candidate",candidates.toString());
+                        }
+
+
+                        taskMap.put("startTime",sdf.format(task.getStartTime()));
+
+                        if(task.getEndTime()!=null) {
+                            taskMap.put("endTime",sdf.format(task.getEndTime()));
+                        }
+
+                        taskList.add(taskMap);
+                    }
+                }
+
+                if(taskList.size()==0){
+                    Map<String,Object> taskMap = new HashMap<>();
+                    taskList.add(taskMap);
+                }
+
+                stepMap.put("taskList",taskList);
+
+                stepList.add(stepMap);
+            }
+
+            dataMap.put("stepList",stepList);
+
+            msgResult.setData(dataMap);
+            msgResult.setResult(true);
+        }
+        catch(Exception ex){
+            logger.error(ex.getMessage(),ex);
+
+            msgResult.setResult(false);
+            msgResult.setMessage(ex.getMessage());
+        }
+
+        return msgResult;
+    }
+
+    @ApiOperation(value="步骤详情")
+    @GetMapping(value = "stepDetail")
+    @ApiImplicitParams({
+            @ApiImplicitParam(name="projectId", paramType = "query",value = "项目编号",required = true),
+            @ApiImplicitParam(name="procInstId",paramType = "query",value = "流程实例编号"),
+            @ApiImplicitParam(name="procDefKey",paramType = "query",value = "流程定义编号(流程未开启时没有流程实例编号,则需要传定义编号)"),
+            @ApiImplicitParam(name="taskDefKey",paramType = "query",value = "步骤ID",required = true),
+            @ApiImplicitParam(name="roleId",paramType = "query",value = "当前用户角色编号",required = true)
+    })
+    public MessageResult<Map> stepDetail(String projectId,String procInstId,String procDefKey,String taskDefKey,
+                                         String roleId,@RequestAttribute String subject){
+        MessageResult<Map> msgResult = new MessageResult<>();
+
+        try {
+            Map<String, Object> dataMap = new HashMap<>();
+
+            Project project = projectService.get(projectId);
+
+            ProcessDefinition processDefinition = null;
+
+            if (StringUtils.isNotEmpty(procDefKey)) {
+                processDefinition = repositoryService.createProcessDefinitionQuery()
+                        .processDefinitionKey(procDefKey)
+                        .latestVersion()
+                        .singleResult();
+            }
+            else{
+                HistoricProcessInstance processInstance = historyService.createHistoricProcessInstanceQuery()
+                        .processInstanceId(procInstId)
+                        .singleResult();
+
+                processDefinition = repositoryService.createProcessDefinitionQuery()
+                        .processDefinitionId(processInstance.getProcessDefinitionId())
+                        .singleResult();
+            }
+
+            dataMap.put("projectName", project.getTitle());
+            dataMap.put("processName", processDefinition.getDescription());
+            dataMap.put("taskDefKey", taskDefKey);
+
+            List<HistoricTaskInstance> histTaskList = null;
+
+            if(StringUtils.isNotEmpty(procInstId)){
+                histTaskList = historyService.createHistoricTaskInstanceQuery()
+                        .processInstanceId(procInstId)
+                        .taskDefinitionKey(taskDefKey)
+                        .orderByTaskCreateTime()
+                        .desc()
+                        .list();
+            }
+
+            String procDefTemplateId = "";
+
+            if (StringUtils.isNotEmpty(procInstId)){
+                ProcInstTemplate template = procInstTemplateService.get(procInstId);
+                procDefTemplateId = template.getTemplateId();
+            }
+            else{
+
+                List<ProcInstTemplate> tmplList = procInstTemplateService.findByProjectId(projectId);
+
+                for (ProcInstTemplate procInstTemplate : tmplList) {
+                    //procInstTemplate.getTemplateId()
+                    ProcDefTemplate procDefTemplate = procDefTemplateService.get(procInstTemplate.getTemplateId());
+
+                    //找到第一个项目履约转办
+                    if (procDefTemplate.getProcDefKey().equals("ProjectPerformanceTransfer")){
+                        String variableName = "";
+
+                        if(procDefKey.equals("ProjectPerformanceTransfer")){
+                            variableName = "templateId1";
+                        }
+                        if (procDefKey.equals("ProjectStartUpConstruction")){
+                            variableName = "templateId2";
+                        }
+                        else if(procDefKey.equals("ProjectCompletedAndPutIntoOperation")){
+                            variableName = "templateId3";
+                        }
+
+                        HistoricVariableInstance variableInstance = historyService.createHistoricVariableInstanceQuery()
+                                                                    .processInstanceId(procInstTemplate.getProcInstId())
+                                                                    .variableName(variableName)
+                                                                    .singleResult();
+
+                        if(variableInstance!=null) {
+                            procDefTemplateId = (String)variableInstance.getValue();
+                        }
+
+                        break;
+                    }
+
+                    //templateId2,templateId3
+                }
+            }
+
+            ProcDefTemplateStep step = procDefTemplateStepService.findByTemplateIdAndTaskDefKey(procDefTemplateId, taskDefKey);
+
+            List<Map> taskList = new ArrayList<>();
+
+            if(histTaskList!=null){
+                for (HistoricTaskInstance task : histTaskList) {
+                    Map<String,Object> taskMap = new HashMap<>();
+
+                    taskMap.put("taskId",task.getId());
+
+                    if (task.getEndTime() != null){
+                        if(task.getDueDate() != null) {
+                            if(task.getDueDate().compareTo(task.getEndTime()) < 0){
+                                taskMap.put("status", "已超时");
+                            }
+                            else {
+                                taskMap.put("status", "正常");
+                            }
+                        }
+                        else {
+                            taskMap.put("status", "已完成");
+                        }
+                    }
+                    else {
+                        Date now = new Date();
+
+                        if(task.getDueDate() != null) {
+                            if(task.getDueDate().compareTo(now) < 0){
+                                taskMap.put("status", "已超时");
+                            }
+                            else {
+                                taskMap.put("status", "正常");
+                            }
+                        }
+                        else {
+                            taskMap.put("status", "进行中");
+                        }
+                    }
+
+                    if (task.getAssignee() != null) {
+                        JpAdmin user = jpAdminService.get(task.getAssignee());
+
+                        if (user != null) {
+                            taskMap.put("assignee", user.getRealName() + "(" + user.getUserName() + ")");
+                        }
+                    }
+                    else{
+                        List<IdentityLink> identityLinkList = taskService.getIdentityLinksForTask(task.getId());
+                        StringBuilder candidates = new StringBuilder();
+                        Set<String> candidateSet = new HashSet<>();
+
+                        for (IdentityLink identityLink: identityLinkList) {
+                            if(!candidateSet.contains(identityLink.getUserId())){
+                                JpAdmin candidate = jpAdminService.get(identityLink.getUserId());
+
+                                if (candidates.length() > 0) {
+                                    candidates.append(",");
+                                }
+
+                                candidates.append(candidate.getRealName() + "(" + candidate.getUserName() + ")");
+                                candidateSet.add(candidate.getId());
+                            }
+                        }
+
+                        taskMap.put("candidate",candidates.toString());
+                    }
+
+                    List<Map> doneList = procInstToDoService.doneList(procDefTemplateId, step.getTaskDefKey(), procInstId,task.getId());
+
+                    for (Map map: doneList) {
+                        if(!map.containsKey("checked")){
+                            map.put("checked",false);
+                        }
+                    }
+
+                    taskMap.put("todoList",doneList);
+
+                    taskList.add(taskMap);
+                }
+            }
+
+            dataMap.put("taskList",taskList);
+
+            //待办事项
+            List<ProcDefStepToDo> todoList = procDefStepToDoService.findByStepId(step.getId());
+            List<Map> todoMapList = new ArrayList<>();
+
+            for (ProcDefStepToDo todo : todoList) {
+                Map<String,Object> todoMap = new HashMap<>();
+
+                todoMap.put("todoId",todo.getId());
+                todoMap.put("no",todo.getNo());
+                todoMap.put("title",todo.getDetail());
+//                todoMap.put("checked",true);
+
+                todoMapList.add(todoMap);
+            }
+
+            dataMap.put("todoList", todoMapList);
+
+            //读取步骤候选人
+            List<Map> candidates = procDefStepAssigneeService.findUserByStepId(step.getId());
+
+            StringBuilder candidateBuilder = new StringBuilder();
+
+            for (Map candidate : candidates) {
+                if (candidateBuilder.length() > 0) {
+                    candidateBuilder.append(",");
+                }
+
+                candidateBuilder.append(candidate.get("realName") + "(" + candidate.get("userName") + ")");
+            }
+
+            //读取步骤候选角色
+            List<Map> roles = procDefStepAssigneeService.findRoleByStepId(step.getId());
+
+            for (Map roleMap : roles) {
+                List<JpAdmin> adminList = jpAdminService.findUserByRoleId((String)roleMap.get("roleId"));
+
+                for (JpAdmin admin : adminList){
+                    if (candidateBuilder.length() > 0) {
+                        candidateBuilder.append(",");
+                    }
+
+                    candidateBuilder.append(admin.getRealName() + "(" + admin.getUserName() + ")");
+                }
+            }
+
+            dataMap.put("candidate", candidateBuilder.toString());
+
+            //当前项目异常情况ProcInstIdAndTaskDefKey
+            List<Map> warningList = projectWarningService.findByPIdAndProcInstIdAndTaskDefKey(projectId,procInstId,taskDefKey);
+            dataMap.put("warningList",warningList);
+
+            List<Map> otherProjects = null;
+
+            Role role = roleService.get(roleId);
+
+
+            //当前节点其它项目
+            if("XMF".equals(role.getRoleName())){
+                //项目方传空列表
+                otherProjects = new ArrayList<>();
+            }
+            else{
+                otherProjects = queryOtherProjectTask(processDefinition.getKey(),taskDefKey,project,role.getRoleName(),subject);
+            }
+
+            dataMap.put("otherProjects",otherProjects);
+
+            msgResult.setData(dataMap);
+            msgResult.setResult(true);
+        }
+        catch (Exception ex){
+            logger.error(ex.getMessage(),ex);
+
+            msgResult.setResult(false);
+            msgResult.setMessage(ex.getMessage());
+        }
+
+        return msgResult;
+    }
+
+    private List<Map> queryOtherProjectTask(String procDefKey, String taskDefKey, Project project,String roleName,String userId) {
+        Map<String,Object> searchParams = new HashMap<>();
+
+        searchParams.put("procDefKey", procDefKey);
+        searchParams.put("taskDefKey",taskDefKey);
+        searchParams.put("excludeProjectId",project.getProjectId());
+        searchParams.put("roleName",roleName);
+        searchParams.put("userId",userId);
+        searchParams.put("parkId",project.getParkId());
+
+        List<Sort> sortList = new ArrayList<>();
+        sortList.add(new Sort("t.create_time_","desc"));
+
+        //为了提供性能在service方法中没有查询总数
+        Page<Map> page = projectTaskService.queryOtherProjectTask(searchParams,sortList,1,20);
+
+        for (Map map: page.getResult()) {
+            if(map.get("createTime") != null){
+                Date createTime = (Date)map.get("createTime");
+                map.put("createTime",new DateTime(createTime).toString("yyyy-MM-dd HH:mm:ss"));
+            }
+
+            if(map.get("dueDate") != null){
+                Date dueDate = (Date)map.get("dueDate");
+                map.put("dueDate",new DateTime(dueDate).toString("yyyy-MM-dd HH:mm:ss"));
+            }
+        }
+
+        return page.getResult();
+    }
+
+    @ApiOperation(value="获取项目正在运行的流程")
+    @GetMapping(value = "activeList")
+    @ApiImplicitParams({
+            @ApiImplicitParam(name="projectId", paramType = "query",value = "项目编号")
+    })
+    public MessageResult<List> activeList(String projectId){
+        MessageResult<List> msgResult = new MessageResult<>();
+
+        try {
+            String[] procDefKeys = new String[]{"ProjectPerformanceTransfer","ProjectStartUpConstruction","ProjectCompletedAndPutIntoOperation"};
+
+            List<ProcInstTemplate> tmplList = procInstTemplateService.findByProjectId(projectId);
+
+            Map<String,Object> activeMap = new HashMap<>();
+
+            for (ProcInstTemplate procInstTemplate : tmplList) {
+                if(StringUtils.isNotEmpty(procInstTemplate.getTemplateId())){
+                    ProcDefTemplate procDefTemplate  = procDefTemplateService.get(procInstTemplate.getTemplateId());
+                    activeMap.put(procDefTemplate.getProcDefKey(),procInstTemplate.getProcInstId());
+                }
+            }
+
+            List<Map> mapList = new ArrayList<>();
+
+            for (String procDefKey : procDefKeys) {
+                ProcessDefinition pd = repositoryService.createProcessDefinitionQuery()
+                        .processDefinitionKey(procDefKey).latestVersion().singleResult();
+
+                Map<String,Object> map = new HashMap<>();
+                map.put("processName" , pd.getDescription());
+                map.put("procDefKey",pd.getKey());
+                map.put("procInstId",activeMap.get(pd.getKey()));
+
+                mapList.add(map);
+            }
+
+            msgResult.setResult(true);
+            msgResult.setData(mapList);
+        }
+        catch(Exception ex){
+            msgResult.setMessage(ex.getMessage());
+            msgResult.setResult(false);
+
+            logger.error(ex.getMessage(),ex);
+        }
+
+        return msgResult;
+    }
+
+    @ApiOperation(value="职能单位工作情况")
+    @GetMapping(value = "statByOrg")
+    public MessageResult<List> statByOrg(){
+        MessageResult<List> msgResult = new MessageResult<>();
+
+        try {
+            List<Map> mapList = new ArrayList<>();
+
+            List<Park> parkList = parkService.list();
+
+            for (Park park: parkList) {
+                Map<String,Object> parkMap = new HashMap<>();
+
+                parkMap.put("parkId",park.getParkId());
+                parkMap.put("parkTitle",park.getTitle());
+
+                List<Org> orgList = parkOrgService.findOrgByParkId(park.getParkId());
+
+                List<Map> orgMapList = new ArrayList<>();
+
+                for (Org org: orgList) {
+                    if(org.getOrgName().equals("相关乡镇场")){
+                        orgMapList.addAll(statByDepartment("相关乡镇场",park.getParkId(), org));
+                    }
+                    else {
+                        Map<String, Object> map = new HashMap<>();
+
+                        // 项目总数:当前职能部门有待办任务的项目总数
+                        int total = projectTaskService.countRunningProjectByOrgId(org.getOrgId(), null, "total");
+
+                        // 已超时项目数:当前职能部门有待办任务且已超时的项目总数
+                        // (如果一个单位在同一个项目有两个待办任务,其中一个超时,一个未超时,则算超时)
+                        int overtime = projectTaskService.countRunningProjectByOrgId(org.getOrgId(), null, "overtime");
+
+                        // 未超时项目数:当前职能部门有待办任务且未超时的项目总数
+                        int normal = total - overtime;
+
+                        map.put("orgName", org.getOrgName());
+                        map.put("orgId", org.getOrgId());
+                        map.put("total", total);
+                        map.put("normal", normal);
+                        map.put("overtime", overtime);
+
+                        orgMapList.add(map);
+                    }
+                }
+
+                parkMap.put("orgList",orgMapList);
+
+                mapList.add(parkMap);
+            }
+
+            msgResult.setData(mapList);
+
+            msgResult.setResult(true);
+        }
+        catch(Exception ex){
+            msgResult.setMessage(ex.getMessage());
+            msgResult.setResult(false);
+
+            logger.error(ex.getMessage(),ex);
+        }
+
+        return msgResult;
+    }
+
+    private List<Map> statByDepartment(String orgName,String parkId, Org org) {
+        List<Map> mapList = new ArrayList<>();
+
+        List<JpAdmin> adminList = jpAdminService.findUserByOrgId(org.getOrgId());
+
+        List<Department> departmentList = departmentService.findByParkId(parkId);
+
+        Set<String> departmentSet = new HashSet<>();
+
+        for (Department department : departmentList) {
+            String key = department.getOrgId() + "," + department.getName();
+            departmentSet.add(key);
+        }
+
+        for (JpAdmin jpAdmin : adminList) {
+            //部门是否与当前园区关联
+            if (!departmentSet.contains(jpAdmin.getOrgId() + "," + jpAdmin.getDepartment())){
+                continue;
+            }
+
+            Map<String, Object> map = new HashMap<>();
+
+            // 项目总数:当前职能部门有待办任务的项目总数
+            int total = projectTaskService.countRunningProjectByAdminId(jpAdmin.getId(), parkId, "total");
+
+            // 已超时项目数:当前职能部门有待办任务且已超时的项目总数
+            // (如果一个单位在同一个项目有两个待办任务,其中一个超时,一个未超时,则算超时)
+            int overtime = projectTaskService.countRunningProjectByAdminId(jpAdmin.getId(), parkId, "overtime");
+
+            // 未超时项目数:当前职能部门有待办任务且未超时的项目总数
+            int normal = total - overtime;
+
+            for (Map<String,Object> map1 : mapList) {
+                if (map1.get("orgName").equals(jpAdmin.getDepartment())) {
+                    map = map1;
+                    break;
+                }
+            }
+
+            if (!map.containsKey("orgName")){
+                map.put("orgName", jpAdmin.getDepartment());
+                map.put("orgId", jpAdmin.getId());
+                map.put("total", total);
+                map.put("normal", normal);
+                map.put("overtime", overtime);
+
+                mapList.add(map);
+            }
+            else {
+                map.put("total", (int)map.get("total") + total);
+                map.put("normal", (int)map.get("normal") + normal);
+                map.put("overtime", (int)map.get("overtime") + overtime);
+            }
+        }
+
+        return mapList;
+    }
+
+    @ApiOperation(value="根据园区统计职能单位工作情况")
+    @GetMapping(value = "statByParkOrg")
+    public MessageResult<List> statOrgByPark(String parkId){
+        MessageResult<List> msgResult = new MessageResult<>();
+
+        try {
+            List<Map> mapList = new ArrayList<>();
+
+            List<Org> orgList = parkOrgService.findOrgByParkId(parkId);
+
+            for (Org org: orgList) {
+                if(org.getOrgName().equals("相关乡镇场")){
+                    mapList.addAll(statByDepartment("相关乡镇场",parkId, org));
+                }
+                else {
+                    Map<String, Object> map = new HashMap<>();
+
+                    // 项目总数:当前职能部门有待办任务的项目总数
+                    int total = projectTaskService.countRunningProjectByOrgId(org.getOrgId(), parkId, "total");
+
+                    // 已超时项目数:当前职能部门有待办任务且已超时的项目总数
+                    // (如果一个单位在同一个项目有两个待办任务,其中一个超时,一个未超时,则算超时)
+                    int overtime = projectTaskService.countRunningProjectByOrgId(org.getOrgId(), parkId, "overtime");
+
+                    // 未超时项目数:当前职能部门有待办任务且未超时的项目总数
+                    int normal = total - overtime;
+
+                    map.put("orgName", org.getOrgName());
+                    map.put("orgId", org.getOrgId());
+                    map.put("total", total);
+                    map.put("normal", normal);
+                    map.put("overtime", overtime);
+
+                    mapList.add(map);
+                }
+            }
+
+            msgResult.setData(mapList);
+
+            msgResult.setResult(true);
+        }
+        catch(Exception ex){
+            msgResult.setMessage(ex.getMessage());
+            msgResult.setResult(false);
+
+            logger.error(ex.getMessage(),ex);
+        }
+
+        return msgResult;
+    }
+}

+ 1407 - 0
src/main/java/com/jpsoft/ipcps/controller/ProjectController.java

@@ -0,0 +1,1407 @@
+package com.jpsoft.ipcps.controller;
+
+import com.github.pagehelper.Page;
+import com.jpsoft.ipcps.common.PojoUtils;
+import com.jpsoft.ipcps.common.Sort;
+import com.jpsoft.ipcps.dto.MessageResult;
+import com.jpsoft.ipcps.entity.*;
+import com.jpsoft.ipcps.service.*;
+import com.jpsoft.ipcps.utils.FileUtils;
+import com.jpsoft.ipcps.utils.ServerConfig;
+import io.swagger.annotations.ApiImplicitParam;
+import io.swagger.annotations.ApiImplicitParams;
+import io.swagger.annotations.ApiOperation;
+import org.apache.commons.lang3.StringUtils;
+import org.apache.poi.ss.usermodel.*;
+import org.apache.poi.xssf.usermodel.XSSFWorkbook;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.util.ResourceUtils;
+import org.springframework.web.bind.annotation.*;
+import org.springframework.web.multipart.MultipartFile;
+
+import javax.servlet.http.HttpServletRequest;
+import java.io.*;
+import java.text.SimpleDateFormat;
+import java.util.*;
+
+@RestController
+@RequestMapping("/project")
+public class ProjectController {
+    private Logger logger = LoggerFactory.getLogger(getClass());
+
+    @Autowired
+    private ProjectService projectService;
+    @Autowired
+    private ProjectFileService projectFileService;
+    @Autowired
+    private ServerConfig serverConfig;
+    @Autowired
+    private JpAdminService jpAdminService;
+    @Autowired
+    private AdminRoleService adminRoleService;
+
+    @Autowired
+    private ProjectTaskService projectTaskService;
+
+
+
+    @ApiOperation(value="添加信息")
+    @PostMapping("add")
+    public MessageResult<Project> add(@ModelAttribute Project project,@RequestAttribute String subject,HttpServletRequest req) {
+        MessageResult<Project> msgResult = new MessageResult<>();
+
+        try {
+            if(StringUtils.isEmpty(project.getTownshipAdminId())){
+                project.setTownshipAdminId(null);
+            }
+
+            project.setProjectId(UUID.randomUUID().toString());
+            project.setDelFlag(false);
+            project.setCreateBy(subject);
+            project.setCreateDate(new Date());
+            //字段太长保存报错,先取出赋空值
+            String files = project.getFileUrls();
+            project.setFileUrls(null);
+            int affectCount = projectService.insert(project);
+            if (affectCount > 0) {
+                if(StringUtils.isNotBlank(files)){
+                    String [] fileUrls = files.split("\\*");
+                    for (String fileUrl : fileUrls){
+                        String [] url = fileUrl.split("\\?");
+                        String ext = url[1].substring(url[1].lastIndexOf(".")+1);
+                        ProjectFile projectFile = new ProjectFile();
+                        projectFile.setFileId(UUID.randomUUID().toString());
+                        projectFile.setProjectId(project.getProjectId());
+                        projectFile.setFileName(url[0]);
+                        projectFile.setFileAddress(url[1]);
+                        projectFile.setFileType(ext.toUpperCase());//文件后缀 转大写
+                        projectFile.setDelFlag(false);
+                        projectFile.setCreateBy(subject);
+                        projectFile.setCreateDate(new Date());
+                        projectFile.setFileSource("project");//文件来源
+                        projectFileService.insert(projectFile);
+                    }
+                }
+//            if (uploadFile != null && uploadFile.length > 0) {
+//                for (int i = 0; i < uploadFile.length; i++) {
+//                    MultipartFile file = uploadFile[i];
+//                    String[] ret = FileUtils.saveFile(serverConfig,file,"/project", req);
+//                    if (StringUtils.isBlank(ret[1])) {
+//                        continue;
+//                    }
+//                    String ext = ret[1].substring(ret[1].lastIndexOf(".")+1);
+//                    ProjectFile projectFile = new ProjectFile();
+//                    projectFile.setFileId(UUID.randomUUID().toString());
+//                    projectFile.setProjectId(project.getProjectId());
+//                    projectFile.setFileName(ret[0]);
+//                    projectFile.setFileAddress(ret[1]);
+//                    projectFile.setFileType(ext.toUpperCase());//文件后缀 转大写
+//                    projectFile.setDelFlag(false);
+//                    projectFile.setCreateBy(subject);
+//                    projectFile.setCreateDate(new Date());
+//                    projectFile.setFileSource("project");//文件来源
+//                    projectFileService.insert(projectFile);
+//                }
+//            }
+                msgResult.setResult(true);
+                msgResult.setData(project);
+            } else {
+                msgResult.setResult(false);
+                msgResult.setMessage("数据库添加失败");
+            }
+        }
+        catch(Exception ex){
+            logger.error(ex.getMessage(),ex);
+
+            msgResult.setResult(false);
+            msgResult.setMessage(ex.getMessage());
+        }
+
+        return msgResult;
+    }
+
+    @ApiOperation(value="获取信息")
+    @GetMapping("detail/{id}")
+    public MessageResult<Project> detail(@PathVariable("id") String id){
+        MessageResult<Project> msgResult = new MessageResult<>();
+
+        try {
+            Project project = projectService.get(id);
+            Map<String,Object> searchParms = new HashMap<>();
+            searchParms.put("projectId",project.getProjectId());
+            searchParms.put("fileSource","project");
+            searchParms.put("delFlag","0");
+
+            List<ProjectFile> lstFile = projectFileService.list(searchParms);
+            List<ProjectFile> lstRealFile = new ArrayList<ProjectFile>();
+            for(ProjectFile pf : lstFile){
+                lstRealFile.add(pf);
+            }
+            project.setPfList(lstRealFile);
+
+            String townshipAdminId = project.getTownshipAdminId();
+            if(StringUtils.isNotEmpty(townshipAdminId)) {
+                String[] townIds = townshipAdminId.split(",");
+                String townNames = "";
+                String townIdsNew = "";
+                for (String townId : townIds) {
+                    JpAdmin jpAdmin = jpAdminService.get(townId);
+                    if(jpAdmin != null) {
+                        townNames = townNames + jpAdmin.getRealName() + ",";
+                        townIdsNew = townIdsNew + jpAdmin.getId() + ",";
+                    }
+                }
+                project.setTownshipAdminId(townIdsNew);
+                project.setTownshipAdminName(townNames);
+            }
+
+            if (project != null) {
+                msgResult.setResult(true);
+                msgResult.setData(project);
+            } else {
+                msgResult.setResult(false);
+                msgResult.setMessage("数据库不存在该记录!");
+            }
+        }
+        catch(Exception ex){
+            logger.error(ex.getMessage(),ex);
+
+            msgResult.setResult(false);
+            msgResult.setMessage(ex.getMessage());
+        }
+
+        return msgResult;
+    }
+
+
+    @ApiOperation(value="更新用户")
+    @PostMapping("update")
+    public MessageResult<Project> update(@ModelAttribute Project project,@RequestAttribute String subject,HttpServletRequest req) {
+        MessageResult<Project> msgResult = new MessageResult<>();
+
+        try {
+            if(StringUtils.isEmpty(project.getTownshipAdminId())){
+                project.setTownshipAdminId(null);
+            }
+
+            project.setUpdateBy(subject);
+            project.setUpdateDate(new Date());
+            if(StringUtils.isNotBlank(project.getFileUrls())){
+                String [] fileUrls = project.getFileUrls().split("\\*");
+                for (String fileUrl : fileUrls){
+                    String [] url = fileUrl.split("\\?");
+                    String ext = url[1].substring(url[1].lastIndexOf(".")+1);
+                    ProjectFile projectFile = new ProjectFile();
+                    projectFile.setFileId(UUID.randomUUID().toString());
+                    projectFile.setProjectId(project.getProjectId());
+                    projectFile.setFileName(url[0]);
+                    projectFile.setFileAddress(url[1]);
+                    projectFile.setFileType(ext.toUpperCase());//文件后缀 转大写
+                    projectFile.setDelFlag(false);
+                    projectFile.setCreateBy(subject);
+                    projectFile.setCreateDate(new Date());
+                    projectFile.setFileSource("project");//文件来源
+                    projectFileService.insert(projectFile);
+
+                }
+            }
+//            if (uploadFile != null && uploadFile.length > 0) {
+//                //先删除
+//                Map<String,Object> searchParms = new HashMap<>();
+//                if (StringUtils.isNotEmpty(project.getProjectId())) {
+//                    searchParms.put("projectId",project.getProjectId());
+//                }
+//                searchParms.put("fileSource","project");
+//                searchParms.put("delFlag","0");
+//                List<ProjectFile> pfList = projectFileService.list(searchParms);
+//                for(ProjectFile pf : pfList){
+//                    pf.setDelFlag(true);
+//                    projectFileService.update(pf);
+//                }
+//                for (int i = 0; i < uploadFile.length; i++) {
+//                    MultipartFile file = uploadFile[i];
+//                    String[] ret = FileUtils.saveFile(serverConfig,file,"/project", req);
+//                    if (StringUtils.isBlank(ret[1])) {
+//                        continue;
+//                    }
+//                    String ext = ret[1].substring(ret[1].lastIndexOf(".")+1);
+//                    ProjectFile projectFile = new ProjectFile();
+//                    projectFile.setFileId(UUID.randomUUID().toString());
+//                    projectFile.setProjectId(project.getProjectId());
+//                    projectFile.setFileName(ret[0]);
+//                    projectFile.setFileAddress(ret[1]);
+//                    projectFile.setFileType(ext.toUpperCase());//文件后缀 转大写
+//                    projectFile.setDelFlag(false);
+//                    projectFile.setCreateBy(subject);
+//                    projectFile.setCreateDate(new Date());
+//                    projectFile.setFileSource("project");//文件来源
+//                    projectFileService.insert(projectFile);
+//                }
+//            }
+            String townId = project.getTownshipAdminId();
+            if(townId == null){
+                project.setTownshipAdminId("");
+            }else{
+                if (townId.endsWith(",")) {
+                    townId = townId.substring(0,townId.length() - 1);
+                    project.setTownshipAdminId(townId);
+                }
+            }
+            int affectCount = projectService.update(project);
+
+            if (affectCount > 0) {
+                msgResult.setResult(true);
+                msgResult.setData(project);
+            } else {
+                msgResult.setResult(false);
+                msgResult.setMessage("数据库更新失败");
+            }
+        }catch(Exception ex){
+                logger.error(ex.getMessage(), ex);
+
+                msgResult.setResult(false);
+                msgResult.setMessage(ex.getMessage());
+            }
+
+            return msgResult;
+        }
+
+        @ApiOperation(value = "删除用户-通用")
+        @PostMapping("delete/{id}")
+        public MessageResult<Project> delete (@PathVariable("id") String id){
+            MessageResult<Project> msgResult = new MessageResult<>();
+
+            try {
+                //int affectCount = projectService.delete(id);
+                Project project = projectService.get(id);
+                project.setDelFlag(true);
+                int affectCount = projectService.update(project);
+
+                if (affectCount > 0) {
+                    msgResult.setResult(true);
+                } else {
+                    msgResult.setResult(false);
+                    msgResult.setMessage("数据库删除失败");
+                }
+            } catch (Exception ex) {
+                logger.error(ex.getMessage(), ex);
+                msgResult.setResult(false);
+                msgResult.setMessage(ex.getMessage());
+            }
+
+            return msgResult;
+        }
+
+
+        @ApiOperation(value = "批量删除-通用")
+        @PostMapping("batchDelete")
+        public MessageResult<Project> batchDelete (@RequestParam(value = "ids", defaultValue = "") String ids){
+            MessageResult<Project> msgResult = new MessageResult<>();
+
+            try{
+                String[] arr = ids.split(",");
+                for(String id : arr){
+                    Project project = projectService.get(id);
+                    project.setDelFlag(true);
+                    projectService.update(project);
+                }
+                msgResult.setResult(true);
+            }catch (Exception ex) {
+                logger.error(ex.getMessage(), ex);
+                msgResult.setResult(false);
+                msgResult.setMessage(ex.getMessage());
+            }
+
+            return msgResult;
+        }
+
+        @ApiOperation(value = "列表-手机页面")
+        @RequestMapping(value = "list", method = RequestMethod.POST)
+        @ApiImplicitParams({
+                @ApiImplicitParam(name = "projectName", paramType = "query", value = "项目名称"),
+                @ApiImplicitParam(name = "startTime", paramType = "query", value = "开始时间"),
+                @ApiImplicitParam(name = "endTime", paramType = "query", value = "结束时间"),
+                @ApiImplicitParam(name = "status", paramType = "query", value = "流程当前步骤状态"),
+                @ApiImplicitParam(name = "isStart", paramType = "query", value = "是否已开启流程"),
+                @ApiImplicitParam(name = "procDefKey", paramType = "query", value = "流程定义key"),
+                @ApiImplicitParam(name = "roleId", paramType = "query", value = "角色ID"),
+                @ApiImplicitParam(name = "parkId", paramType = "query", value = "园区ID")
+        })
+        public MessageResult<Map> list (
+                @RequestParam(value = "projectName", defaultValue = "") String projectName,
+                @RequestParam(value = "startTime", defaultValue = "") String startTime,
+                @RequestParam(value = "endTime", defaultValue = "") String endTime,
+                @RequestParam(value = "procDefKey", defaultValue = "") String procDefKey,
+                @RequestParam(value = "parkId", defaultValue = "") String parkId,
+                @RequestParam(value = "isStart", defaultValue = "false") boolean isStart,
+                @RequestParam(value = "status", defaultValue = "") String status,
+                @RequestParam(value = "start", defaultValue = "0") int start,
+                @RequestParam(value = "length", defaultValue = "20") int length,
+                @RequestParam(value = "roleId", defaultValue = "") String roleId,
+                @RequestAttribute String subject,
+                HttpServletRequest request){
+        //当前用户ID
+        System.out.println(subject);
+
+        MessageResult<Map> msgResult = new MessageResult<>();
+
+        Map<String, Object> searchParms = new HashMap<>();
+
+        try {
+            List<Sort> sortList = new ArrayList<>();
+            sortList.add(new Sort("create_date_", "desc"));
+
+            if (StringUtils.isNotEmpty(projectName)) {
+                //标题
+                searchParms.put("projectName", "%" + projectName + "%");
+            }
+            if (StringUtils.isNotEmpty(startTime)) {
+                //起始时间-起
+                searchParms.put("startTime", startTime);
+            }
+            if (StringUtils.isNotEmpty(endTime)) {
+                //起始时间-止
+                searchParms.put("endTime", endTime);
+            }
+            if (StringUtils.isNotEmpty(procDefKey)) {
+                //项目进度
+                searchParms.put("procDefKey", procDefKey);
+            }
+            if (StringUtils.isNotEmpty(status)) {
+                if("-1".equals(status)){
+                    //未发起流程
+                    searchParms.put("isNotStart", status);
+                }else if("0".equals(status)){
+                    searchParms.put("isStart", status);//流程不为空
+                    searchParms.put("statusNull", status);//状态为null
+                }else {
+                    searchParms.put("status", status);
+                }
+            }
+
+            if (StringUtils.isNotEmpty(parkId)) {
+                //园区ID
+                searchParms.put("parkId", parkId);
+            }
+
+            if (isStart) {
+                //是否启动
+                searchParms.put("isStart", isStart);
+            }
+
+            if(StringUtils.isEmpty(roleId)){
+                //用户IDZLD
+                JpAdmin queryUser = jpAdminService.get(subject);
+
+                //List<AdminRole> roleList = queryUser.getAdminRoleList();
+                List<AdminRole> roleList = adminRoleService.listByAdminId(subject);
+
+                if(roleList!=null && roleList.size()>0){
+                    roleId = roleList.get(0).getRoleId();
+                }
+                else if(StringUtils.isNotEmpty(queryUser.getRoleId())){
+                    roleId = queryUser.getRoleId();
+                }
+            }
+
+            //根据用户和角色查询
+            AdminRole adminRole = adminRoleService.findByAIdAndRId(subject,roleId);
+            //Role role = roleService.get(roleId);
+            if (adminRole != null) {
+                if ("XMF".equals(adminRole.getRoleName())) {
+                    searchParms.put("XMF", subject);
+                } else if ("QYMS".equals(adminRole.getRoleName())) {
+                    searchParms.put("QYMS", subject);
+                } else if ("BLLD".equals(adminRole.getRoleName())) {
+                    searchParms.put("BLLD", subject);
+                } else if ("YQB".equals(adminRole.getRoleName())) {
+                    //园区办 YQB
+                    searchParms.put("YQB", subject);
+                } else if ("SYSADMIN".equals(adminRole.getRoleName())) {
+                    //项目管理员查全部
+                } else if ("ZLD".equals(adminRole.getRoleName())) {
+                    //总领导查全部
+                } else if ("TZCJZX".equals(adminRole.getRoleName())) {
+                    //CXQBXM查全部
+                } else {
+                    //否则都不能看到
+                    searchParms.put("XMF", "NO");
+                }
+            } else {
+                //否则都不能看到
+                searchParms.put("XMF", "NO");
+            }
+
+            //未删除条件
+            searchParms.put("delFlag", "0");
+
+            int pageNum = start / length;
+            pageNum++;
+            int pageSize = length;
+
+            Page<Project> page = projectService.pageSearch(searchParms, pageNum, pageSize, sortList);
+            List<Project> lstProject = new ArrayList<>();
+            for(Project project : page.getResult()){
+                //查询项目异常状态
+                Integer count = projectTaskService.warningCountByProjectId(project.getProjectId());
+                project.setWarningCount(count);
+
+                String townshipAdminId = project.getTownshipAdminId();
+                if(StringUtils.isNotEmpty(townshipAdminId)) {
+                    String[] townIds = townshipAdminId.split(",");
+                    String townNames = "";
+                    String townIdsNew = "";
+                    for (String townId : townIds) {
+                        JpAdmin jpAdmin = jpAdminService.get(townId);
+
+                        if(townNames.length()>0){
+                            townNames += ",";
+                            townIdsNew += ",";
+                        }
+
+                        if(jpAdmin != null) {
+                            townNames += jpAdmin.getRealName();
+                            townIdsNew += jpAdmin.getId();
+                        }
+                    }
+                    project.setTownshipAdminId(townIdsNew);
+                    project.setTownshipAdminName(townNames);
+                }
+
+                lstProject.add(project);
+            }
+
+            Map<String,Object> pageMap = new HashMap<>();
+            pageMap.put("recordsTotal",page.getTotal());
+            pageMap.put("recordsFiltered",page.getTotal());
+            pageMap.put("totalPage",page.getPages());
+            pageMap.put("pageNumber",page.getPageNum());
+            pageMap.put("pageSize",page.getPageSize());
+            pageMap.put("data", lstProject);
+            msgResult.setResult(true);
+            msgResult.setData(pageMap);
+        } catch (Exception ex) {
+            logger.error(ex.getMessage(), ex);
+            msgResult.setResult(false);
+        }
+        return msgResult;
+    }
+
+    @ApiOperation(value = "列表-后台")
+    @RequestMapping(value = "projectList", method = RequestMethod.POST)
+    @ApiImplicitParams({
+            @ApiImplicitParam(name = "projectName", paramType = "query", value = "项目名称"),
+            @ApiImplicitParam(name = "startTime", paramType = "query", value = "开始时间"),
+            @ApiImplicitParam(name = "endTime", paramType = "query", value = "结束时间"),
+            @ApiImplicitParam(name = "status", paramType = "query", value = "流程当前步骤状态"),
+            @ApiImplicitParam(name = "isStart", paramType = "query", value = "是否已开启流程"),
+            @ApiImplicitParam(name = "procDefKey", paramType = "query", value = "流程定义key"),
+            @ApiImplicitParam(name = "roleId", paramType = "query", value = "角色ID"),
+            @ApiImplicitParam(name = "parkId", paramType = "query", value = "园区ID")
+    })
+    public MessageResult<Map> projectList (
+            @RequestParam(value = "projectName", defaultValue = "") String projectName,
+            @RequestParam(value = "startTime", defaultValue = "") String startTime,
+            @RequestParam(value = "endTime", defaultValue = "") String endTime,
+            @RequestParam(value = "procDefKey", defaultValue = "") String procDefKey,
+            @RequestParam(value = "parkId", defaultValue = "") String parkId,
+            @RequestParam(value = "isStart", defaultValue = "false") boolean isStart,
+            @RequestParam(value = "status", defaultValue = "") String status,
+            @RequestParam(value = "start", defaultValue = "0") int start,
+            @RequestParam(value = "length", defaultValue = "20") int length,
+            @RequestParam(value = "roleId", defaultValue = "") String roleId,
+            @RequestAttribute String subject,
+            HttpServletRequest request){
+        //当前用户ID
+        System.out.println(subject);
+
+        MessageResult<Map> msgResult = new MessageResult<>();
+
+        Map<String, Object> searchParms = new HashMap<>();
+
+        try {
+            List<Sort> sortList = new ArrayList<>();
+            sortList.add(new Sort("create_date_", "desc"));
+
+            if (StringUtils.isNotEmpty(projectName)) {
+                //标题
+                searchParms.put("projectName", "%" + projectName + "%");
+            }
+            if (StringUtils.isNotEmpty(startTime)) {
+                //起始时间-起
+                searchParms.put("startTime", startTime);
+            }
+            if (StringUtils.isNotEmpty(endTime)) {
+                //起始时间-止
+                searchParms.put("endTime", endTime);
+            }
+            if (StringUtils.isNotEmpty(procDefKey)) {
+                //项目进度
+                searchParms.put("procDefKey", procDefKey);
+            }
+            if (StringUtils.isNotEmpty(status)) {
+                if("-1".equals(status)){
+                    //未发起流程
+                    searchParms.put("isNotStart", status);
+                }else if("0".equals(status)){
+                    searchParms.put("isStart", status);//流程不为空
+                    searchParms.put("statusNull", status);//状态为null
+                }else {
+                    searchParms.put("status", status);
+                }
+            }
+
+            if (StringUtils.isNotEmpty(parkId)) {
+                //园区ID
+                searchParms.put("parkId", parkId);
+            }
+
+            if (isStart) {
+                //是否启动
+                searchParms.put("isStart", isStart);
+            }
+
+            if(StringUtils.isEmpty(roleId)){
+                //用户IDZLD
+                JpAdmin queryUser = jpAdminService.get(subject);
+
+                //List<AdminRole> roleList = queryUser.getAdminRoleList();
+                List<AdminRole> roleList = adminRoleService.listByAdminId(subject);
+
+                if(roleList!=null && roleList.size()>0){
+                    roleId = roleList.get(0).getRoleId();
+                }
+                else if(StringUtils.isNotEmpty(queryUser.getRoleId())){
+                    roleId = queryUser.getRoleId();
+                }
+            }
+
+            //根据用户和角色查询
+            AdminRole adminRole = adminRoleService.findByAIdAndRId(subject,roleId);
+
+            int count1 = adminRoleService.findCountByAIdAndRName(subject,"SYSADMIN");
+            int count2 = adminRoleService.findCountByAIdAndRName(subject,"ZLD");
+            int count3 = adminRoleService.findCountByAIdAndRName(subject,"TZCJZX");
+            if(count1 > 0){
+                //查全部
+            }else if(count2 > 0){
+                //查全部
+            }else if(count3 > 0){
+                //查全部
+            }else {
+                //Role role = roleService.get(roleId);
+                if (adminRole != null) {
+                    if ("XMF".equals(adminRole.getRoleName())) {
+                        searchParms.put("XMF", subject);
+                    } else if ("QYMS".equals(adminRole.getRoleName())) {
+                        searchParms.put("QYMS", subject);
+                    } else if ("BLLD".equals(adminRole.getRoleName())) {
+                        searchParms.put("BLLD", subject);
+                    } else if ("YQB".equals(adminRole.getRoleName())) {
+                        //园区办 YQB
+                        searchParms.put("YQB", subject);
+                    } else if ("SYSADMIN".equals(adminRole.getRoleName())) {
+                        //项目管理员查全部
+                    } else if ("ZLD".equals(adminRole.getRoleName())) {
+                        //总领导查全部
+                    } else if ("TZCJZX".equals(adminRole.getRoleName())) {
+                        //CXQBXM查全部
+                    } else {
+                        //否则都不能看到
+                        searchParms.put("XMF", "NO");
+                    }
+                } else {
+                    //否则都不能看到
+                    searchParms.put("XMF", "NO");
+                }
+            }
+
+            //未删除条件
+            searchParms.put("delFlag", "0");
+
+            int pageNum = start / length;
+            pageNum++;
+            int pageSize = length;
+
+            Page<Project> page = projectService.pageSearch(searchParms, pageNum, pageSize, sortList);
+            List<Project> lstProject = new ArrayList<>();
+            for(Project project : page.getResult()){
+                //查询项目异常状态
+                Integer count = projectTaskService.warningCountByProjectId(project.getProjectId());
+                project.setWarningCount(count);
+
+                String townshipAdminId = project.getTownshipAdminId();
+                if(StringUtils.isNotEmpty(townshipAdminId)) {
+                    String[] townIds = townshipAdminId.split(",");
+                    String townNames = "";
+                    String townIdsNew = "";
+                    for (String townId : townIds) {
+                        JpAdmin jpAdmin = jpAdminService.get(townId);
+
+                        if(townNames.length()>0){
+                            townNames += ",";
+                            townIdsNew += ",";
+                        }
+
+                        if(jpAdmin != null) {
+                            townNames += jpAdmin.getRealName();
+                            townIdsNew += jpAdmin.getId();
+                        }
+                    }
+                    project.setTownshipAdminId(townIdsNew);
+                    project.setTownshipAdminName(townNames);
+                }
+
+                lstProject.add(project);
+            }
+
+            Map<String,Object> pageMap = new HashMap<>();
+            pageMap.put("recordsTotal",page.getTotal());
+            pageMap.put("recordsFiltered",page.getTotal());
+            pageMap.put("totalPage",page.getPages());
+            pageMap.put("pageNumber",page.getPageNum());
+            pageMap.put("pageSize",page.getPageSize());
+            pageMap.put("data", lstProject);
+            msgResult.setResult(true);
+            msgResult.setData(pageMap);
+        } catch (Exception ex) {
+            logger.error(ex.getMessage(), ex);
+            msgResult.setResult(false);
+        }
+        return msgResult;
+    }
+
+    /**
+     * 搜索
+     * @return
+     *//*
+    @RequestMapping(value = "/projectData", produces = "text/html;charset=UTF-8")
+    @ResponseBody
+    public HashMap<String,Object> projectData(@RequestParam(value = "pageIndex", defaultValue = "1") Integer pageIndex,
+                                          @RequestParam(value = "pageSize", defaultValue = "15") Integer pageSize,
+                                          String project){
+        HashMap<String,Object> retMap = new HashMap<String,Object>();
+        try{
+            if(!StringUtils.isNotBlank(orgName)){
+                throw new CustomException("工会智能搜索姓名不能为空!");
+            }
+            Page<OrgInfo> page = orgInfoService.pageSearchByOrgName(orgName, pageIndex, pageSize, "name asc");
+            List<OrgInfo> orgInfoList = page.getContent();
+            List<Map> dataMapList = new ArrayList<Map>();//封装的数据列表,一般为分页查询出来的entity列表
+            if(orgInfoList != null && orgInfoList.size()>0){
+                for (int i = 0; i < orgInfoList.size(); i++) {
+                    HashMap<String,Object> dataMap = new HashMap<String,Object>();
+
+                    dataMap.put("id", orgInfoList.get(i).getId());//序号
+                    dataMap.put("text", orgInfoList.get(i).getName());//文本
+
+                    dataMapList.add(dataMap);
+                }
+
+            }
+            retMap.put("dataMapList", dataMapList);
+            retMap.put("totalRows", page.getTotalElements());//总条数
+        }catch (Exception e) {
+            logger.error(e.getMessage(),e);
+        }
+        return retMap;
+    }*/
+
+    @ApiOperation(value="全部项目列表")
+    @RequestMapping(value = "allList",method = RequestMethod.POST)
+    public MessageResult<List<Project>> allList(HttpServletRequest request){
+        MessageResult<List<Project>> msgResult = new MessageResult<>();
+        List<Project> list = projectService.list();
+        msgResult.setResult(true);
+        msgResult.setData(list);
+        return msgResult;
+    }
+
+    @ApiOperation(value="获取项目信息-手机页面")
+    @GetMapping("detailMethod")
+    @ApiImplicitParams({
+            @ApiImplicitParam(name = "projectId", paramType = "query", value = "项目ID"),
+            @ApiImplicitParam(name = "taskDefKey", paramType = "query", value = "流程步骤"),
+    })
+    public MessageResult<Project> detailMethod(
+            @RequestParam(value = "projectId", defaultValue = "") String projectId,
+            @RequestParam(value = "taskDefKey", defaultValue = "") String taskDefKey
+            ){
+        MessageResult<Project> msgResult = new MessageResult<>();
+
+        try {
+            if(!StringUtils.isNoneBlank(projectId)){
+                msgResult.setResult(false);
+                msgResult.setMessage("项目编号不能为空");
+                return msgResult;
+            }
+
+            Project project = projectService.get(projectId);
+            Map<String,Object> searchParms = new HashMap<>();
+            searchParms.put("projectId",project.getProjectId());
+            searchParms.put("fileSource","project");
+            searchParms.put("delFlag","0");
+            List<ProjectFile> lstFile = projectFileService.list(searchParms);
+            List<ProjectFile> lstRealFile = new ArrayList<ProjectFile>();
+            for(ProjectFile pf : lstFile){
+                lstRealFile.add(pf);
+            }
+            project.setPfList(lstRealFile);
+
+            //存一下上传步骤
+            String taskName = "";
+            List<Map> taskList = new ArrayList<Map>();
+            if(!StringUtils.isNoneBlank(taskDefKey)){
+                taskList = projectTaskService.findByProjectId(projectId);
+            }else{
+                taskList = projectTaskService.findByPIdANDDefKey(projectId,taskDefKey);
+            }
+
+            for(int i = 0;i< taskList.size(); i ++){
+                Map map = taskList.get(i);
+                taskName += map.get("taskName");
+                if(i > 0 && i != taskList.size()){
+                    taskName += ",";
+                }
+            }
+            project.setTaskName(taskName);
+
+            if (project != null) {
+                msgResult.setResult(true);
+                msgResult.setData(project);
+            } else {
+                msgResult.setResult(false);
+                msgResult.setMessage("数据库不存在该记录!");
+            }
+        }
+        catch(Exception ex){
+            logger.error(ex.getMessage(),ex);
+
+            msgResult.setResult(false);
+            msgResult.setMessage(ex.getMessage());
+        }
+
+        return msgResult;
+    }
+
+
+    @ApiOperation(value="获取项目汇总")
+    @RequestMapping(value = "projectCollect",method = RequestMethod.POST)
+    public MessageResult<Map> projectCollect(){
+        MessageResult<Map> msgResult = new MessageResult<>();
+
+        try {
+            int num1 = projectService.getProjectByStatus("0");
+            int num2 = projectService.getProjectByStatus("1");
+            int num3 = projectService.getProjectByStatus("2");
+            int num4 = projectService.getProjectByStatus("3");
+
+            List<Project> list = projectService.list();
+
+            int total = list.size();
+
+            Map<String, Object> map = new HashMap<>();
+
+            map.put("num_", total);
+            map.put("0", num1);
+            map.put("1", num2);
+            map.put("2", num3);
+            map.put("3", num4);
+
+            msgResult.setResult(true);
+            msgResult.setData(map);
+        }
+        catch (Exception ex){
+            logger.error(ex.getMessage(),ex);
+
+            msgResult.setResult(false);
+            msgResult.setMessage(ex.getMessage());
+        }
+
+
+        return msgResult;
+    }
+
+    @ApiOperation(value="获取项目汇总列表")
+    @RequestMapping(value = "projectCollectList",method = RequestMethod.POST)
+    public MessageResult<List<Map<String, Object>>> projectCollectList(){
+        MessageResult<List<Map<String, Object>>> msgResult = new MessageResult<>();
+
+        List<Map<String, Object>> list = projectService.groupByParkId();
+
+        List<Map<String, Object>> newList = new ArrayList<Map<String, Object>>();
+
+        for (Map<String, Object> map1:list) {
+            String parkId = map1.get("park_id_").toString();
+            List<Map<String, Object>> list1 = projectService.groupByStatus(parkId);
+            map1.put("datail_",list1);
+            newList.add(map1);
+        }
+
+        msgResult.setResult(true);
+        msgResult.setData(newList);
+
+        return msgResult;
+    }
+
+    @ApiOperation(value="获取在建和拟建项目统计")
+    @RequestMapping(value = "projectConstructionList",method = RequestMethod.POST)
+    @ApiImplicitParams({
+            @ApiImplicitParam(name = "roleId", paramType = "query", value = "角色ID")
+    })
+    public MessageResult<Map> projectConstructionList(
+            @RequestAttribute String subject,
+            @RequestParam(value = "roleId", defaultValue = "") String roleId
+    ){
+        String userType = "";
+
+        if(StringUtils.isEmpty(roleId)){
+            //用户IDZLD
+            JpAdmin queryUser = jpAdminService.get(subject);
+
+            List<AdminRole> roleList = queryUser.getAdminRoleList();
+
+            if(roleList!=null && roleList.size()>0){
+                roleId = roleList.get(0).getRoleId();
+            }
+            else if(StringUtils.isNotEmpty(queryUser.getRoleId())){
+                roleId = queryUser.getRoleId();
+            }
+        }
+
+        //根据用户和角色查询
+        AdminRole adminRole = adminRoleService.findByAIdAndRId(subject,roleId);
+        //用户ID
+        //JpAdmin queryUser = jpAdminService.get(subject);
+        int count1 = 0;
+        int count2 = 0;
+        int count3 = 0;
+        MessageResult<Map> msgResult = new MessageResult<Map>();
+        if(adminRole != null) {
+            userType = adminRole.getRoleName();
+
+           // int count00 = projectService.getProjectByStatusANDLAIdANDKey("0",userType,subject,"ProjectPerformanceTransfer");//履约转办阶段-拟建项目 ProjectPerformanceTransfer
+            count1 = projectService.getProjectByStatusANDLAIdANDKey(null,null,subject,"ProjectPerformanceTransfer");//履约转办阶段-拟建项目 ProjectPerformanceTransfer
+            count2 = projectService.getProjectByStatusANDLAIdANDKey("1",null,subject,"ProjectStartUpConstruction");//项目开工建设阶段 - 在建项目1 ProjectStartUpConstruction
+            count3 = projectService.getProjectByStatusANDLAIdANDKey("2",null,subject,"ProjectCompletedAndPutIntoOperation");//项目建成投产阶段 - 在建项目2 ProjectCompletedAndPutIntoOperation
+            //int over = projectService.getProjectByStatusANDProjectAdminId("3",subject);//已完成
+        }
+
+        Map<String, Object> rMap = new HashMap<String,Object>();
+        rMap.put("proposedNum", count1 + count2);//拟建项目 1未完成 2未完成
+        rMap.put("constructionNum", count3);//在建项目 2完成 3 未完成
+        msgResult.setResult(true);
+        msgResult.setData(rMap);
+
+        return msgResult;
+    }
+
+    @ApiOperation(value = "项目完成情况报表")
+    @RequestMapping(value = "completionReport", method = RequestMethod.POST)
+    @ApiImplicitParams({
+            @ApiImplicitParam(name = "projectName", paramType = "query", value = "项目名称"),
+            @ApiImplicitParam(name = "startTime", paramType = "query", value = "开始时间"),
+            @ApiImplicitParam(name = "endTime", paramType = "query", value = "结束时间"),
+            @ApiImplicitParam(name = "status", paramType = "query", value = "流程当前步骤状态"),
+            @ApiImplicitParam(name = "isStart", paramType = "query", value = "是否已开启流程"),
+            @ApiImplicitParam(name = "procDefKey", paramType = "query", value = "流程定义key"),
+            @ApiImplicitParam(name = "roleId", paramType = "query", value = "角色ID"),
+            @ApiImplicitParam(name = "parkId", paramType = "query", value = "园区ID"),
+            @ApiImplicitParam(name = "startDate", paramType = "query", value = "开始时间"),
+            @ApiImplicitParam(name = "endDate", paramType = "query", value = "结束")
+    })
+    public MessageResult<Map> completionReport(
+            @RequestParam(value = "projectName", defaultValue = "") String projectName,
+            @RequestParam(value = "startTime", defaultValue = "") String startTime,
+            @RequestParam(value = "endTime", defaultValue = "") String endTime,
+            @RequestParam(value = "procDefKey", defaultValue = "") String procDefKey,
+            @RequestParam(value = "parkId", defaultValue = "") String parkId,
+            @RequestParam(value = "isStart", defaultValue = "false") boolean isStart,
+            @RequestParam(value = "status", defaultValue = "") String status,
+            @RequestParam(value = "start", defaultValue = "0") int start,
+            @RequestParam(value = "length", defaultValue = "20") int length,
+            @RequestParam(value = "roleId", defaultValue = "") String roleId,
+            @RequestParam(value = "startDate", defaultValue = "") String startDate,
+            @RequestParam(value = "endDate", defaultValue = "") String endDate,
+            @RequestAttribute String subject,
+            HttpServletRequest request) {
+        //当前用户ID
+        System.out.println(subject);
+
+        MessageResult<Map> msgResult = new MessageResult<>();
+
+        Map<String, Object> searchParms = new HashMap<>();
+
+        try {
+            List<Sort> sortList = new ArrayList<>();
+            sortList.add(new Sort("park_id_", "asc"));
+            sortList.add(new Sort("start_time_", "asc"));
+
+            if (StringUtils.isNotEmpty(projectName)) {
+                //标题
+                searchParms.put("projectName", "%" + projectName + "%");
+            }
+            if (StringUtils.isNotEmpty(startTime)) {
+                //起始时间-起
+                searchParms.put("startTime", startTime);
+            }
+            if (StringUtils.isNotEmpty(endTime)) {
+                //起始时间-止
+                searchParms.put("endTime", endTime);
+            }
+            if (StringUtils.isNotEmpty(procDefKey)) {
+                //项目进度
+                searchParms.put("procDefKey", procDefKey);
+            }
+            if (StringUtils.isNotEmpty(status)) {
+                if ("-1".equals(status)) {
+                    //未发起流程
+                    searchParms.put("isNotStart", status);
+                } else if ("0".equals(status)) {
+                    searchParms.put("isStart", status);//流程不为空
+                    searchParms.put("statusNull", status);//状态为null
+                } else if("1".equals(status)){
+                    searchParms.put("status", status);
+                    if (StringUtils.isNotEmpty(startDate)) {
+                        searchParms.put("timeNode1startTime", startDate);
+                    }
+                    if (StringUtils.isNotEmpty(endDate)) {
+                        searchParms.put("timeNode1endTime", endDate);
+                    }
+                } else if("2".equals(status)){
+                    searchParms.put("status", status);
+                    if (StringUtils.isNotEmpty(startDate)) {
+                        searchParms.put("timeNode2startTime", startDate);
+                    }
+                    if (StringUtils.isNotEmpty(endDate)) {
+                        searchParms.put("timeNode2endTime", endDate);
+                    }
+                } else if("3".equals(status)){
+                    searchParms.put("status", status);
+                    if (StringUtils.isNotEmpty(startDate)) {
+                        searchParms.put("timeNode3startTime", startDate);
+                    }
+                    if (StringUtils.isNotEmpty(endDate)) {
+                        searchParms.put("timeNode3endTime", endDate);
+                    }
+                }
+            }else{
+                if (StringUtils.isNotEmpty(startDate)) {
+                    searchParms.put("startTime", startDate);
+                }
+
+                if (StringUtils.isNotEmpty(endDate)) {
+                    searchParms.put("endTime", endDate);
+                }
+            }
+
+            if (StringUtils.isNotEmpty(parkId)) {
+                //园区ID
+                searchParms.put("parkId", parkId);
+            }
+
+            if (isStart) {
+                //是否启动
+                searchParms.put("isStart", isStart);
+            }
+
+            if (StringUtils.isEmpty(roleId)) {
+                //用户IDZLD
+                JpAdmin queryUser = jpAdminService.get(subject);
+
+                //List<AdminRole> roleList = queryUser.getAdminRoleList();
+                List<AdminRole> roleList = adminRoleService.listByAdminId(subject);
+
+                if (roleList != null && roleList.size() > 0) {
+                    roleId = roleList.get(0).getRoleId();
+                } else if (StringUtils.isNotEmpty(queryUser.getRoleId())) {
+                    roleId = queryUser.getRoleId();
+                }
+            }
+
+            //根据用户和角色查询
+            AdminRole adminRole = adminRoleService.findByAIdAndRId(subject, roleId);
+
+            int count1 = adminRoleService.findCountByAIdAndRName(subject, "SYSADMIN");
+            int count2 = adminRoleService.findCountByAIdAndRName(subject, "ZLD");
+            int count3 = adminRoleService.findCountByAIdAndRName(subject, "TZCJZX");
+            if (count1 > 0) {
+                //查全部
+            } else if (count2 > 0) {
+                //查全部
+            } else if (count3 > 0) {
+                //查全部
+            } else {
+                //Role role = roleService.get(roleId);
+                if (adminRole != null) {
+                    if ("XMF".equals(adminRole.getRoleName())) {
+                        searchParms.put("XMF", subject);
+                    } else if ("QYMS".equals(adminRole.getRoleName())) {
+                        searchParms.put("QYMS", subject);
+                    } else if ("BLLD".equals(adminRole.getRoleName())) {
+                        searchParms.put("BLLD", subject);
+                    } else if ("YQB".equals(adminRole.getRoleName())) {
+                        //园区办 YQB
+                        searchParms.put("YQB", subject);
+                    } else if ("SYSADMIN".equals(adminRole.getRoleName())) {
+                        //项目管理员查全部
+                    } else if ("ZLD".equals(adminRole.getRoleName())) {
+                        //总领导查全部
+                    } else if ("TZCJZX".equals(adminRole.getRoleName())) {
+                        //CXQBXM查全部
+                    } else {
+                        //否则都不能看到
+                        searchParms.put("XMF", "NO");
+                    }
+                } else {
+                    //否则都不能看到
+                    searchParms.put("XMF", "NO");
+                }
+            }
+
+            //未删除条件
+            searchParms.put("delFlag", "0");
+
+            int pageNum = start / length;
+            pageNum++;
+            int pageSize = length;
+
+            Page<Project> page = projectService.pageSearch(searchParms, pageNum, pageSize, sortList);
+            List<Project> lstProject = new ArrayList<>();
+            for (Project project : page.getResult()) {
+                String townshipAdminId = project.getTownshipAdminId();
+                if (StringUtils.isNotEmpty(townshipAdminId)) {
+                    String[] townIds = townshipAdminId.split(",");
+                    String townNames = "";
+                    String townIdsNew = "";
+                    for (String townId : townIds) {
+                        JpAdmin jpAdmin = jpAdminService.get(townId);
+
+                        if (townNames.length() > 0) {
+                            townNames += ",";
+                            townIdsNew += ",";
+                        }
+
+                        if (jpAdmin != null) {
+                            townNames += jpAdmin.getRealName();
+                            townIdsNew += jpAdmin.getId();
+                        }
+                    }
+                    project.setTownshipAdminId(townIdsNew);
+                    project.setTownshipAdminName(townNames);
+                }
+
+                String pAdminId = project.getProjectAdminId();
+                if (StringUtils.isNotEmpty(townshipAdminId)) {
+                    JpAdmin jpAdmin= jpAdminService.get(pAdminId);
+                    if(jpAdmin != null) {
+                        project.setProjectAdmin(jpAdmin);
+                    }
+                }
+                lstProject.add(project);
+            }
+
+            Map<String, Object> pageMap = new HashMap<>();
+            pageMap.put("recordsTotal", page.getTotal());
+            pageMap.put("recordsFiltered", page.getTotal());
+            pageMap.put("totalPage", page.getPages());
+            pageMap.put("pageNumber", page.getPageNum());
+            pageMap.put("pageSize", page.getPageSize());
+            pageMap.put("data", lstProject);
+            msgResult.setResult(true);
+            msgResult.setData(pageMap);
+        } catch (Exception ex) {
+            logger.error(ex.getMessage(), ex);
+            msgResult.setResult(false);
+        }
+        return msgResult;
+    }
+
+    @ApiOperation(value = "导出项目完成情况报表")
+    @RequestMapping(value = "exportCompletionXls", method = RequestMethod.POST)
+    public MessageResult<String> exportCompletionXls(
+            @RequestParam(value = "projectName", defaultValue = "") String projectName,
+            @RequestParam(value = "startTime", defaultValue = "") String startTime,
+            @RequestParam(value = "endTime", defaultValue = "") String endTime,
+            @RequestParam(value = "procDefKey", defaultValue = "") String procDefKey,
+            @RequestParam(value = "parkId", defaultValue = "") String parkId,
+            @RequestParam(value = "isStart", defaultValue = "false") boolean isStart,
+            @RequestParam(value = "status", defaultValue = "") String status,
+            @RequestParam(value = "start", defaultValue = "0") int start,
+            @RequestParam(value = "length", defaultValue = "100000") int length,
+            @RequestParam(value = "roleId", defaultValue = "") String roleId,
+            @RequestParam(value = "startDate", defaultValue = "") String startDate,
+            @RequestParam(value = "endDate", defaultValue = "") String endDate,
+            @RequestAttribute String subject, HttpServletRequest req) throws Exception {
+        MessageResult<String> msgResult = new MessageResult<>();
+
+        try {
+            List<Sort> sortList = new ArrayList<>();
+            sortList.add(new Sort("park_id_", "asc"));
+            sortList.add(new Sort("start_time_", "asc"));
+
+            Map<String, Object> searchParms = new HashMap<>();
+            if (StringUtils.isNotEmpty(projectName)) {
+                //标题
+                searchParms.put("projectName", "%" + projectName + "%");
+            }
+            if (StringUtils.isNotEmpty(startTime)) {
+                //起始时间-起
+                searchParms.put("startTime", startTime);
+            }
+            if (StringUtils.isNotEmpty(endTime)) {
+                //起始时间-止
+                searchParms.put("endTime", endTime);
+            }
+            if (StringUtils.isNotEmpty(procDefKey)) {
+                //项目进度
+                searchParms.put("procDefKey", procDefKey);
+            }
+            if (StringUtils.isNotEmpty(status)) {
+                if ("-1".equals(status)) {
+                    //未发起流程
+                    searchParms.put("isNotStart", status);
+                } else if ("0".equals(status)) {
+                    searchParms.put("isStart", status);//流程不为空
+                    searchParms.put("statusNull", status);//状态为null
+                } else if("1".equals(status)){
+                    searchParms.put("status", status);
+                    if (StringUtils.isNotEmpty(startDate)) {
+                        searchParms.put("timeNode1startTime", startDate);
+                    }
+                    if (StringUtils.isNotEmpty(endDate)) {
+                        searchParms.put("timeNode1endTime", endDate);
+                    }
+                } else if("2".equals(status)){
+                    searchParms.put("status", status);
+                    if (StringUtils.isNotEmpty(startDate)) {
+                        searchParms.put("timeNode2startTime", startDate);
+                    }
+                    if (StringUtils.isNotEmpty(endDate)) {
+                        searchParms.put("timeNode2endTime", endDate);
+                    }
+                } else if("3".equals(status)){
+                    searchParms.put("status", status);
+                    if (StringUtils.isNotEmpty(startDate)) {
+                        searchParms.put("timeNode3startTime", startDate);
+                    }
+                    if (StringUtils.isNotEmpty(endDate)) {
+                        searchParms.put("timeNode3endTime", endDate);
+                    }
+                }
+            }else{
+                if (StringUtils.isNotEmpty(startDate)) {
+                    searchParms.put("startTime", startDate);
+                }
+
+                if (StringUtils.isNotEmpty(endDate)) {
+                    searchParms.put("endTime", endDate);
+                }
+            }
+
+            if (StringUtils.isNotEmpty(parkId)) {
+                //园区ID
+                searchParms.put("parkId", parkId);
+            }
+
+            if (isStart) {
+                //是否启动
+                searchParms.put("isStart", isStart);
+            }
+
+            if (StringUtils.isEmpty(roleId)) {
+                //用户IDZLD
+                JpAdmin queryUser = jpAdminService.get(subject);
+
+                //List<AdminRole> roleList = queryUser.getAdminRoleList();
+                List<AdminRole> roleList = adminRoleService.listByAdminId(subject);
+
+                if (roleList != null && roleList.size() > 0) {
+                    roleId = roleList.get(0).getRoleId();
+                } else if (StringUtils.isNotEmpty(queryUser.getRoleId())) {
+                    roleId = queryUser.getRoleId();
+                }
+            }
+
+            //根据用户和角色查询
+            AdminRole adminRole = adminRoleService.findByAIdAndRId(subject, roleId);
+
+            int count1 = adminRoleService.findCountByAIdAndRName(subject, "SYSADMIN");
+            int count2 = adminRoleService.findCountByAIdAndRName(subject, "ZLD");
+            int count3 = adminRoleService.findCountByAIdAndRName(subject, "TZCJZX");
+            if (count1 > 0) {
+                //查全部
+            } else if (count2 > 0) {
+                //查全部
+            } else if (count3 > 0) {
+                //查全部
+            } else {
+                //Role role = roleService.get(roleId);
+                if (adminRole != null) {
+                    if ("XMF".equals(adminRole.getRoleName())) {
+                        searchParms.put("XMF", subject);
+                    } else if ("QYMS".equals(adminRole.getRoleName())) {
+                        searchParms.put("QYMS", subject);
+                    } else if ("BLLD".equals(adminRole.getRoleName())) {
+                        searchParms.put("BLLD", subject);
+                    } else if ("YQB".equals(adminRole.getRoleName())) {
+                        //园区办 YQB
+                        searchParms.put("YQB", subject);
+                    } else if ("SYSADMIN".equals(adminRole.getRoleName())) {
+                        //项目管理员查全部
+                    } else if ("ZLD".equals(adminRole.getRoleName())) {
+                        //总领导查全部
+                    } else if ("TZCJZX".equals(adminRole.getRoleName())) {
+                        //CXQBXM查全部
+                    } else {
+                        //否则都不能看到
+                        searchParms.put("XMF", "NO");
+                    }
+                } else {
+                    //否则都不能看到
+                    searchParms.put("XMF", "NO");
+                }
+            }
+
+            //未删除条件
+            searchParms.put("delFlag", "0");
+
+            int pageNum = start / length;
+            pageNum++;
+            int pageSize = length;
+
+            Page<Project> page = projectService.pageSearch(searchParms, pageNum, pageSize, sortList);
+            List<Project> lstProject = new ArrayList<>();
+            for (Project project : page.getResult()) {
+                String townshipAdminId = project.getTownshipAdminId();
+                if (StringUtils.isNotEmpty(townshipAdminId)) {
+                    String[] townIds = townshipAdminId.split(",");
+                    String townNames = "";
+                    String townIdsNew = "";
+                    for (String townId : townIds) {
+                        JpAdmin jpAdmin = jpAdminService.get(townId);
+
+                        if (townNames.length() > 0) {
+                            townNames += ",";
+                            townIdsNew += ",";
+                        }
+
+                        if (jpAdmin != null) {
+                            townNames += jpAdmin.getRealName();
+                            townIdsNew += jpAdmin.getId();
+                        }
+                    }
+
+                    project.setTownshipAdminId(townIdsNew);
+                    project.setTownshipAdminName(townNames);
+
+                }
+
+                String pAdminId = project.getProjectAdminId();
+                if (StringUtils.isNotEmpty(townshipAdminId)) {
+                    JpAdmin jpAdmin= jpAdminService.get(pAdminId);
+                    if(jpAdmin != null) {
+                        project.setProjectAdmin(jpAdmin);
+                    }
+                }
+                lstProject.add(project);
+            }
+            File file = ResourceUtils.getFile("classpath:static/projectCompletion.xlsx");
+            InputStream inputStream = new FileInputStream(file);
+
+            XSSFWorkbook wb = new XSSFWorkbook(inputStream);
+            Sheet sheet = wb.getSheetAt(0);
+            int startRowIndex = 2;
+            SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM");
+            for (int i = 0; i < lstProject.size(); i++) {
+                Row row = sheet.createRow(startRowIndex + i);
+                Project project = lstProject.get(i);
+
+                row.createCell(0).setCellValue(project.getPark().getTitle());
+                row.createCell(1).setCellValue(project.getTitle());
+                String pStartTime = "";
+                if(project.getStartTime() != null){
+                    pStartTime = sdf.format(project.getStartTime());
+                }
+                row.createCell(2).setCellValue(pStartTime);
+                row.createCell(3).setCellValue(project.getSize());
+                row.createCell(4).setCellValue(project.getAddress());
+                row.createCell(5).setCellValue(project.getLandScale());
+                row.createCell(6).setCellValue(project.getDetail());
+                row.createCell(7).setCellValue(project.getTownshipAdminName());
+                row.createCell(8).setCellValue(project.getSecretaryAdmin().getRealName());
+                row.createCell(9).setCellValue(project.getLeaderAdmin().getRealName());
+                row.createCell(10).setCellValue(project.getUnit());
+                row.createCell(11).setCellValue(project.getProjectAdmin().getRealName());
+                row.createCell(12).setCellValue(project.getProjectAdmin().getTel());
+                row.createCell(13).setCellValue(project.getProcessName());
+                String pTimeNode1 = "";
+                if(project.getTimeNode1() != null){
+                    pTimeNode1 = sdf.format(project.getTimeNode1());
+                }
+                row.createCell(14).setCellValue(pTimeNode1);
+                String pTimeNode2 = "";
+                if(project.getTimeNode2() != null){
+                    pTimeNode2 = sdf.format(project.getTimeNode2());
+                }
+                row.createCell(15).setCellValue(pTimeNode2);
+                String pTimeNode3 = "";
+                if(project.getTimeNode3() != null){
+                    pTimeNode3 = sdf.format(project.getTimeNode3());
+                }
+                row.createCell(16).setCellValue(pTimeNode3);
+            }
+
+            CellStyle cellStyle1 = createCellStyle(wb);
+
+            for (int i = 0; i < lstProject.size(); i++) {
+                Row row = sheet.getRow(startRowIndex + i);
+
+                if (row != null) {
+                    for (int j = 0; j < row.getLastCellNum(); j++) {
+                        if (row.getCell(j) != null) {
+                            row.getCell(j).setCellStyle(cellStyle1);
+                        }
+                    }
+                }
+            }
+
+            //todo 将wb保存到oss
+            ByteArrayOutputStream output = new ByteArrayOutputStream();
+            wb.write(output);
+
+            byte[] buffer = output.toByteArray();
+            ByteArrayInputStream input = new ByteArrayInputStream(buffer);
+            String fileName = "学生健康信息台账.xlsx";
+
+            String downloadUrl = FileUtils.uploadFile(serverConfig, fileName, input, "/report");
+            //String[] ret = FileUtils.saveFile(serverConfig,input,"/project", req);
+            wb.close();
+            output.close();
+
+            msgResult.setData(downloadUrl);
+            msgResult.setResult(true);
+        } catch (Exception ex) {
+            msgResult.setResult(false);
+            msgResult.setMessage(ex.getMessage());
+            logger.error(ex.getMessage());
+        }
+
+        return msgResult;
+    }
+
+    private CellStyle createCellStyle(Workbook wb) {
+        CellStyle cellStyle = wb.createCellStyle();
+
+        cellStyle.setBorderTop(BorderStyle.THIN);
+        cellStyle.setBorderBottom(BorderStyle.THIN);
+        cellStyle.setBorderLeft(BorderStyle.THIN);
+        cellStyle.setBorderRight(BorderStyle.THIN);
+        cellStyle.setWrapText(true);
+        cellStyle.setVerticalAlignment(VerticalAlignment.CENTER);
+
+        return cellStyle;
+    }
+}

+ 447 - 0
src/main/java/com/jpsoft/ipcps/controller/ProjectFileController.java

@@ -0,0 +1,447 @@
+package com.jpsoft.ipcps.controller;
+
+import com.github.pagehelper.Page;
+import com.jpsoft.ipcps.common.PojoUtils;
+import com.jpsoft.ipcps.common.Sort;
+import com.jpsoft.ipcps.dto.MessageResult;
+import com.jpsoft.ipcps.entity.*;
+import com.jpsoft.ipcps.service.AdminRoleService;
+import com.jpsoft.ipcps.service.JpAdminService;
+import com.jpsoft.ipcps.service.ProjectErrorService;
+import com.jpsoft.ipcps.service.ProjectFileService;
+import com.jpsoft.ipcps.utils.FileUtils;
+import com.jpsoft.ipcps.utils.ServerConfig;
+import io.swagger.annotations.ApiImplicitParam;
+import io.swagger.annotations.ApiImplicitParams;
+import io.swagger.annotations.ApiOperation;
+import org.activiti.engine.repository.Deployment;
+import org.activiti.engine.repository.ProcessDefinition;
+import org.activiti.engine.repository.ProcessDefinitionQuery;
+import org.apache.commons.lang3.StringUtils;
+import org.apache.ibatis.mapping.ResultMap;
+import org.codehaus.jettison.json.JSONObject;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+import org.springframework.web.multipart.MultipartFile;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import java.io.File;
+import java.io.IOException;
+import java.text.SimpleDateFormat;
+import java.util.*;
+
+@RestController
+@RequestMapping("/projectFile")
+public class ProjectFileController {
+    private Logger logger = LoggerFactory.getLogger(getClass());
+
+    @Autowired
+    private ProjectFileService projectFileService;
+    @Autowired
+    private ServerConfig serverConfig;
+    @Autowired
+    private AdminRoleService adminRoleService;
+    @Autowired
+    private JpAdminService jpAdminService;
+
+    @ApiOperation(value="添加信息")
+    @PostMapping("add")
+    public MessageResult<ProjectFile> add(@ModelAttribute ProjectFile projectFile,@RequestParam(value = "uploadFile", required = false) MultipartFile[] uploadFile,@RequestAttribute String subject){
+        MessageResult<ProjectFile> msgResult = new MessageResult<>();
+
+        try {
+            projectFile.setFileId(UUID.randomUUID().toString());
+            projectFile.setCreateBy(subject);
+            projectFile.setCreateDate(new Date());
+            projectFile.setDelFlag(false);
+            int affectCount = projectFileService.insert(projectFile);
+
+            if (affectCount > 0) {
+                msgResult.setResult(true);
+                msgResult.setData(projectFile);
+            } else {
+                msgResult.setResult(false);
+                msgResult.setMessage("数据库添加失败");
+            }
+        }
+        catch(Exception ex){
+            logger.error(ex.getMessage(),ex);
+
+            msgResult.setResult(false);
+            msgResult.setMessage(ex.getMessage());
+        }
+
+        return msgResult;
+    }
+
+    @ApiOperation(value="获取信息")
+    @GetMapping("detail/{id}")
+    public MessageResult<ProjectFile> detail(@PathVariable("id") String id){
+        MessageResult<ProjectFile> msgResult = new MessageResult<>();
+
+        try {
+            ProjectFile projectFile = projectFileService.get(id);
+
+            if (projectFile != null) {
+                msgResult.setResult(true);
+                msgResult.setData(projectFile);
+            } else {
+                msgResult.setResult(false);
+                msgResult.setMessage("数据库不存在该记录!");
+            }
+        }
+        catch(Exception ex){
+            logger.error(ex.getMessage(),ex);
+
+            msgResult.setResult(false);
+            msgResult.setMessage(ex.getMessage());
+        }
+
+        return msgResult;
+    }
+
+    @ApiOperation(value="更新附件")
+    @PostMapping("update")
+    public MessageResult<ProjectFile> update(@ModelAttribute ProjectFile projectFile,@RequestAttribute String subject){
+        MessageResult<ProjectFile> msgResult = new MessageResult<>();
+
+        try {
+            projectFile.setUpdateBy(subject);
+            projectFile.setUpdateDate(new Date());
+            int affectCount = projectFileService.update(projectFile);
+
+            if (affectCount > 0) {
+                msgResult.setResult(true);
+                msgResult.setData(projectFile);
+            } else {
+                msgResult.setResult(false);
+                msgResult.setMessage("数据库更新失败");
+            }
+        }
+        catch(Exception ex){
+            logger.error(ex.getMessage(),ex);
+
+            msgResult.setResult(false);
+            msgResult.setMessage(ex.getMessage());
+        }
+
+        return msgResult;
+    }
+
+    @ApiOperation(value="删除附件-通用")
+    @PostMapping("delete/{id}")
+    public MessageResult<ProjectFile> delete(@PathVariable("id") String id){
+        MessageResult<ProjectFile> msgResult = new MessageResult<>();
+
+        try {
+            ProjectFile projectFile = projectFileService.get(id);
+            projectFile.setDelFlag(true);
+            int affectCount = projectFileService.update(projectFile);
+            //int affectCount = projectFileService.delete(id);
+
+            if (affectCount > 0) {
+                msgResult.setResult(true);
+            } else {
+                msgResult.setResult(false);
+                msgResult.setMessage("数据库删除失败");
+            }
+        }
+        catch(Exception ex){
+            logger.error(ex.getMessage(),ex);
+
+            msgResult.setResult(false);
+            msgResult.setMessage(ex.getMessage());
+        }
+
+        return msgResult;
+    }
+
+    @ApiOperation(value="删除附件并且返回剩余附件")
+    @PostMapping("deleteReturnFile/{id}")
+    public MessageResult<Map> deleteReturnFile(@PathVariable("id") String id){
+        MessageResult<Map> msgResult = new MessageResult<>();
+
+        try {
+            ProjectFile projectFile = projectFileService.get(id);
+            String projectId = projectFile.getProjectId();
+            projectFile.setDelFlag(true);
+            int affectCount = projectFileService.update(projectFile);
+
+            Map<String,Object> searchParms = new HashMap<>();
+            searchParms.put("projectId",projectId);
+            searchParms.put("fileSource","project");
+            searchParms.put("delFlag","0");
+            List<ProjectFile> lstFile = projectFileService.list(searchParms);
+            //int affectCount = projectFileService.delete(id);
+            Map<String,Object> map = new HashMap<>();
+            map.put("fileList",lstFile);
+            msgResult.setData(map);
+
+            if (affectCount > 0) {
+                msgResult.setResult(true);
+            } else {
+                msgResult.setResult(false);
+                msgResult.setMessage("数据库删除失败");
+            }
+        }
+        catch(Exception ex){
+            logger.error(ex.getMessage(),ex);
+
+            msgResult.setResult(false);
+            msgResult.setMessage(ex.getMessage());
+        }
+
+        return msgResult;
+    }
+
+
+    @ApiOperation(value="批量删除-通用")
+    @PostMapping("batchDelete")
+    public MessageResult<ProjectFile> batchDelete(@RequestParam(value = "ids", defaultValue = "") String ids){
+        MessageResult<ProjectFile> msgResult = new MessageResult<>();
+        try{
+            String[] arr = ids.split(",");
+            for(String id : arr){
+                ProjectFile projectFile = projectFileService.get(id);
+                projectFile.setDelFlag(true);
+                projectFileService.update(projectFile);
+            }
+            msgResult.setResult(true);
+        }catch (Exception ex) {
+            logger.error(ex.getMessage(), ex);
+            msgResult.setResult(false);
+            msgResult.setMessage(ex.getMessage());
+        }
+        return msgResult;
+    }
+
+    @ApiOperation(value="列表-通用")
+    @RequestMapping(value = "list",method = RequestMethod.POST)
+    @ApiImplicitParams({
+            @ApiImplicitParam(name="id",paramType="query",value="附件ID"),
+            @ApiImplicitParam(name="projectId",paramType="query",value="项目ID"),
+            @ApiImplicitParam(name="projectName",paramType="query",value="项目名称"),
+            @ApiImplicitParam(name="fileSource",paramType="query",value="来源"),
+            @ApiImplicitParam(name = "roleId", paramType = "query", value = "角色ID")
+    })
+    public MessageResult<Map> list(
+            @RequestParam(value="id",defaultValue="") String id,
+            @RequestParam(value="projectId",defaultValue="") String projectId,
+            @RequestParam(value="projectName",defaultValue="") String projectName,
+            @RequestParam(value="fileSource",defaultValue="") String fileSource,
+            @RequestParam(value = "roleId", defaultValue = "") String roleId,
+            @RequestParam(value="start",defaultValue="1") int start,
+            @RequestParam(value="length",defaultValue="20") int length,
+            @RequestAttribute String subject,
+            HttpServletRequest request){
+        MessageResult<Map> msgResult = new MessageResult<>();
+        try {
+            //当前用户ID
+            System.out.println(subject);
+            Map<String,Object> searchParms = new HashMap<>();
+
+            List<Sort> sortList = new ArrayList<>();
+            sortList.add(new Sort("create_date_","desc"));
+
+            if (StringUtils.isNotEmpty(id)) {
+                searchParms.put("id",id);
+            }
+            if (StringUtils.isNotEmpty(projectId)) {
+                searchParms.put("projectId",projectId);
+            }
+            if (StringUtils.isNotEmpty(projectName)) {
+                searchParms.put("projectName","%" + projectName + "%");
+            }
+
+            if (StringUtils.isNotEmpty(fileSource)) {
+                searchParms.put("fileSource",fileSource);
+            }
+
+            if(StringUtils.isEmpty(roleId)){
+                //用户IDZLD
+                JpAdmin queryUser = jpAdminService.get(subject);
+
+                //List<AdminRole> roleList = queryUser.getAdminRoleList();
+                List<AdminRole> roleList = adminRoleService.listByAdminId(subject);
+
+                if(roleList!=null && roleList.size()>0){
+                    roleId = roleList.get(0).getRoleId();
+                }
+                else if(StringUtils.isNotEmpty(queryUser.getRoleId())){
+                    roleId = queryUser.getRoleId();
+                }
+            }
+
+            int count1 = adminRoleService.findCountByAIdAndRName(subject,"SYSADMIN");
+            int count2 = adminRoleService.findCountByAIdAndRName(subject,"ZLD");
+            int count3 = adminRoleService.findCountByAIdAndRName(subject,"TZCJZX");
+            if(count1 > 0){
+                //查全部
+            }else if(count2 > 0){
+                //查全部
+            }else if(count3 > 0){
+                //查全部
+            }else {
+                //用户ID
+                //JpAdmin queryUser = jpAdminService.get(subject);
+                AdminRole adminRole = adminRoleService.findByAIdAndRId(subject,roleId);
+                if (adminRole != null) {
+                    if ("XMF".equals(adminRole.getRoleName())) {
+                        searchParms.put("XMF", subject);
+                    } else if ("QYMS".equals(adminRole.getRoleName())) {
+                        searchParms.put("QYMS", subject);
+                    } else if ("BLLD".equals(adminRole.getRoleName())) {
+                        searchParms.put("BLLD", subject);
+                    } else if ("TZCJZX".equals(adminRole.getRoleName())) {
+                        //CXQBXM查全部
+                    } else if ("SYSADMIN".equals(adminRole.getRoleName())) {
+                        //项目管理员查全部
+                    } else {
+                        //否则都不能看到
+                        searchParms.put("XMF", "NO");
+                    }
+                } else {
+                    //否则都不能看到
+                    searchParms.put("XMF", "NO");
+                }
+            }
+
+
+            //未删除条件
+            searchParms.put("delFlag","0");
+            int pageNum = start / length;
+            pageNum++;
+            int pageSize = length;
+
+            Page<ProjectFile> page = projectFileService.pageSearch(searchParms,pageNum,pageSize,sortList);
+
+            msgResult.setResult(true);
+            msgResult.setData(PojoUtils.pageWrapper(page));
+        }catch (Exception ex){
+            logger.error(ex.getMessage(),ex);
+            msgResult.setResult(false);
+        }
+        return msgResult;
+    }
+
+
+    @ApiOperation(value="添加信息-手机页面")
+    @PostMapping("addMethod")
+    public MessageResult<ProjectFile> addMethod(@ModelAttribute ProjectFile projectFile,
+                                                @RequestParam(value = "uploadFile", required = false) MultipartFile[] uploadFile,
+                                                @RequestAttribute String subject,
+                                                HttpServletRequest req){
+        MessageResult<ProjectFile> msgResult = new MessageResult<>();
+
+        try {
+            projectFile.setFileId(UUID.randomUUID().toString());
+            projectFile.setCreateBy(subject);
+            projectFile.setCreateDate(new Date());
+            projectFile.setDelFlag(false);
+            int affectCount = projectFileService.insert(projectFile);
+
+            if (affectCount > 0) {
+                msgResult.setResult(true);
+                msgResult.setData(projectFile);
+            } else {
+                msgResult.setResult(false);
+                msgResult.setMessage("数据库添加失败");
+            }
+        }
+        catch(Exception ex){
+            logger.error(ex.getMessage(),ex);
+
+            msgResult.setResult(false);
+            msgResult.setMessage(ex.getMessage());
+        }
+
+        return msgResult;
+    }
+
+    @ApiOperation(value="上传附件返回地址")
+    @PostMapping("fileUpload")
+    @ApiImplicitParams({
+            @ApiImplicitParam(name="fileSource",paramType="query",value="来源"),
+            @ApiImplicitParam(name="file",paramType="query",value="上传附件"),
+    })
+    public MessageResult<Map> fileUpload(
+            @RequestParam(value="fileSource",defaultValue="picture") String fileSource,
+            @RequestParam(value = "file", required = false) MultipartFile file,
+            @RequestAttribute String subject,HttpServletRequest req){
+        MessageResult<Map> msgResult = new MessageResult<>();
+        try {
+            if(file != null) {
+                String[] ret = FileUtils.saveFile(serverConfig, file, fileSource, req);
+                if (StringUtils.isNotBlank(ret[1])) {
+                    Map<String, Object> rMap = new HashMap<String,Object>();
+                    rMap.put("url",ret[1]);
+                    rMap.put("realUrl",serverConfig.getOosUrl()+"/");//返回真实路径
+
+                    String fileUrls = ret[0] + "?" + ret[1];//后台附件上传使用的返回参数
+                    rMap.put("fileUrls",fileUrls);//后台附件上传使用的返回参数
+
+                    msgResult.setResult(true);
+                    msgResult.setData(rMap);
+                }else{
+                    msgResult.setResult(false);
+                    msgResult.setMessage("上传失败");
+                }
+            }else{
+                msgResult.setResult(false);
+                msgResult.setMessage("请选择图片");
+            }
+        }
+        catch(Exception ex){
+            logger.error(ex.getMessage(),ex);
+
+            msgResult.setResult(false);
+            msgResult.setMessage(ex.getMessage());
+        }
+
+        return msgResult;
+    }
+
+    @ApiOperation(value="上传多附件返回地址")
+    @PostMapping("fileUploads")
+    @ApiImplicitParams({
+            @ApiImplicitParam(name="fileSource",paramType="query",value="来源"),
+            @ApiImplicitParam(name="file",paramType="query",value="上传附件"),
+    })
+    public MessageResult<Map> fileUploads(
+            @RequestParam(value="fileSource",defaultValue="picture") String fileSource,
+            @RequestParam(value = "file", required = false) MultipartFile[] file,
+            @RequestAttribute String subject,HttpServletRequest req){
+        MessageResult<Map> msgResult = new MessageResult<>();
+        try {
+            if(file != null) {
+                String urls = "";
+                Map<String, Object> rMap = new HashMap<String,Object>();
+                for(MultipartFile mfile : file){
+                    String[] ret = FileUtils.saveFile(serverConfig, mfile, fileSource, req);
+                    if (StringUtils.isNotBlank(ret[1])) {
+                        urls += ret[0] + "?" + ret[1] + "*";
+                    }else{
+                        continue;
+                    }
+                }
+
+                rMap.put("urls",urls);
+                msgResult.setResult(true);
+                msgResult.setData(rMap);
+            }else{
+                msgResult.setResult(false);
+                msgResult.setMessage("请选择图片");
+            }
+        }
+        catch(Exception ex){
+            logger.error(ex.getMessage(),ex);
+            msgResult.setResult(false);
+            msgResult.setMessage("上传失败");
+        }
+
+        return msgResult;
+    }
+}

+ 87 - 0
src/main/java/com/jpsoft/ipcps/controller/ProjectImagesController.java

@@ -0,0 +1,87 @@
+package com.jpsoft.ipcps.controller;
+
+import com.github.pagehelper.Page;
+import com.jpsoft.ipcps.common.Sort;
+import com.jpsoft.ipcps.dto.MessageResult;
+import com.jpsoft.ipcps.entity.ProjectImages;
+import com.jpsoft.ipcps.service.ProjectImagesService;
+import io.swagger.annotations.ApiOperation;
+import org.activiti.engine.repository.Deployment;
+import org.activiti.engine.repository.ProcessDefinition;
+import org.activiti.engine.repository.ProcessDefinitionQuery;
+import org.apache.commons.lang3.StringUtils;
+import org.apache.ibatis.mapping.ResultMap;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+
+import javax.servlet.http.HttpServletRequest;
+import java.text.SimpleDateFormat;
+import java.util.*;
+
+@RestController
+@RequestMapping("/projectImages")
+public class ProjectImagesController {
+    private Logger logger = LoggerFactory.getLogger(getClass());
+
+    @Autowired
+    private ProjectImagesService projectImagesService;
+
+    @ApiOperation(value="添加信息")
+    @PostMapping("add")
+    public MessageResult<ProjectImages> add(@ModelAttribute ProjectImages projectImages,@RequestAttribute String subject){
+        MessageResult<ProjectImages> msgResult = new MessageResult<>();
+
+        try {
+            String[] url = projectImages.getImageUrl().split(",");
+            for(String str : url) {
+                projectImages.setId(UUID.randomUUID().toString());
+                projectImages.setImageUrl(str);
+                projectImages.setDelFlag(false);
+                projectImages.setCreateBy(subject);
+                projectImages.setCreateDate(new Date());
+
+                projectImagesService.insert(projectImages);
+            }
+            msgResult.setResult(true);
+        }
+        catch(Exception ex){
+            logger.error(ex.getMessage(),ex);
+
+            msgResult.setResult(false);
+            msgResult.setMessage(ex.getMessage());
+        }
+
+        return msgResult;
+    }
+
+    @ApiOperation(value="删除用户")
+    @PostMapping("delete/{id}")
+    public MessageResult<ProjectImages> delete(@PathVariable("id") String id){
+        MessageResult<ProjectImages> msgResult = new MessageResult<>();
+
+        try {
+            ProjectImages projectImages = projectImagesService.get(id);
+
+            if (projectImages != null) {
+                projectImages.setDelFlag(true);
+                projectImagesService.update(projectImages);
+
+                msgResult.setResult(true);
+                msgResult.setData(projectImages);
+            } else {
+                msgResult.setResult(false);
+                msgResult.setMessage("数据库删除失败");
+            }
+        }
+        catch(Exception ex){
+            logger.error(ex.getMessage(),ex);
+
+            msgResult.setResult(false);
+            msgResult.setMessage(ex.getMessage());
+        }
+
+        return msgResult;
+    }
+}

+ 500 - 0
src/main/java/com/jpsoft/ipcps/controller/ProjectPictureController.java

@@ -0,0 +1,500 @@
+package com.jpsoft.ipcps.controller;
+
+import com.github.pagehelper.Page;
+import com.jpsoft.ipcps.common.PojoUtils;
+import com.jpsoft.ipcps.common.Sort;
+import com.jpsoft.ipcps.dto.MessageResult;
+import com.jpsoft.ipcps.entity.AdminRole;
+import com.jpsoft.ipcps.entity.JpAdmin;
+import com.jpsoft.ipcps.entity.ProjectFile;
+import com.jpsoft.ipcps.entity.ProjectPicture;
+import com.jpsoft.ipcps.service.*;
+import com.jpsoft.ipcps.utils.FileUtils;
+import com.jpsoft.ipcps.utils.ServerConfig;
+import io.swagger.annotations.ApiImplicitParam;
+import io.swagger.annotations.ApiImplicitParams;
+import io.swagger.annotations.ApiOperation;
+import org.activiti.engine.repository.Deployment;
+import org.activiti.engine.repository.ProcessDefinition;
+import org.activiti.engine.repository.ProcessDefinitionQuery;
+import org.apache.commons.lang3.StringUtils;
+import org.apache.ibatis.mapping.ResultMap;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+import org.springframework.web.multipart.MultipartFile;
+
+import javax.servlet.http.HttpServletRequest;
+import java.text.SimpleDateFormat;
+import java.util.*;
+
+@RestController
+@RequestMapping("/projectPicture")
+public class ProjectPictureController {
+    private Logger logger = LoggerFactory.getLogger(getClass());
+
+    @Autowired
+    private ProjectPictureService projectPictureService;
+    @Autowired
+    private ProjectFileService projectFileService;
+    @Autowired
+    private ProjectTaskService projectTaskService;
+    @Autowired
+    private JpAdminService jpAdminService;
+    @Autowired
+    private AdminRoleService adminRoleService;
+    @Autowired
+    private ServerConfig serverConfig;
+
+    @ApiOperation(value="添加信息")
+    @PostMapping("add")
+    @ApiImplicitParams({
+            @ApiImplicitParam(name = "projectPicture", paramType ="query", value = "图片信息"),
+            @ApiImplicitParam(name = "uploadFile", paramType = "query", value = "上传附件集合"),
+    })
+    public MessageResult<ProjectPicture> add(@ModelAttribute ProjectPicture projectPicture, @RequestParam(value = "uploadFile", required = false) MultipartFile[] uploadFile,HttpServletRequest req,@RequestAttribute String subject) {
+        MessageResult<ProjectPicture> msgResult = new MessageResult<>();
+
+        try {
+            projectPicture.setId(UUID.randomUUID().toString());
+            projectPicture.setCreateDate(new Date());
+            projectPicture.setCreateBy(subject);
+            projectPicture.setTaskName("");
+            int affectCount = projectPictureService.insert(projectPicture);
+
+
+
+            if (uploadFile != null && uploadFile.length > 0) {
+                for (int i = 0; i < uploadFile.length; i++) {
+                    MultipartFile file = uploadFile[i];
+                    String[] ret = FileUtils.saveFile(serverConfig,file,"/picture", req);
+                    if (StringUtils.isBlank(ret[1])) {
+                        continue;
+                    }
+                    ProjectFile projectFile = new ProjectFile();
+                    projectFile.setFileId(UUID.randomUUID().toString());
+                    projectFile.setProjectId(projectPicture.getProjectId());
+                    projectFile.setFileName(ret[0]);
+                    projectFile.setFileAddress(ret[1]);
+                    projectFile.setDelFlag(false);
+                    projectFile.setPictureId(projectPicture.getId());
+                    projectFile.setCreateBy(projectPicture.getCreateBy());
+                    projectFile.setCreateDate(new Date());
+                    projectFile.setFileSource("picture");//文件来源
+                    projectFileService.insert(projectFile);
+                }
+            }
+
+            if (affectCount > 0) {
+                msgResult.setResult(true);
+                msgResult.setData(projectPicture);
+            } else {
+                msgResult.setResult(false);
+                msgResult.setMessage("数据库添加失败");
+            }
+        }
+        catch(Exception ex){
+            logger.error(ex.getMessage(),ex);
+
+            msgResult.setResult(false);
+            msgResult.setMessage(ex.getMessage());
+        }
+
+        return msgResult;
+    }
+
+    @ApiOperation(value="获取信息")
+    @GetMapping("detail/{id}")
+    public MessageResult<ProjectPicture> detail(@PathVariable("id") String id){
+        MessageResult<ProjectPicture> msgResult = new MessageResult<>();
+
+        try {
+            ProjectPicture projectPicture = projectPictureService.get(id);
+
+            if (projectPicture != null) {
+                msgResult.setResult(true);
+                msgResult.setData(projectPicture);
+            } else {
+                msgResult.setResult(false);
+                msgResult.setMessage("数据库不存在该记录!");
+            }
+        }
+        catch(Exception ex){
+            logger.error(ex.getMessage(),ex);
+
+            msgResult.setResult(false);
+            msgResult.setMessage(ex.getMessage());
+        }
+
+        return msgResult;
+    }
+
+    @ApiOperation(value="更新用户")
+    @PostMapping("update")
+    public MessageResult<ProjectPicture> update(@ModelAttribute ProjectPicture projectPicture,@RequestParam(value = "uploadFile", required = false) MultipartFile[] uploadFile,HttpServletRequest req,@RequestAttribute String subject) {
+        MessageResult<ProjectPicture> msgResult = new MessageResult<>();
+        try {
+            projectPicture.setUpdateDate(new Date());
+            projectPicture.setUpdateBy(subject);
+            int affectCount = projectPictureService.update(projectPicture);
+
+            if (uploadFile != null && uploadFile.length > 0) {
+                //先删除
+                Map<String,Object> searchParms = new HashMap<>();
+                if (StringUtils.isNotEmpty(projectPicture.getProjectId())) {
+                    searchParms.put("projectId",projectPicture.getProjectId());
+                }
+                searchParms.put("fileSource","picture");
+                searchParms.put("delFlag","0");
+                List<ProjectFile> pfList = projectFileService.list(searchParms);
+                for(ProjectFile pf : pfList){
+                    pf.setDelFlag(true);
+                    projectFileService.update(pf);
+                }
+                for (int i = 0; i < uploadFile.length; i++) {
+                    MultipartFile file = uploadFile[i];
+                    String[] ret = FileUtils.saveFile(serverConfig,file,"/picture", req);
+                    if (StringUtils.isBlank(ret[1])) {
+                        continue;
+                    }
+                    ProjectFile projectFile = new ProjectFile();
+                    projectFile.setFileId(UUID.randomUUID().toString());
+                    projectFile.setProjectId(projectPicture.getProjectId());
+                    projectFile.setFileName(ret[0]);
+                    projectFile.setFileAddress(ret[1]);
+                    projectFile.setDelFlag(false);
+                    projectFile.setPictureId(projectPicture.getId());
+                    projectFile.setCreateBy(projectPicture.getCreateBy());
+                    projectFile.setCreateDate(new Date());
+                    projectFile.setFileSource("picture");//文件来源
+                    projectFileService.insert(projectFile);
+                }
+            }
+
+            if (affectCount > 0) {
+                msgResult.setResult(true);
+                msgResult.setData(projectPicture);
+            } else {
+                msgResult.setResult(false);
+                msgResult.setMessage("数据库更新失败");
+            }
+        }
+        catch(Exception ex){
+            logger.error(ex.getMessage(),ex);
+
+            msgResult.setResult(false);
+            msgResult.setMessage(ex.getMessage());
+        }
+
+        return msgResult;
+    }
+
+    @ApiOperation(value="删除用户-通用")
+    @PostMapping("delete/{id}")
+    public MessageResult<ProjectPicture> delete(@PathVariable("id") String id){
+        MessageResult<ProjectPicture> msgResult = new MessageResult<>();
+
+        try {
+            ProjectPicture projectPicture = projectPictureService.get(id);
+            projectPicture.setDelFlag(true);
+            int affectCount = projectPictureService.update(projectPicture);
+            //int affectCount = projectPictureService.delete(id);
+
+            if (affectCount > 0) {
+                msgResult.setResult(true);
+            } else {
+                msgResult.setResult(false);
+                msgResult.setMessage("数据库删除失败");
+            }
+        }
+        catch(Exception ex){
+            logger.error(ex.getMessage(),ex);
+
+            msgResult.setResult(false);
+            msgResult.setMessage(ex.getMessage());
+        }
+
+        return msgResult;
+    }
+
+
+    @ApiOperation(value="批量删除-通用")
+    @PostMapping("batchDelete/{id}")
+    public MessageResult<ProjectPicture> batchDelete(@RequestParam(value = "ids", defaultValue = "") String ids){
+        MessageResult<ProjectPicture> msgResult = new MessageResult<>();
+        try{
+            String[] arr = ids.split(",");
+            for(String id : arr){
+                ProjectPicture projectPicture = projectPictureService.get(id);
+                projectPicture.setDelFlag(true);
+                projectPictureService.update(projectPicture);
+            }
+            msgResult.setResult(true);
+        }catch (Exception ex) {
+            logger.error(ex.getMessage(), ex);
+            msgResult.setResult(false);
+            msgResult.setMessage(ex.getMessage());
+        }
+        return msgResult;
+    }
+
+
+    @ApiOperation(value="移动端用列表接口")
+    @RequestMapping(value = "thumbList",method = RequestMethod.POST)
+    @ApiImplicitParams({
+            @ApiImplicitParam(name = "projectId", paramType = "query", value = "项目ID"),
+            @ApiImplicitParam(name = "roleId", paramType = "query", value = "角色ID")
+    })
+    public MessageResult<Map> thumbList(
+            @RequestParam(value = "projectId", defaultValue = "")String projectId,
+            @RequestParam(value = "roleId", defaultValue = "") String roleId,
+            @RequestParam(value = "start", defaultValue = "1") int start,
+            @RequestParam(value = "length", defaultValue = "20") int length,
+            @RequestAttribute String subject){
+        MessageResult<Map> msgResult = new MessageResult<>();
+        try {
+            Map<String, Object> searchParms = new HashMap<>();
+
+            List<Sort> sortList = new ArrayList<>();
+            sortList.add(new Sort("create_date_", "desc"));
+
+            if (StringUtils.isNotEmpty(projectId)) {
+                searchParms.put("projectId", projectId);
+            }
+
+            //未删除条件
+            searchParms.put("delFlag", "0");
+
+            int pageNum = start / length;
+            pageNum++;
+            int pageSize = length;
+
+            Page<ProjectPicture> page = projectPictureService.pageSearch(searchParms, pageNum, pageSize, sortList);
+
+            List<ProjectPicture> ppList = new ArrayList<ProjectPicture>();
+            
+            for (ProjectPicture pp : page.getResult()) {
+                List<ProjectFile> lstFile = projectFileService.findByPictureId(pp.getId());
+                pp.setPfList(lstFile);
+                JpAdmin jpAdmin = jpAdminService.get(pp.getCreateBy());
+                if(jpAdmin != null){
+                    pp.setCreateByN(jpAdmin.getRealName());
+                }
+                ppList.add(pp);
+            }
+
+            Map<String, Object> pageMap = new HashMap<>();
+            pageMap.put("recordsTotal", page.getTotal());
+            pageMap.put("recordsFiltered", page.getTotal());
+            pageMap.put("totalPage", page.getPages());
+            pageMap.put("pageNumber", page.getPageNum());
+            pageMap.put("pageSize", page.getPageSize());
+            pageMap.put("data", page);
+
+            msgResult.setResult(true);
+            msgResult.setData(pageMap);
+        }catch (Exception e){
+            msgResult.setResult(false);
+            msgResult.setMessage(e.getMessage());
+        }
+
+        return msgResult;
+    }
+
+    @ApiOperation(value="列表-通用")
+    @RequestMapping(value = "list",method = RequestMethod.POST)
+    @ApiImplicitParams({
+            @ApiImplicitParam(name = "id", paramType = "query", value = "图片信息ID"),
+            @ApiImplicitParam(name = "projectId", paramType = "query", value = "项目ID"),
+            @ApiImplicitParam(name = "projectName", paramType = "query", value = "项目名称"),
+            @ApiImplicitParam(name = "roleId", paramType = "query", value = "角色ID")
+    })
+    public MessageResult<Map> list(
+            @RequestParam(value = "id", defaultValue = "")String id,
+            @RequestParam(value = "projectId", defaultValue = "")String projectId,
+            @RequestParam(value = "projectName", defaultValue = "")String projectName,
+            @RequestParam(value = "roleId", defaultValue = "") String roleId,
+            @RequestParam(value = "start", defaultValue = "1") int start,
+            @RequestParam(value = "length", defaultValue = "20") int length,
+            @RequestAttribute String subject,
+            HttpServletRequest request){
+
+        MessageResult<Map> msgResult = new MessageResult<>();
+        try {
+            Map<String, Object> searchParms = new HashMap<>();
+
+            List<Sort> sortList = new ArrayList<>();
+            sortList.add(new Sort("create_date_", "desc"));
+
+            if (StringUtils.isNotEmpty(id)) {
+                searchParms.put("id", "%" + id + "%");
+            }
+            if (StringUtils.isNotEmpty(projectId)) {
+                searchParms.put("projectId", projectId);
+            }
+            if (StringUtils.isNotEmpty(projectName)) {
+                searchParms.put("projectName", "%" + projectName + "%");
+            }
+
+            if(StringUtils.isEmpty(roleId)){
+                //用户IDZLD
+                JpAdmin queryUser = jpAdminService.get(subject);
+
+                //List<AdminRole> roleList = queryUser.getAdminRoleList();
+                List<AdminRole> roleList = adminRoleService.listByAdminId(subject);
+
+                if(roleList!=null && roleList.size()>0){
+                    roleId = roleList.get(0).getRoleId();
+                }
+                else if(StringUtils.isNotEmpty(queryUser.getRoleId())){
+                    roleId = queryUser.getRoleId();
+                }
+            }
+            int count1 = adminRoleService.findCountByAIdAndRName(subject,"SYSADMIN");
+            int count2 = adminRoleService.findCountByAIdAndRName(subject,"ZLD");
+            int count3 = adminRoleService.findCountByAIdAndRName(subject,"TZCJZX");
+            if(count1 > 0){
+                //查全部
+            }else if(count2 > 0){
+                //查全部
+            }else if(count3 > 0){
+                //查全部
+            }else {
+                //用户ID
+                AdminRole adminRole = adminRoleService.findByAIdAndRId(subject, roleId);
+                if (adminRole != null) {
+                    if ("XMF".equals(adminRole.getRoleName())) {
+                        searchParms.put("XMF", subject);
+                    } else if ("QYMS".equals(adminRole.getRoleName())) {
+                        searchParms.put("QYMS", subject);
+                    } else if ("BLLD".equals(adminRole.getRoleName())) {
+                        searchParms.put("BLLD", subject);
+                    } else if ("SYSADMIN".equals(adminRole.getRoleName())) {
+                        //项目管理员查全部
+                    } else if ("TZCJZX".equals(adminRole.getRoleName())) {
+                        //CXQBXM查全部
+                    } else {
+                        //否则都不能看到
+                        searchParms.put("XMF", "NO");
+                    }
+                } else {
+                    //否则都不能看到
+                    searchParms.put("XMF", "NO");
+                }
+            }
+
+            //未删除条件
+            searchParms.put("delFlag", "0");
+            int pageNum = start / length;
+            pageNum++;
+            int pageSize = length;
+
+            Page<ProjectPicture> page = projectPictureService.pageSearch(searchParms, pageNum, pageSize, sortList);
+            List<ProjectPicture> ppList = new ArrayList<ProjectPicture>();
+            for (ProjectPicture pp : page.getResult()) {
+                List<ProjectFile> lstFile = projectFileService.findByPictureId(pp.getId());
+                pp.setPfList(lstFile);
+                JpAdmin jpAdmin = jpAdminService.get(pp.getCreateBy());
+                if(jpAdmin != null){
+                    pp.setCreateByN(jpAdmin.getRealName());
+                }
+                ppList.add(pp);
+            }
+
+            Map<String, Object> pageMap = new HashMap<>();
+            pageMap.put("recordsTotal", page.getTotal());
+            pageMap.put("recordsFiltered", page.getTotal());
+            pageMap.put("totalPage", page.getPages());
+            pageMap.put("pageNumber", page.getPageNum());
+            pageMap.put("pageSize", page.getPageSize());
+            pageMap.put("data", ppList);
+
+            msgResult.setResult(true);
+            msgResult.setData(pageMap);
+        }catch (Exception e){
+            msgResult.setResult(false);
+            msgResult.setMessage(e.getMessage());
+        }
+
+        return msgResult;
+    }
+
+    @ApiOperation(value="添加信息-手机页面")
+    @PostMapping("addMethod")
+    @ApiImplicitParams({
+            @ApiImplicitParam(name = "projectId", paramType ="query", value = "项目编号"),
+            @ApiImplicitParam(name = "detail", paramType ="query", value = "图片文字"),
+            @ApiImplicitParam(name = "fileUrls", paramType = "query", value = "上传附件路径"),
+    })
+    public MessageResult<ProjectPicture> addMethod(
+            @RequestParam(value = "projectId", required = false) String projectId,
+            @RequestParam(value = "detail", required = false) String detail,
+            @RequestParam(value = "fileUrls", required = false) String fileUrls,
+            @RequestAttribute String subject) {
+        MessageResult<ProjectPicture> msgResult = new MessageResult<>();
+
+        try {
+            if(!StringUtils.isNotBlank(projectId)){
+                msgResult.setResult(false);
+                msgResult.setMessage("项目编号不能为空");
+                return msgResult;
+            }
+            //存一下上传步骤
+            String taskName = "";
+            List<Map> taskList = projectTaskService.findByProjectId(projectId);
+            for(int i = 0;i< taskList.size(); i ++){
+                Map map = taskList.get(i);
+                taskName += map.get("taskName");
+                if(i > 0 && i != taskList.size()){
+                    taskName += ",";
+                }
+            }
+            ProjectPicture projectPicture = new ProjectPicture();
+            projectPicture.setId(UUID.randomUUID().toString());
+            projectPicture.setProjectId(projectId);
+            projectPicture.setDetail(detail);
+            projectPicture.setCreateDate(new Date());
+            projectPicture.setCreateBy(subject);
+            projectPicture.setDelFlag(false);
+            projectPicture.setTaskName(taskName);
+            int affectCount = projectPictureService.insert(projectPicture);
+
+            String[] urls = fileUrls.split(",");
+            for(String url : urls){
+                if (StringUtils.isBlank(url)) {
+                    continue;
+                }
+                String ext = url.substring(url.lastIndexOf(".")+1);
+                ProjectFile projectFile = new ProjectFile();
+                projectFile.setFileId(UUID.randomUUID().toString());
+                projectFile.setProjectId(projectPicture.getProjectId());
+                projectFile.setFileName("");
+                projectFile.setFileAddress(url);
+                projectFile.setFileType(ext.toUpperCase());//文件后缀 转大写
+                projectFile.setDelFlag(false);
+                projectFile.setPictureId(projectPicture.getId());
+                projectFile.setCreateBy(subject);
+                projectFile.setCreateDate(new Date());
+                projectFile.setFileSource("picture");//文件来源
+                projectFileService.insert(projectFile);
+            }
+
+            if (affectCount > 0) {
+                msgResult.setResult(true);
+                msgResult.setData(projectPicture);
+            } else {
+                msgResult.setResult(false);
+                msgResult.setMessage("数据库添加失败");
+            }
+        }
+        catch(Exception ex){
+            logger.error(ex.getMessage(),ex);
+
+            msgResult.setResult(false);
+            msgResult.setMessage(ex.getMessage());
+        }
+
+        return msgResult;
+    }
+}

+ 398 - 0
src/main/java/com/jpsoft/ipcps/controller/ProjectQuestionController.java

@@ -0,0 +1,398 @@
+package com.jpsoft.ipcps.controller;
+
+import com.github.pagehelper.Page;
+import com.jpsoft.ipcps.common.PojoUtils;
+import com.jpsoft.ipcps.common.Sort;
+import com.jpsoft.ipcps.dto.MessageResult;
+import com.jpsoft.ipcps.entity.*;
+import com.jpsoft.ipcps.service.*;
+import io.swagger.annotations.ApiImplicitParam;
+import io.swagger.annotations.ApiImplicitParams;
+import io.swagger.annotations.ApiOperation;
+import org.activiti.engine.repository.Deployment;
+import org.activiti.engine.repository.ProcessDefinition;
+import org.activiti.engine.repository.ProcessDefinitionQuery;
+import org.apache.commons.lang3.StringUtils;
+import org.apache.ibatis.mapping.ResultMap;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+
+import javax.servlet.http.HttpServletRequest;
+import java.text.SimpleDateFormat;
+import java.util.*;
+
+@RestController
+@RequestMapping("/projectQuestion")
+public class ProjectQuestionController {
+    private Logger logger = LoggerFactory.getLogger(getClass());
+
+    @Autowired
+    private ProjectQuestionService projectQuestionService;
+    @Autowired
+    private ProjectReplyService projectReplyService;
+    @Autowired
+    private ProjectService projectService;
+    @Autowired
+    private ProjectImagesService projectImagesService;
+    @Autowired
+    private ParkService parkService;
+    @Autowired
+    private ParkAdminService parkAdminService;
+    @Autowired
+    private MessagesService messagesService;
+
+    @ApiOperation(value="添加信息")
+    @PostMapping("add")
+    @ApiImplicitParams({
+            @ApiImplicitParam(name = "projectId", paramType ="query", value = "项目编号"),
+            @ApiImplicitParam(name = "detail", paramType ="query", value = "问题"),
+            @ApiImplicitParam(name = "fileUrls", paramType = "query", value = "上传附件路径(用“,”分隔)"),
+    })
+    public MessageResult<Map> add(
+            @RequestParam(value = "projectId", required = false) String projectId,
+            @RequestParam(value = "detail", required = false) String detail,
+            @RequestParam(value = "fileUrls", required = false) String fileUrls,
+            @RequestAttribute String subject){
+        MessageResult<Map> msgResult = new MessageResult<>();
+        Map<String,Object> map = new HashMap<>();
+
+        try {
+            //保存问题
+            ProjectQuestion projectQuestion = new ProjectQuestion();
+            projectQuestion.setId(UUID.randomUUID().toString());
+            projectQuestion.setProjectId(projectId);
+            projectQuestion.setDetail(detail);
+            projectQuestion.setStopReply(false);
+            projectQuestion.setDelFlag(false);
+            projectQuestion.setCreateBy(subject);
+            projectQuestion.setCreateDate(new Date());
+            int affectCount = projectQuestionService.insert(projectQuestion);
+
+            //保存图片
+            List<ProjectImages> projectImagesList = new ArrayList<>();
+            if(StringUtils.isNotEmpty(fileUrls)) {
+                String[] url = fileUrls.split(",");
+                for (String str : url) {
+                    ProjectImages projectImages = new ProjectImages();
+                    projectImages.setId(UUID.randomUUID().toString());
+                    projectImages.setFId(projectQuestion.getId());
+                    projectImages.setImageUrl(str);
+                    projectImages.setDelFlag(false);
+                    projectImages.setCreateBy(subject);
+                    projectImages.setCreateDate(new Date());
+                    projectImagesService.insert(projectImages);
+
+                    projectImagesList.add(projectImages);
+                }
+            }
+
+            //发送站内消息
+            Project project = projectService.get(projectId);
+            List<String> ids = new ArrayList<>();
+            ids.add(project.getSecretaryAdminId());
+            ids.add(project.getLeaderAdminId());
+            List<ParkAdmin> parkAdminList = parkAdminService.findParkAdminByParkId(project.getPark().getParkId());
+            for(ParkAdmin parkAdmin : parkAdminList){
+                ids.add(parkAdmin.getAdminId());
+            }
+            MessagesController mc = new MessagesController();
+            MessageResult<List<Messages>> listMessages = multiAdd(ids,"关于“"+project.getTitle()+"”的问题", detail, subject);
+
+            map.put("projectQuestion",projectQuestion);
+            map.put("projectImagesList",projectImagesList);
+            map.put("messageList",listMessages);
+
+            if (affectCount > 0) {
+                msgResult.setResult(true);
+                msgResult.setData(map);
+            } else {
+                msgResult.setResult(false);
+                msgResult.setMessage("数据库添加失败");
+            }
+        }
+        catch(Exception ex){
+            logger.error(ex.getMessage(),ex);
+
+            msgResult.setResult(false);
+            msgResult.setMessage(ex.getMessage());
+        }
+
+        return msgResult;
+    }
+
+    @ApiOperation(value="获取信息")
+    @GetMapping("detail/{id}")
+    public MessageResult<ProjectQuestion> detail(@PathVariable("id") String id){
+        MessageResult<ProjectQuestion> msgResult = new MessageResult<>();
+
+        List<Sort> sortList = new ArrayList<>();
+        sortList.add(new Sort("create_date_","asc"));
+
+        try {
+            ProjectQuestion projectQuestion = projectQuestionService.get(id);
+
+            if (projectQuestion != null) {
+                Map<String,Object> searchParmsReply = new HashMap<>();
+                searchParmsReply.put("QuestionId",id);
+
+                Page<ProjectReply> page = projectReplyService.pageSearch(searchParmsReply,1,100,sortList);
+                projectQuestion.setProjectReplyList(page.getResult());
+
+                msgResult.setResult(true);
+                msgResult.setData(projectQuestion);
+            } else {
+                msgResult.setResult(false);
+                msgResult.setMessage("数据库不存在该记录!");
+            }
+        }
+        catch(Exception ex){
+            logger.error(ex.getMessage(),ex);
+
+            msgResult.setResult(false);
+            msgResult.setMessage(ex.getMessage());
+        }
+
+        return msgResult;
+    }
+
+    @ApiOperation(value="删除用户")
+    @PostMapping("delete/{id}")
+    public MessageResult<ProjectQuestion> delete(@PathVariable("id") String id){
+        MessageResult<ProjectQuestion> msgResult = new MessageResult<>();
+
+        try {
+            ProjectQuestion projectQuestion = projectQuestionService.get(id);
+
+            if (projectQuestion != null) {
+                projectQuestion.setDelFlag(true);
+                projectQuestionService.update(projectQuestion);
+
+                msgResult.setResult(true);
+                msgResult.setData(projectQuestion);
+            } else {
+                msgResult.setResult(false);
+                msgResult.setMessage("数据库删除失败");
+            }
+        }
+        catch(Exception ex){
+            logger.error(ex.getMessage(),ex);
+
+            msgResult.setResult(false);
+            msgResult.setMessage(ex.getMessage());
+        }
+
+        return msgResult;
+    }
+
+    @ApiOperation(value="关闭回复")
+    @PostMapping("closeResult/{id}")
+    public MessageResult<ProjectQuestion> closeResult(@PathVariable("id") String id){
+        MessageResult<ProjectQuestion> msgResult = new MessageResult<>();
+
+        try {
+            ProjectQuestion projectQuestion = projectQuestionService.get(id);
+
+            if (projectQuestion != null) {
+                if(projectQuestion.getStopReply()) {
+                    projectQuestion.setStopReply(false);
+                }
+                else {
+                    projectQuestion.setStopReply(true);
+                }
+                projectQuestionService.update(projectQuestion);
+
+                msgResult.setResult(true);
+                msgResult.setData(projectQuestion);
+            } else {
+                msgResult.setResult(false);
+                msgResult.setMessage("数据库删除失败");
+            }
+        }
+        catch(Exception ex){
+            logger.error(ex.getMessage(),ex);
+
+            msgResult.setResult(false);
+            msgResult.setMessage(ex.getMessage());
+        }
+
+        return msgResult;
+    }
+
+    @ApiOperation(value="批量删除")
+    @PostMapping("batchDelete")
+    public MessageResult<ProjectQuestion> batchDelete(@RequestParam(value="ids") String ids,@RequestAttribute String subject){
+        MessageResult<ProjectQuestion> msgResult = new MessageResult<>();
+
+        try{
+            msgResult.setResult(true);
+            String[] idArray = ids.split(",");
+            for(String id : idArray){
+                ProjectQuestion projectQuestion = projectQuestionService.get(id);
+                projectQuestion.setDelFlag(true);
+
+                int affectCount = projectQuestionService.update(projectQuestion);
+                if (affectCount <= 0) {
+                    msgResult.setResult(false);
+                    msgResult.setMessage("数据库删除失败");
+                }
+            }
+        }
+        catch(Exception ex) {
+            logger.error(ex.getMessage(),ex);
+
+            msgResult.setResult(false);
+            msgResult.setMessage(ex.getMessage());
+        }
+
+        return msgResult;
+    }
+
+    @ApiOperation(value="列表")
+    @RequestMapping(value = "list",method = RequestMethod.POST)
+    @ApiImplicitParams({
+            @ApiImplicitParam(name="selProjectID", paramType="query", value="项目ID"),
+            @ApiImplicitParam(name="selProjectName", paramType="query", value="项目名称"),
+            @ApiImplicitParam(name="selDetail", paramType="query", value="问题"),
+            @ApiImplicitParam(name="start", paramType="query", value="起始条数"),
+            @ApiImplicitParam(name="length", paramType="query", value="每页条数")
+    })
+    public MessageResult<Map> list(
+            @RequestParam(value="selProjectID",defaultValue="")String selProjectID,
+            @RequestParam(value="selProjectName",defaultValue="")String selProjectName,
+            @RequestParam(value="selDetail",defaultValue="")String selDetail,
+            @RequestParam(value="start",defaultValue="0") int start,
+            @RequestParam(value="length",defaultValue="20") int length,
+            @RequestAttribute String subject){
+        //当前用户ID
+        System.out.println(subject);
+
+        MessageResult<Map> msgResult = new MessageResult<>();
+
+        Map<String,Object> searchParms = new HashMap<>();
+        searchParms.put("delFlag",false);
+        searchParms.put("delFlagProject",true);
+
+        List<Sort> sortList = new ArrayList<>();
+        sortList.add(new Sort("create_date_","desc"));
+
+        if (StringUtils.isNotEmpty(selProjectID)) {
+            searchParms.put("selProjectID",selProjectID);
+        }
+
+        if (StringUtils.isNotEmpty(selProjectName)) {
+            searchParms.put("selProjectName","%" + selProjectName + "%");
+        }
+
+        if (StringUtils.isNotEmpty(selDetail)) {
+            searchParms.put("selDetail","%" + selDetail + "%");
+        }
+
+        start = start + 1;
+        int pageNum = start / length;
+
+        if (pageNum == 0 || start % length != 0) {
+            pageNum++;
+        }
+
+        int pageSize = length;
+
+        Page<ProjectQuestion> page = projectQuestionService.pageSearch(searchParms,pageNum,pageSize,sortList);
+
+        msgResult.setResult(true);
+        msgResult.setData(PojoUtils.pageWrapper(page));
+
+        return msgResult;
+    }
+
+    @ApiOperation(value="根据问题ID,获取问题及回复")
+    @GetMapping("detailListForQuestionID")
+    @ApiImplicitParams({
+            @ApiImplicitParam(name="questionID", paramType="query", value="问题ID"),
+    })
+    public MessageResult<ProjectQuestion> detailListForQuestionID(@RequestParam(value="questionID",defaultValue="")String questionID){
+        MessageResult<ProjectQuestion> msgResult = new MessageResult<>();
+
+        List<Sort> sortList = new ArrayList<>();
+        sortList.add(new Sort("create_date_","asc"));
+
+        try {
+            ProjectQuestion projectQuestion = projectQuestionService.get(questionID);
+            projectQuestion.setProjectImagesList(getProjectImagesList(projectQuestion.getId()));
+
+            Map<String, Object> searchParmsReply = new HashMap<>();
+            searchParmsReply.put("delFlag",false);
+            searchParmsReply.put("QuestionId", projectQuestion.getId());
+
+            Page<ProjectReply> page = projectReplyService.pageSearch(searchParmsReply, 1, 1000, sortList);
+            List<ProjectReply> projectReplyList = new ArrayList<>();
+            for(ProjectReply projectReply : page.getResult()){
+                projectReply.setProjectImagesList(getProjectImagesList(projectReply.getId()));
+                projectReplyList.add(projectReply);
+            }
+            projectQuestion.setProjectReplyList(projectReplyList);
+
+            msgResult.setResult(true);
+            msgResult.setData(projectQuestion);
+        }
+        catch(Exception ex){
+            logger.error(ex.getMessage(),ex);
+
+            msgResult.setResult(false);
+            msgResult.setMessage(ex.getMessage());
+        }
+
+        return msgResult;
+    }
+
+    private List<ProjectImages> getProjectImagesList(String FID){
+        Map<String,Object> searchParms = new HashMap<>();
+        searchParms.put("delFlag",false);
+        searchParms.put("selFID",FID);
+
+        List<Sort> sortList = new ArrayList<>();
+        sortList.add(new Sort("create_date_","asc"));
+
+        Page<ProjectImages> page = projectImagesService.pageSearch(searchParms,1,100,sortList);
+
+        return page.getResult();
+    }
+
+    public MessageResult<List<Messages>> multiAdd(List<String> ids, String title, String detail, String subject){
+        MessageResult<List<Messages>> msgResult = new MessageResult<>();
+
+        try {
+            List<Messages> list = new ArrayList<>();
+            for(String str : ids) {
+                Messages messages = new Messages();
+                messages.setId(UUID.randomUUID().toString());
+                messages.setAdminId(str);
+                messages.setTitle(title);
+                messages.setDetail(detail);
+                messages.setHaveRead(false);
+                messages.setDelFlag(false);
+                messages.setCreateBy(subject);
+                messages.setCreateDate(new Date());
+                messages.setUpdateBy(subject);
+                messages.setUpdateDate(new Date());
+                int affectCount = messagesService.insert(messages);
+
+                if (affectCount > 0) {
+                    list.add(messages);
+                }
+            }
+
+            msgResult.setResult(true);
+            msgResult.setData(list);
+        }
+        catch(Exception ex){
+            logger.error(ex.getMessage(),ex);
+
+            msgResult.setResult(false);
+            msgResult.setMessage(ex.getMessage());
+        }
+
+        return msgResult;
+    }
+}

+ 130 - 0
src/main/java/com/jpsoft/ipcps/controller/ProjectReplyController.java

@@ -0,0 +1,130 @@
+package com.jpsoft.ipcps.controller;
+
+import com.github.pagehelper.Page;
+import com.jpsoft.ipcps.common.Sort;
+import com.jpsoft.ipcps.dto.MessageResult;
+import com.jpsoft.ipcps.entity.Messages;
+import com.jpsoft.ipcps.entity.ProjectImages;
+import com.jpsoft.ipcps.entity.ProjectQuestion;
+import com.jpsoft.ipcps.entity.ProjectReply;
+import com.jpsoft.ipcps.service.MessagesService;
+import com.jpsoft.ipcps.service.ProjectImagesService;
+import com.jpsoft.ipcps.service.ProjectQuestionService;
+import com.jpsoft.ipcps.service.ProjectReplyService;
+import io.swagger.annotations.ApiImplicitParam;
+import io.swagger.annotations.ApiImplicitParams;
+import io.swagger.annotations.ApiOperation;
+import org.activiti.engine.repository.Deployment;
+import org.activiti.engine.repository.ProcessDefinition;
+import org.activiti.engine.repository.ProcessDefinitionQuery;
+import org.apache.commons.lang3.StringUtils;
+import org.apache.ibatis.mapping.ResultMap;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+
+import javax.servlet.http.HttpServletRequest;
+import java.text.SimpleDateFormat;
+import java.util.*;
+
+@RestController
+@RequestMapping("/projectReply")
+public class ProjectReplyController {
+    private Logger logger = LoggerFactory.getLogger(getClass());
+
+    @Autowired
+    private ProjectReplyService projectReplyService;
+    @Autowired
+    private ProjectImagesService projectImagesService;
+    @Autowired
+    private ProjectQuestionService projectQuestionService;
+    @Autowired
+    private MessagesService messagesService;
+
+    @ApiOperation(value="添加信息")
+    @PostMapping("add")
+    @ApiImplicitParams({
+            @ApiImplicitParam(name = "questionId", paramType ="query", value = "问题ID"),
+            @ApiImplicitParam(name = "detail", paramType ="query", value = "回复"),
+            @ApiImplicitParam(name = "fileUrls", paramType = "query", value = "上传附件路径(用“,”分隔)"),
+    })
+    public MessageResult<Map> add(
+            @RequestParam(value = "questionId", required = false) String questionId,
+            @RequestParam(value = "detail", required = false) String detail,
+            @RequestParam(value = "fileUrls", required = false) String fileUrls,
+            @RequestAttribute String subject){
+        MessageResult<Map> msgResult = new MessageResult<>();
+        Map<String,Object> map = new HashMap<>();
+        ProjectQuestion projectQuestion = projectQuestionService.get(questionId);
+
+        try {
+            if(projectQuestion.getStopReply()){
+                msgResult.setResult(false);
+                msgResult.setMessage("回复已关闭");
+            }
+            else {
+                //保存回复
+                ProjectReply projectReply = new ProjectReply();
+                projectReply.setId(UUID.randomUUID().toString());
+                projectReply.setQuestionId(questionId);
+                projectReply.setDetail(detail);
+                projectReply.setDelFlag(false);
+                projectReply.setCreateBy(subject);
+                projectReply.setCreateDate(new Date());
+                int affectCount = projectReplyService.insert(projectReply);
+
+                //保存图片
+                List<ProjectImages> projectImagesList = new ArrayList<>();
+                if (StringUtils.isNotEmpty(fileUrls)) {
+                    String[] url = fileUrls.split(",");
+                    for (String str : url) {
+                        ProjectImages projectImages = new ProjectImages();
+                        projectImages.setId(UUID.randomUUID().toString());
+                        projectImages.setFId(projectReply.getId());
+                        projectImages.setImageUrl(str);
+                        projectImages.setDelFlag(false);
+                        projectImages.setCreateBy(subject);
+                        projectImages.setCreateDate(new Date());
+                        projectImagesService.insert(projectImages);
+
+                        projectImagesList.add(projectImages);
+                    }
+                }
+
+                //发送站内消息
+                Messages messages = new Messages();
+                messages.setId(UUID.randomUUID().toString());
+                messages.setAdminId(projectQuestion.getCreateBy());
+                messages.setTitle("关于“" + projectQuestion.getDetail() + "”问题的回复");
+                messages.setDetail(detail);
+                messages.setHaveRead(false);
+                messages.setDelFlag(false);
+                messages.setCreateBy(subject);
+                messages.setCreateDate(new Date());
+                messages.setUpdateBy(subject);
+                messages.setUpdateDate(new Date());
+                messagesService.insert(messages);
+
+                map.put("projectReply", projectReply);
+                map.put("projectImagesList", projectImagesList);
+
+                if (affectCount > 0) {
+                    msgResult.setResult(true);
+                    msgResult.setData(map);
+                } else {
+                    msgResult.setResult(false);
+                    msgResult.setMessage("数据库添加失败");
+                }
+            }
+        }
+        catch(Exception ex){
+            logger.error(ex.getMessage(),ex);
+
+            msgResult.setResult(false);
+            msgResult.setMessage(ex.getMessage());
+        }
+
+        return msgResult;
+    }
+}

+ 354 - 0
src/main/java/com/jpsoft/ipcps/controller/ProjectWarningController.java

@@ -0,0 +1,354 @@
+package com.jpsoft.ipcps.controller;
+
+import com.github.pagehelper.Page;
+import com.jpsoft.ipcps.common.PojoUtils;
+import com.jpsoft.ipcps.common.Sort;
+import com.jpsoft.ipcps.dto.MessageResult;
+import com.jpsoft.ipcps.entity.AdminRole;
+import com.jpsoft.ipcps.entity.JpAdmin;
+import com.jpsoft.ipcps.entity.ProjectWarning;
+import com.jpsoft.ipcps.service.AdminRoleService;
+import com.jpsoft.ipcps.service.JpAdminService;
+import com.jpsoft.ipcps.service.ProjectTaskService;
+import com.jpsoft.ipcps.service.ProjectWarningService;
+import io.swagger.annotations.ApiImplicitParam;
+import io.swagger.annotations.ApiImplicitParams;
+import io.swagger.annotations.ApiOperation;
+import org.activiti.engine.repository.Deployment;
+import org.activiti.engine.repository.ProcessDefinition;
+import org.activiti.engine.repository.ProcessDefinitionQuery;
+import org.apache.commons.lang3.StringUtils;
+import org.apache.ibatis.mapping.ResultMap;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+
+import javax.servlet.http.HttpServletRequest;
+import java.text.SimpleDateFormat;
+import java.util.*;
+
+@RestController
+@RequestMapping("/projectWarning")
+public class ProjectWarningController {
+    private Logger logger = LoggerFactory.getLogger(getClass());
+
+    @Autowired
+    private ProjectWarningService projectWarningService;
+    @Autowired
+    private JpAdminService jpAdminService;
+    @Autowired
+    private ProjectTaskService projectTaskService;
+    @Autowired
+    private AdminRoleService adminRoleService;
+
+    @ApiOperation(value="添加信息")
+    @PostMapping("add")
+    public MessageResult<ProjectWarning> add(@ModelAttribute ProjectWarning projectWarning,@RequestAttribute String subject){
+        MessageResult<ProjectWarning> msgResult = new MessageResult<>();
+
+        try {
+            projectWarning.setId(UUID.randomUUID().toString());
+
+            projectWarning.setCreateBy(subject);
+            projectWarning.setCreateDate(new Date());
+            projectWarning.setDelFlag(false);
+            int affectCount = projectWarningService.insert(projectWarning);
+
+            if (affectCount > 0) {
+                msgResult.setResult(true);
+                msgResult.setData(projectWarning);
+            } else {
+                msgResult.setResult(false);
+                msgResult.setMessage("数据库添加失败");
+            }
+        }
+        catch(Exception ex){
+            logger.error(ex.getMessage(),ex);
+
+            msgResult.setResult(false);
+            msgResult.setMessage(ex.getMessage());
+        }
+
+        return msgResult;
+    }
+
+    @ApiOperation(value="获取信息")
+    @GetMapping("detail/{id}")
+    public MessageResult<ProjectWarning> detail(@PathVariable("id") String id){
+        MessageResult<ProjectWarning> msgResult = new MessageResult<>();
+
+        try {
+            ProjectWarning projectWarning = projectWarningService.get(id);
+
+            if (projectWarning != null) {
+                msgResult.setResult(true);
+                msgResult.setData(projectWarning);
+            } else {
+                msgResult.setResult(false);
+                msgResult.setMessage("数据库不存在该记录!");
+            }
+        }
+        catch(Exception ex){
+            logger.error(ex.getMessage(),ex);
+
+            msgResult.setResult(false);
+            msgResult.setMessage(ex.getMessage());
+        }
+
+        return msgResult;
+    }
+
+    @ApiOperation(value="更新用户")
+    @PostMapping("update")
+    public MessageResult<ProjectWarning> update(@ModelAttribute ProjectWarning projectWarning,@RequestAttribute String subject){
+        MessageResult<ProjectWarning> msgResult = new MessageResult<>();
+
+        try {
+            projectWarning.setUpdateBy(subject);
+            projectWarning.setUpdateDate(new Date());
+            int affectCount = projectWarningService.update(projectWarning);
+
+            if (affectCount > 0) {
+                msgResult.setResult(true);
+                msgResult.setData(projectWarning);
+            } else {
+                msgResult.setResult(false);
+                msgResult.setMessage("数据库更新失败");
+            }
+        }
+        catch(Exception ex){
+            logger.error(ex.getMessage(),ex);
+
+            msgResult.setResult(false);
+            msgResult.setMessage(ex.getMessage());
+        }
+
+        return msgResult;
+    }
+
+    @ApiOperation(value="删除用户-通用")
+    @PostMapping("delete/{id}")
+    public MessageResult<ProjectWarning> delete(@PathVariable("id") String id){
+        MessageResult<ProjectWarning> msgResult = new MessageResult<>();
+
+        try {
+            ProjectWarning projectWarning = projectWarningService.get(id);
+            projectWarning.setDelFlag(true);
+            int affectCount = projectWarningService.update(projectWarning);
+            //int affectCount = projectWarningService.delete(id);
+
+            if (affectCount > 0) {
+                msgResult.setResult(true);
+            } else {
+                msgResult.setResult(false);
+                msgResult.setMessage("数据库删除失败");
+            }
+        }
+        catch(Exception ex){
+            logger.error(ex.getMessage(),ex);
+
+            msgResult.setResult(false);
+            msgResult.setMessage(ex.getMessage());
+        }
+
+        return msgResult;
+    }
+
+
+    @ApiOperation(value="批量删除-通用")
+    @PostMapping("batchDelete")
+    public MessageResult<ProjectWarning> batchDelete(@RequestParam(value = "ids", defaultValue = "") String ids){
+        MessageResult<ProjectWarning> msgResult = new MessageResult<>();
+        try{
+            String[] arr = ids.split(",");
+            for(String id : arr){
+                ProjectWarning projectWarning = projectWarningService.get(id);
+                projectWarning.setDelFlag(true);
+                projectWarningService.update(projectWarning);
+            }
+            msgResult.setResult(true);
+        }catch (Exception ex) {
+            logger.error(ex.getMessage(), ex);
+            msgResult.setResult(false);
+            msgResult.setMessage(ex.getMessage());
+        }
+
+        return msgResult;
+    }
+
+    @ApiOperation(value="列表-通用")
+    @RequestMapping(value = "list",method = RequestMethod.POST)
+    @ApiImplicitParams({
+            @ApiImplicitParam(name = "id", paramType = "query", value = "报警ID"),
+            @ApiImplicitParam(name = "projectId", paramType = "query", value = "项目ID"),
+            @ApiImplicitParam(name = "projectName", paramType = "query", value = "项目名称"),
+            @ApiImplicitParam(name = "roleId", paramType = "query", value = "角色ID")
+    })
+    public MessageResult<Map> list(
+            @RequestParam(value = "id", defaultValue = "") String id,
+            @RequestParam(value = "projectId", defaultValue = "") String projectId,
+            @RequestParam(value = "projectName", defaultValue = "") String projectName,
+            @RequestParam(value = "roleId", defaultValue = "") String roleId,
+            @RequestParam(value="draw",defaultValue="1") int draw,
+            @RequestParam(value="start",defaultValue="1") int start,
+            @RequestParam(value="length",defaultValue="20") int length,
+            @RequestAttribute String subject,
+            HttpServletRequest request){
+        //当前用户ID
+        System.out.println(subject);
+
+        MessageResult<Map> msgResult = new MessageResult<>();
+
+        Map<String,Object> searchParms = new HashMap<>();
+
+        List<Sort> sortList = new ArrayList<>();
+        sortList.add(new Sort("create_date_","desc"));
+
+        if (StringUtils.isNotEmpty(id)) {
+            searchParms.put("id","%" + id + "%");
+        }
+        if (StringUtils.isNotEmpty(projectId)) {
+            searchParms.put("projectId",projectId);
+        }
+        if (StringUtils.isNotEmpty(projectName)) {
+            searchParms.put("projectName","%" + projectName + "%");
+        }
+
+        if(StringUtils.isEmpty(roleId)){
+            //用户IDZLD
+            JpAdmin queryUser = jpAdminService.get(subject);
+
+            //List<AdminRole> roleList = queryUser.getAdminRoleList();
+            List<AdminRole> roleList = adminRoleService.listByAdminId(subject);
+
+            if(roleList!=null && roleList.size()>0){
+                roleId = roleList.get(0).getRoleId();
+            }
+            else if(StringUtils.isNotEmpty(queryUser.getRoleId())){
+                roleId = queryUser.getRoleId();
+            }
+        }
+
+        int count1 = adminRoleService.findCountByAIdAndRName(subject,"SYSADMIN");
+        int count2 = adminRoleService.findCountByAIdAndRName(subject,"ZLD");
+        int count3 = adminRoleService.findCountByAIdAndRName(subject,"TZCJZX");
+        if(count1 > 0){
+            //查全部
+        }else if(count2 > 0){
+            //查全部
+        }else if(count3 > 0){
+            //查全部
+        }else {
+            //用户ID
+            AdminRole adminRole = adminRoleService.findByAIdAndRId(subject, roleId);
+            if (adminRole != null) {
+                if ("XMF".equals(adminRole.getRoleName())) {
+                    searchParms.put("XMF", subject);
+                } else if ("QYMS".equals(adminRole.getRoleName())) {
+                    searchParms.put("QYMS", subject);
+                } else if ("BLLD".equals(adminRole.getRoleName())) {
+                    searchParms.put("BLLD", subject);
+                } else if ("SYSADMIN".equals(adminRole.getRoleName())) {
+                    //项目管理员查全部
+                } else if ("TZCJZX".equals(adminRole.getRoleName())) {
+                    //CXQBXM查全部
+                } else {
+                    //否则都不能看到
+                    searchParms.put("XMF", "NO");
+                }
+            } else {
+                //否则都不能看到
+                searchParms.put("XMF", "NO");
+            }
+        }
+
+
+        //未删除条件
+        searchParms.put("delFlag","0");
+        int pageNum = start / length;
+
+        if (start % length != 0) {
+            pageNum++;
+        }
+
+        int pageSize = length;
+
+        Page<ProjectWarning> page = projectWarningService.pageSearch(searchParms,pageNum,pageSize,sortList);
+
+        msgResult.setResult(true);
+        msgResult.setData(PojoUtils.pageWrapper(page));
+
+        return msgResult;
+    }
+
+
+    @ApiOperation(value="添加信息-手机页面")
+    @PostMapping("addMethod")
+    public MessageResult<ProjectWarning> addMethod(
+            //@ModelAttribute ProjectWarning projectWarning,
+            @RequestParam("projectId") String projectId,
+            @RequestParam("detail") String detail,
+            @RequestParam("procInstId") String procInstId,
+            @RequestParam("taskDefKey") String taskDefKey,
+            @RequestAttribute String subject) {
+        MessageResult<ProjectWarning> msgResult = new MessageResult<>();
+
+        try {
+            if(!StringUtils.isNoneBlank(projectId)){
+                msgResult.setResult(false);
+                msgResult.setMessage("项目编号不能为空");
+                return msgResult;
+            }
+
+            if(!StringUtils.isNoneBlank(taskDefKey)){
+                msgResult.setResult(false);
+                msgResult.setMessage("项目当前步骤不能为空");
+                return msgResult;
+            }
+
+            ProjectWarning projectWarning = new ProjectWarning();
+            projectWarning.setId(UUID.randomUUID().toString());
+
+            //存一下上传步骤
+            String taskName = "";
+            List<Map> taskList =projectTaskService.findByPIdANDDefKey(projectId,taskDefKey);
+            for(int i = 0;i< taskList.size(); i ++){
+                Map map = taskList.get(i);
+                taskName += map.get("taskName");
+                if(i > 0 && i != taskList.size()){
+                    taskName += ",";
+                }
+            }
+
+            projectWarning.setTaskName(taskName);
+            projectWarning.setProjectId(projectId);
+            projectWarning.setDetail(detail);
+            projectWarning.setProcinstId(procInstId);
+            projectWarning.setTaskDefKey(taskDefKey);
+            projectWarning.setCreateBy(subject);
+            projectWarning.setCreateDate(new Date());
+            projectWarning.setDelFlag(false);
+            int affectCount = projectWarningService.insert(projectWarning);
+
+            if (affectCount > 0) {
+                msgResult.setResult(true);
+                msgResult.setData(projectWarning);
+            } else {
+                msgResult.setResult(false);
+                msgResult.setMessage("数据库添加失败");
+            }
+        }
+        catch(Exception ex){
+            logger.error(ex.getMessage(),ex);
+
+            msgResult.setResult(false);
+            msgResult.setMessage(ex.getMessage());
+        }
+
+        return msgResult;
+    }
+
+
+
+}

+ 312 - 0
src/main/java/com/jpsoft/ipcps/controller/RoleController.java

@@ -0,0 +1,312 @@
+package com.jpsoft.ipcps.controller;
+
+import com.github.pagehelper.Page;
+import com.jpsoft.ipcps.common.PojoUtils;
+import com.jpsoft.ipcps.common.Sort;
+import com.jpsoft.ipcps.dto.MessageResult;
+import com.jpsoft.ipcps.entity.Menu;
+import com.jpsoft.ipcps.entity.Role;
+import com.jpsoft.ipcps.entity.RoleMenu;
+import com.jpsoft.ipcps.service.JpAdminService;
+import com.jpsoft.ipcps.service.MenuService;
+import com.jpsoft.ipcps.service.RoleMenuService;
+import com.jpsoft.ipcps.service.RoleService;
+import io.swagger.annotations.ApiImplicitParam;
+import io.swagger.annotations.ApiImplicitParams;
+import io.swagger.annotations.ApiOperation;
+import org.activiti.engine.repository.Deployment;
+import org.activiti.engine.repository.ProcessDefinition;
+import org.activiti.engine.repository.ProcessDefinitionQuery;
+import org.apache.commons.lang3.StringUtils;
+import org.apache.ibatis.mapping.ResultMap;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.transaction.annotation.Transactional;
+import org.springframework.web.bind.annotation.*;
+
+import javax.servlet.http.HttpServletRequest;
+import java.text.SimpleDateFormat;
+import java.util.*;
+
+@RestController
+@RequestMapping("/role")
+public class RoleController {
+    private Logger logger = LoggerFactory.getLogger(getClass());
+
+    @Autowired
+    private RoleService roleService;
+
+    @Autowired
+    private JpAdminService jpAdminService;
+
+    @Autowired
+    private MenuService menuService;
+
+    @Autowired
+    private RoleMenuService roleMenuService;
+
+    @ApiOperation(value="添加信息")
+    @PostMapping("add")
+    public MessageResult<Role> add(@ModelAttribute Role role){
+        MessageResult<Role> msgResult = new MessageResult<>();
+
+        try {
+            role.setId(UUID.randomUUID().toString());
+
+            role.setDelFlag(false);
+            int affectCount = roleService.insert(role);
+
+            if (affectCount > 0) {
+                msgResult.setResult(true);
+                msgResult.setData(role);
+            } else {
+                msgResult.setResult(false);
+                msgResult.setMessage("数据库添加失败");
+            }
+        }
+        catch(Exception ex){
+            logger.error(ex.getMessage(),ex);
+
+            msgResult.setResult(false);
+            msgResult.setMessage(ex.getMessage());
+        }
+
+        return msgResult;
+    }
+
+    @ApiOperation(value="获取信息")
+    @GetMapping("detail/{id}")
+    public MessageResult<Role> detail(@PathVariable("id") String id){
+        MessageResult<Role> msgResult = new MessageResult<>();
+
+        try {
+            Role role = roleService.get(id);
+
+            if (role != null) {
+                msgResult.setResult(true);
+                msgResult.setData(role);
+            } else {
+                msgResult.setResult(false);
+                msgResult.setMessage("数据库不存在该记录!");
+            }
+        }
+        catch(Exception ex){
+            logger.error(ex.getMessage(),ex);
+
+            msgResult.setResult(false);
+            msgResult.setMessage(ex.getMessage());
+        }
+
+        return msgResult;
+    }
+
+    @ApiOperation(value="更新用户")
+    @PostMapping("update")
+    public MessageResult<Role> update(@ModelAttribute Role role){
+        MessageResult<Role> msgResult = new MessageResult<>();
+
+        try {
+            int affectCount = roleService.update(role);
+
+            if (affectCount > 0) {
+                msgResult.setResult(true);
+                msgResult.setData(role);
+            } else {
+                msgResult.setResult(false);
+                msgResult.setMessage("数据库更新失败");
+            }
+        }
+        catch(Exception ex){
+            logger.error(ex.getMessage(),ex);
+
+            msgResult.setResult(false);
+            msgResult.setMessage(ex.getMessage());
+        }
+
+        return msgResult;
+    }
+
+    @ApiOperation(value="删除用户")
+    @PostMapping("delete/{id}")
+    public MessageResult<Role> delete(@PathVariable("id") String id){
+        MessageResult<Role> msgResult = new MessageResult<>();
+
+        try {
+            Role role = roleService.get(id);
+
+            role.setDelFlag(true);
+
+            int affectCount = roleService.update(role);
+
+            if (affectCount > 0) {
+                msgResult.setResult(true);
+            } else {
+                msgResult.setResult(false);
+                msgResult.setMessage("数据库删除失败");
+            }
+        }
+        catch(Exception ex){
+            logger.error(ex.getMessage(),ex);
+
+            msgResult.setResult(false);
+            msgResult.setMessage(ex.getMessage());
+        }
+
+        return msgResult;
+    }
+
+
+    @ApiOperation(value="批量删除")
+    @PostMapping("batchDelete")
+    public MessageResult<Role> batchDelete(String ids){
+        MessageResult<Role> msgResult = new MessageResult<>();
+
+        try{
+            String[] arr = ids.split(",");
+            for(String id : arr){
+                Role role = roleService.get(id);
+                role.setDelFlag(true);
+                roleService.update(role);
+            }
+            msgResult.setResult(true);
+        }catch (Exception ex) {
+            logger.error(ex.getMessage(), ex);
+            msgResult.setResult(false);
+            msgResult.setMessage(ex.getMessage());
+        }
+
+        return msgResult;
+    }
+
+    @ApiOperation(value="列表")
+    @RequestMapping(value = "list",method = RequestMethod.POST)
+    public MessageResult<Map> list(
+            String roleName,
+            String roleDescription,
+            @RequestParam(value="start",defaultValue="0") int start,
+            @RequestParam(value="length",defaultValue="20") int length,
+            HttpServletRequest request){
+        String subject = (String)request.getAttribute("subject");
+
+        //当前用户ID
+        System.out.println(subject);
+
+        MessageResult<Map> msgResult = new MessageResult<>();
+
+        Map<String,Object> searchParams = new HashMap<>();
+
+        List<Sort> sortList = new ArrayList<>();
+        sortList.add(new Sort("role_name_","asc"));
+
+        if (StringUtils.isNotEmpty(roleName)) {
+            searchParams.put("roleName","%" + roleName + "%");
+        }
+
+        if (StringUtils.isNotEmpty(roleDescription)) {
+            searchParams.put("roleDescription","%" + roleDescription + "%");
+        }
+
+
+        int pageNum = start / length;
+
+        pageNum++;
+
+        int pageSize = length;
+
+        Page<Role> page = roleService.pageSearch(searchParams,pageNum,pageSize,sortList);
+
+        msgResult.setResult(true);
+        msgResult.setData(PojoUtils.pageWrapper(page));
+
+        return msgResult;
+    }
+
+
+    @ApiOperation(value="全部列表")
+    @RequestMapping(value = "allList",method = RequestMethod.POST)
+    public MessageResult<List<Role>> allList(HttpServletRequest request){
+        MessageResult<List<Role>> msgResult = new MessageResult<>();
+        List<Role> list = roleService.list();
+        msgResult.setResult(true);
+        msgResult.setData(list);
+        return msgResult;
+    }
+
+    @ApiOperation(value="查询角色")
+    @PostMapping(value = "selectRole")
+    public List<Map> selectRole(String term){
+        Map<String,Object> searchParams = new HashMap<>();
+
+        if (StringUtils.isNotEmpty(term)) {
+            searchParams.put("key", "%" + term + "%");
+        }
+
+        return roleService.selectRole(searchParams);
+    }
+
+    @ApiOperation(value="获取已分配菜单列表")
+    @PostMapping(value = "queryRelatedMenuList")
+    public MessageResult<List> queryRelatedMenuList(String roleId){
+        MessageResult<List> msgResult = new MessageResult<>();
+
+        List<Menu> menuList = menuService.list();
+
+        List<RoleMenu> list = roleMenuService.findByRoleId(roleId);
+
+        Set<String> allocMenuSet = new HashSet<>();
+
+        for (RoleMenu roleMenu : list) {
+            allocMenuSet.add(roleMenu.getMenuId());
+        }
+
+        for (Menu menu : menuList) {
+            if (allocMenuSet.contains(menu.getId())){
+                menu.setChecked(true);
+            }
+        }
+
+        msgResult.setData(menuList);
+        msgResult.setResult(true);
+
+        return msgResult;
+    }
+
+    @ApiOperation(value="保存关联菜单")
+    @PostMapping(value = "saveRelatedMenu")
+    @Transactional(rollbackFor = Exception.class)
+    public MessageResult<Integer> saveRelatedMenu(String roleId,String menuIds,String subject){
+        MessageResult<Integer> msgResult = new MessageResult<>();
+
+        try {
+            roleMenuService.deleteByRoleId(roleId);
+
+            int affectCount = 0;
+
+            String[] menuList = menuIds.split(",");
+
+            for (String menuId : menuList) {
+                RoleMenu rm = new RoleMenu();
+                rm.setId(UUID.randomUUID().toString());
+                rm.setRoleId(roleId);
+                rm.setMenuId(menuId);
+                rm.setDelFlag(false);
+                rm.setCreateBy(subject);
+                rm.setCreateTime(new Date());
+
+                affectCount+= roleMenuService.insert(rm);
+            }
+
+            msgResult.setResult(true);
+            msgResult.setData(affectCount);
+        }
+        catch(Exception ex){
+            logger.error(ex.getMessage(),ex);
+
+            msgResult.setResult(false);
+            msgResult.setMessage(ex.getMessage());
+        }
+
+        return msgResult;
+    }
+}

+ 818 - 0
src/main/java/com/jpsoft/ipcps/controller/TaskController.java

@@ -0,0 +1,818 @@
+package com.jpsoft.ipcps.controller;
+
+import com.github.pagehelper.Page;
+import com.jpsoft.ipcps.common.PojoUtils;
+import com.jpsoft.ipcps.common.Sort;
+import com.jpsoft.ipcps.dto.MessageResult;
+import com.jpsoft.ipcps.dto.TaskRequestDTO;
+import com.jpsoft.ipcps.dto.TaskResponseDTO;
+import com.jpsoft.ipcps.entity.*;
+import com.jpsoft.ipcps.service.*;
+import com.sun.org.apache.xpath.internal.operations.Bool;
+import io.swagger.annotations.ApiImplicitParam;
+import io.swagger.annotations.ApiImplicitParams;
+import io.swagger.annotations.ApiOperation;
+import org.activiti.engine.HistoryService;
+import org.activiti.engine.RuntimeService;
+import org.activiti.engine.TaskService;
+import org.activiti.engine.history.HistoricProcessInstance;
+import org.activiti.engine.history.HistoricTaskInstance;
+import org.activiti.engine.runtime.ProcessInstance;
+import org.activiti.engine.task.IdentityLink;
+import org.activiti.engine.task.Task;
+import org.apache.commons.lang3.StringUtils;
+import org.joda.time.DateTime;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.format.annotation.DateTimeFormat;
+import org.springframework.web.bind.annotation.*;
+
+import java.util.*;
+import java.util.stream.Collectors;
+
+@RequestMapping("task")
+@RestController
+public class TaskController {
+    private Logger logger = LoggerFactory.getLogger(getClass());
+
+    @Autowired
+    private TaskService taskService;
+
+    @Autowired
+    private HistoryService historyService;
+
+    @Autowired
+    private ProjectTaskService projectTaskService;
+
+    @Autowired
+    private ProcInstToDoService procInstToDoService;
+
+    @Autowired
+    private MonthPlanService monthPlanService;
+
+    @Autowired
+    private MonthPlanMatterService monthPlanMatterService;
+
+    @Autowired
+    private RuntimeService runtimeService;
+
+    @Autowired
+    private JpAdminService jpAdminService;
+
+    @Autowired
+    private ProcDefStepAssigneeService procDefStepAssigneeService;
+
+    @Autowired
+    private ProcInstTemplateService procInstTemplateService;
+
+    @Autowired
+    private ProcDefTemplateStepService procDefTemplateStepService;
+
+    @Autowired
+    private ProcInstService procInstService;
+
+    @Autowired
+    private MessagesService messagesService;
+
+    @Autowired
+    private ProjectService projectService;
+
+    @Autowired
+    private RoleService roleService;
+
+    @ApiOperation(value="获取待办事项")
+    @PostMapping(value = "taskList")
+    @ApiImplicitParams({
+            @ApiImplicitParam(name="procDefKey", paramType = "query"),
+            @ApiImplicitParam(name="taskName", paramType = "query"),
+            @ApiImplicitParam(name="projectName",paramType = "query"),
+            @ApiImplicitParam(name="delegateUser",paramType = "query",value="传递QYMS时将项目秘书代理项目方"),
+            @ApiImplicitParam(name="beginTime", paramType = "query"),
+            @ApiImplicitParam(name="endTime",paramType = "query"),
+            @ApiImplicitParam(name="overtime",paramType = "query",value="是否超时(1)"),
+            @ApiImplicitParam(name="orgId",paramType = "query",value="所属单位")
+    })
+    public MessageResult<Map> taskList(String procDefKey,String taskName,
+                                       String projectName,
+                                       String beginTime,String endTime,
+                                       String overtime,String orgId,
+                                       String delegateUser,
+                                       @RequestParam(defaultValue = "1") Integer self,
+                                       @RequestParam(defaultValue = "0") Integer start,
+                                       @RequestParam(defaultValue = "10") Integer length,
+                                       @RequestAttribute String subject
+    ){
+        MessageResult<Map> msgResult = new MessageResult<>();
+
+        try {
+            Map<String,Object> searchParams = new HashMap<>();
+
+            if (StringUtils.isNotEmpty(procDefKey)){
+                searchParams.put("procDefKey", procDefKey);
+            }
+
+            if (StringUtils.isNotEmpty(taskName)){
+                searchParams.put("taskName", "%" + taskName + "%");
+            }
+
+            if (StringUtils.isNotEmpty(projectName)){
+                searchParams.put("projectName", "%" + projectName + "%");
+            }
+
+            if (StringUtils.isNotEmpty(delegateUser)){
+                searchParams.put("delegateUser", delegateUser);
+            }
+
+            if(StringUtils.isNotEmpty(overtime)){
+                searchParams.put("overtime",overtime);
+            }
+
+            if (StringUtils.isNotEmpty(beginTime)){
+                searchParams.put("beginTime", beginTime);
+            }
+
+            if (StringUtils.isNotEmpty(endTime)){
+                searchParams.put("endTime", endTime);
+            }
+
+            if (StringUtils.isNotEmpty(orgId)){
+                searchParams.put("orgId", orgId);
+            }
+
+            if(self==1){
+                searchParams.put("userId",subject);
+            }
+
+            List<Sort> sortList = new ArrayList<>();
+            sortList.add(new Sort("t.create_time_","desc"));
+
+            start += 1;
+            int pageNumber = start / length;
+
+            if (start % length != 0) {
+                pageNumber++;
+            }
+
+            Page<Map> page = projectTaskService.taskList(searchParams,sortList,pageNumber,length);
+
+            for (Map map: page.getResult()) {
+                if(map.get("createTime") != null){
+                    Date createTime = (Date)map.get("createTime");
+                    map.put("createTime",new DateTime(createTime).toString("yyyy-MM-dd HH:mm:ss"));
+                }
+
+                if(map.get("dueDate") != null){
+                    Date dueDate = (Date)map.get("dueDate");
+                    map.put("dueDate",new DateTime(dueDate).toString("yyyy-MM-dd HH:mm:ss"));
+                }
+            }
+
+            msgResult.setResult(true);
+
+            msgResult.setData(PojoUtils.pageWrapper(page));
+        }
+        catch(Exception ex){
+            logger.error(ex.getMessage(),ex);
+
+            msgResult.setResult(false);
+            msgResult.setMessage(ex.getMessage());
+        }
+
+        return msgResult;
+    }
+
+    @ApiOperation(value="修改任务")
+    @PostMapping(value = "edit")
+    @ApiImplicitParams({
+            @ApiImplicitParam(name="dueDate",paramType = "query",value="预警时间(非必填项)"),
+            @ApiImplicitParam(name="assignee",paramType = "query",value="分配人(非必填项)")
+    })
+    public MessageResult<String> edit(String taskId,@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") Date dueDate,String assignee){
+
+        MessageResult<String> msgResult = new MessageResult<>();
+
+        try {
+            Task task = taskService.createTaskQuery().taskId(taskId).singleResult();
+
+            if(dueDate != null) {
+                task.setDueDate(dueDate);
+            }
+
+            if(StringUtils.isNotEmpty(assignee)){
+                task.setAssignee(assignee);
+            }
+
+            taskService.saveTask(task);
+
+            msgResult.setResult(true);
+        }
+        catch(Exception ex){
+            logger.error(ex.getMessage(),ex);
+
+            msgResult.setResult(false);
+            msgResult.setMessage(ex.getMessage());
+        }
+
+        return msgResult;
+    }
+
+    @ApiOperation(value="获取任务")
+    @GetMapping(value = "getTask")
+    public MessageResult<TaskResponseDTO> getTask(@RequestParam String taskId){
+        MessageResult<TaskResponseDTO> msgResult = new MessageResult<>();
+
+        try{
+            Task task  = taskService.createTaskQuery().taskId(taskId).singleResult();
+
+            //查询待办事项
+            List<Map> todoList = procInstToDoService.findByProcInstIdAndTaskId(task.getProcessInstanceId(),taskId);
+
+            TaskResponseDTO dto = new TaskResponseDTO();
+
+            if (!StringUtils.isEmpty(task.getAssignee())) {
+                JpAdmin assignee = jpAdminService.get(task.getAssignee());
+
+                if(assignee!=null) {
+                    dto.setAssignee(assignee);
+                }
+            }
+            else{
+                List<IdentityLink> identityLinkList = taskService.getIdentityLinksForTask(taskId);
+
+                List<JpAdmin> candidates = new ArrayList<>();
+
+                for (IdentityLink identityLink: identityLinkList) {
+                    JpAdmin candidate = jpAdminService.get(identityLink.getUserId());
+
+                    if(candidate!=null) {
+                        candidates.add(candidate);
+                    }
+                }
+
+                dto.setCandidates(candidates);
+            }
+
+            dto.setTaskName(task.getName());
+            dto.setTaskId(task.getId());
+            dto.setTodoList(todoList);
+            dto.setCreateTime(task.getCreateTime());
+            dto.setDueDate(task.getDueDate());
+
+            msgResult.setData(dto);
+            msgResult.setResult(true);
+        }
+        catch(Exception ex){
+            logger.error(ex.getMessage(),ex);
+
+            msgResult.setResult(false);
+            msgResult.setMessage(ex.getMessage());
+        }
+        return msgResult;
+    }
+
+    @ApiOperation(value="获取历史任务")
+    @GetMapping(value = "getHistoricTask")
+    public MessageResult<TaskResponseDTO> getHistoricTask(@RequestParam String taskId){
+        MessageResult<TaskResponseDTO> msgResult = new MessageResult<>();
+
+        try{
+            HistoricTaskInstance task  = historyService.createHistoricTaskInstanceQuery().taskId(taskId).singleResult();
+
+            //查询待办事项
+            List<Map> todoList = procInstToDoService.findByProcInstIdAndTaskId(task.getProcessInstanceId(),taskId);
+
+            TaskResponseDTO dto = new TaskResponseDTO();
+
+            if (!StringUtils.isEmpty(task.getAssignee())) {
+                JpAdmin assignee = jpAdminService.get(task.getAssignee());
+
+                if(assignee!=null) {
+                    dto.setAssignee(assignee);
+                }
+            }
+
+            dto.setTaskName(task.getName());
+            dto.setTaskId(task.getId());
+            dto.setTodoList(todoList);
+            dto.setCreateTime(task.getCreateTime());
+            dto.setDueDate(task.getDueDate());
+            dto.setEndTime(task.getEndTime());
+
+            msgResult.setData(dto);
+            msgResult.setResult(true);
+        }
+        catch(Exception ex){
+            logger.error(ex.getMessage(),ex);
+
+            msgResult.setResult(false);
+            msgResult.setMessage(ex.getMessage());
+        }
+        return msgResult;
+    }
+
+    @ApiOperation(value="原生完成任务接口")
+    @PostMapping(value = "nativeCompleteTask")
+    public MessageResult<String> nativeCompleteTask(String taskId,Integer back){
+        MessageResult<String> msgResult = new MessageResult<>();
+        Map<String,Object> variables = new HashMap<>();
+        variables.put("back",back);
+
+        taskService.complete(taskId,variables);
+
+        return msgResult;
+    }
+
+    @ApiOperation(value="完成任务")
+    @PostMapping(value = "completeTask")
+    public MessageResult<String> completeTask(@RequestBody TaskRequestDTO dto, @RequestAttribute String subject){
+        MessageResult<String> msgResult = new MessageResult<>();
+
+        try {
+            Task task = taskService.createTaskQuery().taskId(dto.getTaskId()).singleResult();
+
+            boolean allDone = false;
+            List<Map> todoList = procInstToDoService.findByProcInstIdAndTaskId(task.getProcessInstanceId(),task.getId());
+
+            Map<String,Boolean> doneMap = new HashMap<String,Boolean>();
+
+            for (Map map : todoList) {
+                doneMap.put((String)map.get("id"),false);
+            }
+
+            if (dto.getTodoList()!=null) {
+                if (dto.getTodoList().size()==todoList.size()){
+                    allDone = true;
+                }
+
+                for (String id : dto.getTodoList()) {
+                    doneMap.put(id,true);
+                }
+            }
+
+            if (dto.getUndoList()==null){
+                List<String> undoList = new ArrayList<>();
+
+               for (String key : doneMap.keySet()){
+                   if (!doneMap.get(key)){
+                       undoList.add(key);
+                   }
+               }
+
+               dto.setUndoList(undoList);
+            }
+
+            ProcessInstance processInstance = null;
+
+            processInstance = runtimeService.createProcessInstanceQuery().processInstanceId(task.getProcessInstanceId()).singleResult();
+
+            if(allDone) {
+                if(StringUtils.isNotEmpty(dto.getAssignee())){
+                    //taskService.claim(dto.getTaskId(), dto.getAssignee());
+                    task.setAssignee(dto.getAssignee());
+                }
+                else {
+                    //taskService.claim(dto.getTaskId(), subject);
+                    task.setAssignee(subject);
+                }
+
+                taskService.saveTask(task); //如果用setAssignee1必须用saveTask
+                taskService.complete(task.getId());
+
+                //如果当前待办中有被忽略的任务则自动完成->主要针对会签时任务不是在oncreate时创建到数据库
+                List<Task> taskList = taskService.createTaskQuery().taskAssignee("admin").active().list();
+
+                for (Task delegateTask : taskList) {
+                    Boolean jump = (Boolean) taskService.getVariableLocal(delegateTask.getId(), "jump");
+
+                    if (jump != null && jump) {
+                        taskService.complete(delegateTask.getId());
+                    }
+                }
+            }
+
+            updateTodoList(dto,subject,processInstance.getBusinessKey(),null);
+
+            msgResult.setResult(true);
+        }
+        catch(Exception ex){
+            msgResult.setMessage(ex.getMessage());
+            msgResult.setResult(false);
+            logger.error(ex.getMessage(),ex);
+        }
+
+        return msgResult;
+    }
+
+    @ApiOperation(value="返回当前任务上一步")
+    @GetMapping(value = "findPrevTasks")
+    public MessageResult<List> findPrevTasks(String taskId){
+        MessageResult<List> msgResult = new MessageResult<>();
+
+        try{
+            Task task = taskService.createTaskQuery().taskId(taskId).singleResult();
+
+            List<HistoricTaskInstance> histTaskList = procInstService.getPrevHistTasks(task);
+
+            List<Map> mapList = histTaskList.stream().map((histTask)->{
+               Map<String,Object> map = new HashMap<>();
+
+               map.put("id", histTask.getId());
+               map.put("name", histTask.getName());
+               map.put("endTime", new DateTime(histTask.getEndTime()).toString("yyyy-MM-dd HH:mm:ss"));
+
+               JpAdmin user = jpAdminService.get(histTask.getAssignee());
+
+               map.put("assignee",user);
+
+               return map;
+            }).collect(Collectors.toList());
+
+            msgResult.setData(mapList);
+            msgResult.setResult(true);
+        }
+        catch(Exception ex){
+            msgResult.setMessage(ex.getMessage());
+            msgResult.setResult(false);
+            logger.error(ex.getMessage(),ex);
+        }
+
+        return msgResult;
+    }
+
+    @ApiOperation(value="退回")
+    @PostMapping(value = "back")
+    public MessageResult<String> back(String taskId,String prevTaskId, @RequestAttribute String subject){
+        MessageResult<String> msgResult = new MessageResult<>();
+
+        try {
+            Task task = taskService.createTaskQuery().taskId(taskId).singleResult();
+
+            if(!StringUtils.isEmpty(taskId)){
+                HistoricTaskInstance prevTask = historyService.createHistoricTaskInstanceQuery().taskId(prevTaskId).singleResult();
+
+                if(prevTask!=null) {
+                    Map<String, Object> variables = new HashMap<>();
+                    variables.put(prevTask.getTaskDefinitionKey() + "_back", true);
+                    variables.put(prevTask.getTaskDefinitionKey() + "_lastTaskId", prevTask.getId());
+                    variables.put(prevTask.getTaskDefinitionKey() + "_lastDueDate", prevTask.getDueDate());
+                    variables.put(prevTask.getTaskDefinitionKey() + "_assignee", prevTask.getAssignee());
+
+                    procInstService.gotoActivity(task, prevTask.getTaskDefinitionKey(), variables);
+
+                    msgResult.setResult(true);
+                }
+            }
+            else{
+                throw new Exception("没有上一步!");
+            }
+        }
+        catch(Exception ex){
+            msgResult.setMessage(ex.getMessage());
+            msgResult.setResult(false);
+            logger.error(ex.getMessage(),ex);
+        }
+
+        return msgResult;
+    }
+
+    @ApiOperation(value="修改待办列表")
+    @PostMapping(value = "saveHistoricTask")
+    public MessageResult<String> saveHistoricTask(@RequestBody TaskRequestDTO dto, @RequestAttribute String subject){
+        MessageResult<String> msgResult = new MessageResult<>();
+
+        try {
+            HistoricTaskInstance task = historyService.createHistoricTaskInstanceQuery().taskId(dto.getTaskId()).singleResult();
+
+            HistoricProcessInstance processInstance = historyService.createHistoricProcessInstanceQuery().processInstanceId(task.getProcessInstanceId()).singleResult();
+
+            updateTodoList(dto,subject,processInstance.getBusinessKey(),dto.getStartTime());
+
+            projectTaskService.updateHistoricTask(dto.getTaskId(),dto.getStartTime(),dto.getDueDate(),dto.getEndTime());
+
+            msgResult.setResult(true);
+        }
+        catch(Exception ex){
+            msgResult.setMessage(ex.getMessage());
+            msgResult.setResult(false);
+            logger.error(ex.getMessage(),ex);
+        }
+
+        return msgResult;
+    }
+
+
+
+    private void updateTodoList(TaskRequestDTO dto,String subject, String projectId,Date createDate) {
+        if (dto.getTodoList()!=null) {
+            for (String todoId : dto.getTodoList()) {
+                ProcInstToDo instToDo = procInstToDoService.get(todoId);
+
+                if(instToDo!=null) {
+                    instToDo.setCheckedFlag(true);
+
+                    if(createDate != null){
+                        instToDo.setCreateDate(createDate);
+                    }
+
+                    instToDo.setUpdateBy(subject);
+                    instToDo.setUpdateDate(new Date());
+
+                    procInstToDoService.update(instToDo);
+                }
+            }
+        }
+
+
+        if (dto.getUndoList()!=null) {
+            for (String todoId : dto.getUndoList()) {
+                ProcInstToDo instToDo = procInstToDoService.get(todoId);
+
+                if(instToDo!=null) {
+                    instToDo.setCheckedFlag(false);
+
+                    if(createDate != null){
+                        instToDo.setCreateDate(createDate);
+                    }
+
+                    instToDo.setUpdateBy(subject);
+                    instToDo.setUpdateDate(new Date());
+
+                    procInstToDoService.update(instToDo);
+                }
+            }
+        }
+
+        //todo 查看项目对应的月度计划中待办项是否完成(注意与月份对应)
+        List<MonthPlan> planList = monthPlanService.findByProjectId(projectId);
+
+        for (MonthPlan plan : planList) {
+            //查询计划完成项是否全部完成
+            List<MonthPlanMatter> matterList = monthPlanMatterService.findByPlanId(plan.getId());
+
+            List<ProcInstToDo> doneList = procInstToDoService.findDoneListByProjectIdAndCreateDate(plan.getProjectId(),plan.getYear(),plan.getMonth());
+
+            Set<String> doneSet = new HashSet<>();
+
+            for (ProcInstToDo done: doneList) {
+                // todo 这里存在一个问题,如果是会签,同一个步骤有多个实例,现在是取只要一个实例的待办完成则算完成
+                doneSet.add(done.getTodoId());
+            }
+
+            int num = 0;
+
+            for (MonthPlanMatter matter : matterList) {
+                if (doneSet.contains(matter.getTodoId())){
+                    num++;
+                }
+            }
+
+            if (num == matterList.size()) {
+                //所有月度计划待办已完成
+                plan.setFinished(true);
+            }
+            else{
+                plan.setFinished(false);
+            }
+
+            monthPlanService.update(plan);
+        }
+    }
+
+    @ApiOperation(value="获取已办事项")
+    @PostMapping(value = "finishList")
+    @ApiImplicitParams({
+            @ApiImplicitParam(name="procDefKey", paramType = "query",value="流程定义key"),
+            @ApiImplicitParam(name="taskName", paramType = "query"),
+            @ApiImplicitParam(name="projectName",paramType = "query"),
+            @ApiImplicitParam(name="delegateUser",paramType = "query",value="传递QYMS时将项目秘书代理项目方"),
+            @ApiImplicitParam(name="startTime", paramType = "query"),
+            @ApiImplicitParam(name="endTime",paramType = "query")
+    })
+    public MessageResult<Map> finishList(String procDefKey,
+                                          String projectName,
+                                          String taskName,
+                                          String startTime,
+                                          String endTime,
+                                          String delegateUser,
+                                          @RequestParam(defaultValue = "1") Integer self,
+                                          @RequestParam(defaultValue = "0") Integer start,
+                                          @RequestParam(defaultValue = "10") Integer length,
+                                          @RequestAttribute String subject
+    ){
+        MessageResult<Map> msgResult = new MessageResult<>();
+
+        try {
+            Map<String,Object> searchParams = new HashMap<>();
+
+            if (StringUtils.isNotEmpty(procDefKey)){
+                searchParams.put("procDefKey", procDefKey);
+            }
+
+            if (StringUtils.isNotEmpty(projectName)){
+                searchParams.put("projectName", "%" + projectName + "%");
+            }
+
+            if (StringUtils.isNotEmpty(delegateUser)){
+                searchParams.put("delegateUser", delegateUser);
+            }
+
+            if (StringUtils.isNotEmpty(taskName)){
+                searchParams.put("taskName", "%" + taskName + "%");
+            }
+
+            if (StringUtils.isNotEmpty(startTime)){
+                searchParams.put("beginTime", startTime);
+            }
+
+            if (StringUtils.isNotEmpty(endTime)){
+                searchParams.put("endTime", endTime);
+            }
+
+            if(self==1) {
+                searchParams.put("userId", subject);
+            }
+
+            List<Sort> sortList = new ArrayList<>();
+            sortList.add(new Sort("t1.ID_","desc"));
+
+            start += 1;
+            int pageNumber = start / length;
+
+            if (start % length != 0) {
+                pageNumber++;
+            }
+
+            Page<Map> mapList = projectTaskService.finishList(searchParams,sortList,pageNumber,length);
+
+            for (Map map: mapList) {
+                if(map.get("startTime") != null){
+                    Date createTime = (Date)map.get("startTime");
+                    map.put("startTime",new DateTime(createTime).toString("yyyy-MM-dd HH:mm:ss"));
+                }
+                else{
+                    map.put("startTime",null);
+                }
+
+                if(map.get("dueDate") != null){
+                    Date dueDate = (Date)map.get("dueDate");
+                    map.put("dueDate",new DateTime(dueDate).toString("yyyy-MM-dd HH:mm:ss"));
+                }
+                else{
+                    map.put("dueDate",null);
+                }
+
+                if(map.get("endTime") != null){
+                    Date createTime = (Date)map.get("endTime");
+                    map.put("endTime",new DateTime(createTime).toString("yyyy-MM-dd HH:mm:ss"));
+                }
+                else{
+                    map.put("endTime",null);
+                }
+            }
+
+            msgResult.setResult(true);
+            msgResult.setData(PojoUtils.pageWrapper(mapList));
+        }
+        catch(Exception ex){
+            logger.error(ex.getMessage(),ex);
+
+            msgResult.setResult(false);
+            msgResult.setMessage(ex.getMessage());
+        }
+
+        return msgResult;
+    }
+
+    @ApiOperation(value="滞留预警")
+    @PostMapping(value = "warningList")
+    @ApiImplicitParams({
+            @ApiImplicitParam(name="procDefKey", paramType = "query",value="流程定义key"),
+            @ApiImplicitParam(name="projectName",paramType = "query",value="项目名称"),
+            @ApiImplicitParam(name="parkId",paramType = "query",value="园区编号"),
+            @ApiImplicitParam(name="roleId",paramType = "query",value="角色编号"),
+            @ApiImplicitParam(name="selectedRoleId",paramType = "query",value="选择角色编号"),
+            @ApiImplicitParam(name="startTime", paramType = "query"),
+            @ApiImplicitParam(name="endTime",paramType = "query")
+    })
+    public MessageResult<Map> warningList(String procDefKey,
+                                         String projectName,
+                                         String parkId,
+                                         String roleId, String selectedRoleId,
+                                         String startTime,
+                                         String endTime,
+                                         @RequestParam(defaultValue = "0") Integer start,
+                                         @RequestParam(defaultValue = "10") Integer length,
+                                         @RequestAttribute String subject
+    ){
+        MessageResult<Map> msgResult = new MessageResult<>();
+
+        try {
+            Map<String,Object> searchParams = new HashMap<>();
+
+            if (StringUtils.isNotEmpty(procDefKey)){
+                searchParams.put("procDefKey", procDefKey);
+            }
+
+            if (StringUtils.isNotEmpty(projectName)){
+                searchParams.put("projectName", "%" + projectName + "%");
+            }
+
+            if (StringUtils.isNotEmpty(parkId)){
+                searchParams.put("parkId", parkId);
+            }
+
+//           JpAdmin queryUser = jpAdminService.get(subject);
+
+//            if (StringUtils.isNotEmpty(roleId)){
+//                searchParams.put("roleId", roleId);
+//            }else{
+//                //如果没有传值 则取token
+//                searchParams.put("roleId", queryUser.getRoleId());
+//            }
+
+            Role relatedRole = null;
+
+            if(!StringUtils.isEmpty(roleId)) {
+                relatedRole = roleService.get(roleId);
+            }
+
+            if(relatedRole != null) {
+                if("XMF".equals(relatedRole.getRoleName())){
+                    searchParams.put("XMF", subject);
+                }else if("QYMS".equals(relatedRole.getRoleName())){
+                    searchParams.put("QYMS", subject);
+                }else if("BLLD".equals(relatedRole.getRoleName())){
+                    searchParams.put("BLLD", subject);
+                }else if("SYSADMIN".equals(relatedRole.getRoleName())){
+                    //项目管理员查全部
+//                    if(StringUtils.isNotEmpty(roleId)){
+//////                        searchParams.put("roleId", roleId);
+//////                    }
+                }else if("ZLD".equals(relatedRole.getRoleName())){
+                    //总领导查全部
+                    if(StringUtils.isNotEmpty(selectedRoleId)){
+                        searchParams.put("selectedRoleId", selectedRoleId);
+                    }
+                }else{
+                    //其它角色只能查看自己
+                    searchParams.put("userId", subject);
+                }
+            }
+            else{
+                //角色不存在,只能查看自己
+                searchParams.put("userId", subject);
+            }
+
+            if (StringUtils.isNotEmpty(startTime)){
+                searchParams.put("beginTime", startTime);
+            }
+
+            if (StringUtils.isNotEmpty(endTime)){
+                searchParams.put("endTime", endTime);
+            }
+
+//          searchParams.put("userId",subject);
+
+            List<Sort> sortList = new ArrayList<>();
+            sortList.add(new Sort("t1.START_TIME_","desc"));
+
+            start += 1;
+            int pageNumber = start / length;
+
+            if (start % length != 0) {
+                pageNumber++;
+            }
+
+            Page<Map> mapList = projectTaskService.warningList(searchParams,sortList,pageNumber,length);
+
+            for (Map map: mapList) {
+                if(map.get("startTime") != null){
+                    Date createTime = (Date)map.get("startTime");
+                    map.put("startTime",new DateTime(createTime).toString("yyyy-MM-dd HH:mm:ss"));
+                }
+
+                if(map.get("dueDate") != null){
+                    Date dueDate = (Date)map.get("dueDate");
+                    map.put("dueDate",new DateTime(dueDate).toString("yyyy-MM-dd HH:mm:ss"));
+                }
+
+                if(map.get("endTime") != null){
+                    Date createTime = (Date)map.get("endTime");
+                    map.put("endTime",new DateTime(createTime).toString("yyyy-MM-dd HH:mm:ss"));
+                }
+            }
+
+            msgResult.setResult(true);
+            msgResult.setData(PojoUtils.pageWrapper(mapList));
+        }
+        catch(Exception ex){
+            logger.error(ex.getMessage(),ex);
+
+            msgResult.setResult(false);
+            msgResult.setMessage(ex.getMessage());
+        }
+
+        return msgResult;
+    }
+}

+ 196 - 0
src/main/java/com/jpsoft/ipcps/controller/WechatMessageAdminController.java

@@ -0,0 +1,196 @@
+package com.jpsoft.ipcps.controller;
+
+import com.github.pagehelper.Page;
+import com.jpsoft.ipcps.common.PojoUtils;
+import com.jpsoft.ipcps.common.Sort;
+import com.jpsoft.ipcps.dto.MessageResult;
+import com.jpsoft.ipcps.entity.AdminRole;
+import com.jpsoft.ipcps.entity.JpAdmin;
+import com.jpsoft.ipcps.entity.WechatMessageAdmin;
+import com.jpsoft.ipcps.service.AdminRoleService;
+import com.jpsoft.ipcps.service.WechatMessageAdminService;
+import io.swagger.annotations.ApiOperation;
+import org.activiti.engine.repository.Deployment;
+import org.activiti.engine.repository.ProcessDefinition;
+import org.activiti.engine.repository.ProcessDefinitionQuery;
+import org.apache.commons.lang3.StringUtils;
+import org.apache.ibatis.mapping.ResultMap;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+
+import javax.servlet.http.HttpServletRequest;
+import java.text.SimpleDateFormat;
+import java.util.*;
+
+@RestController
+@RequestMapping("/wechatMessageAdmin")
+public class WechatMessageAdminController {
+    private Logger logger = LoggerFactory.getLogger(getClass());
+
+    @Autowired
+    private AdminRoleService adminRoleService;
+
+    @Autowired
+    private WechatMessageAdminService wechatMessageAdminService;
+
+    @ApiOperation(value="添加信息")
+    @PostMapping("add")
+    public MessageResult<WechatMessageAdmin> add(@ModelAttribute WechatMessageAdmin wechatMessageAdmin){
+        MessageResult<WechatMessageAdmin> msgResult = new MessageResult<>();
+
+        try {
+            wechatMessageAdmin.setId(UUID.randomUUID().toString());
+
+            int affectCount = wechatMessageAdminService.insert(wechatMessageAdmin);
+
+            if (affectCount > 0) {
+                msgResult.setResult(true);
+                msgResult.setData(wechatMessageAdmin);
+            } else {
+                msgResult.setResult(false);
+                msgResult.setMessage("数据库添加失败");
+            }
+        }
+        catch(Exception ex){
+            logger.error(ex.getMessage(),ex);
+
+            msgResult.setResult(false);
+            msgResult.setMessage(ex.getMessage());
+        }
+
+        return msgResult;
+    }
+
+    @ApiOperation(value="获取信息")
+    @GetMapping("detail/{id}")
+    public MessageResult<WechatMessageAdmin> detail(@PathVariable("id") String id){
+        MessageResult<WechatMessageAdmin> msgResult = new MessageResult<>();
+
+        try {
+            WechatMessageAdmin wechatMessageAdmin = wechatMessageAdminService.get(id);
+
+            if (wechatMessageAdmin != null) {
+                msgResult.setResult(true);
+                msgResult.setData(wechatMessageAdmin);
+            } else {
+                msgResult.setResult(false);
+                msgResult.setMessage("数据库不存在该记录!");
+            }
+        }
+        catch(Exception ex){
+            logger.error(ex.getMessage(),ex);
+
+            msgResult.setResult(false);
+            msgResult.setMessage(ex.getMessage());
+        }
+
+        return msgResult;
+    }
+
+    @ApiOperation(value="更新用户")
+    @PostMapping("update")
+    public MessageResult<WechatMessageAdmin> update(@ModelAttribute WechatMessageAdmin wechatMessageAdmin){
+        MessageResult<WechatMessageAdmin> msgResult = new MessageResult<>();
+
+        try {
+            int affectCount = wechatMessageAdminService.update(wechatMessageAdmin);
+
+            if (affectCount > 0) {
+                msgResult.setResult(true);
+                msgResult.setData(wechatMessageAdmin);
+            } else {
+                msgResult.setResult(false);
+                msgResult.setMessage("数据库更新失败");
+            }
+        }
+        catch(Exception ex){
+            logger.error(ex.getMessage(),ex);
+
+            msgResult.setResult(false);
+            msgResult.setMessage(ex.getMessage());
+        }
+
+        return msgResult;
+    }
+
+    @ApiOperation(value="删除用户")
+    @PostMapping("delete/{id}")
+    public MessageResult<WechatMessageAdmin> delete(@PathVariable("id") String id){
+        MessageResult<WechatMessageAdmin> msgResult = new MessageResult<>();
+
+        try {
+            int affectCount = wechatMessageAdminService.delete(id);
+
+            if (affectCount > 0) {
+                msgResult.setResult(true);
+            } else {
+                msgResult.setResult(false);
+                msgResult.setMessage("数据库删除失败");
+            }
+        }
+        catch(Exception ex){
+            logger.error(ex.getMessage(),ex);
+
+            msgResult.setResult(false);
+            msgResult.setMessage(ex.getMessage());
+        }
+
+        return msgResult;
+    }
+
+
+    @ApiOperation(value="批量删除")
+    @PostMapping("batchDelete/{id}")
+    public MessageResult<WechatMessageAdmin> batchDelete(@PathVariable("id") String id){
+        MessageResult<WechatMessageAdmin> msgResult = new MessageResult<>();
+
+        msgResult.setResult(false);
+        msgResult.setMessage("未实现");
+
+        return msgResult;
+    }
+
+    @ApiOperation(value="列表")
+    @RequestMapping(value = "list",method = RequestMethod.POST)
+    public MessageResult<Map> list(
+            String wechatMessageId,
+            @RequestParam(value="draw",defaultValue="1") int draw,
+            @RequestParam(value="start",defaultValue="1") int start,
+            @RequestParam(value="length",defaultValue="20") int length,
+            HttpServletRequest request){
+        String subject = (String)request.getAttribute("subject");
+
+        //当前用户ID
+        System.out.println(subject);
+
+        MessageResult<Map> msgResult = new MessageResult<>();
+
+        Map<String,Object> searchParms = new HashMap<>();
+
+        List<Sort> sortList = new ArrayList<>();
+        sortList.add(new Sort("id_","asc"));
+
+        searchParms.put("wechatMessageId",wechatMessageId);
+
+        int pageNum = start / length;
+
+        pageNum++;
+
+        int pageSize = length;
+
+        Page<WechatMessageAdmin> page = wechatMessageAdminService.pageSearch(searchParms,pageNum,pageSize,sortList);
+
+        for (WechatMessageAdmin item:page){
+            String id = item.getAdminId();
+            List<AdminRole> adminRoleList = adminRoleService.listByAdminId(id);
+            item.getAdmin().setAdminRoleList(adminRoleList);
+        }
+
+        msgResult.setResult(true);
+        msgResult.setData(PojoUtils.pageWrapper(page));
+
+        return msgResult;
+    }
+}

+ 273 - 0
src/main/java/com/jpsoft/ipcps/controller/WechatMessageController.java

@@ -0,0 +1,273 @@
+package com.jpsoft.ipcps.controller;
+
+import com.github.pagehelper.Page;
+import com.jpsoft.ipcps.common.PojoUtils;
+import com.jpsoft.ipcps.common.Sort;
+import com.jpsoft.ipcps.common.WechatUtils;
+import com.jpsoft.ipcps.dto.MessageResult;
+import com.jpsoft.ipcps.entity.*;
+import com.jpsoft.ipcps.service.JpAdminService;
+import com.jpsoft.ipcps.service.WechatMessageAdminService;
+import com.jpsoft.ipcps.service.WechatMessageService;
+import io.swagger.annotations.ApiOperation;
+import org.apache.commons.lang3.StringUtils;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+
+import javax.servlet.http.HttpServletRequest;
+import java.util.*;
+
+@RestController
+@RequestMapping("/wechatMessage")
+public class WechatMessageController {
+    private Logger logger = LoggerFactory.getLogger(getClass());
+    @Autowired
+    private JpAdminService jpAdminService;
+
+    @Autowired
+    private WechatMessageService wechatMessageService;
+
+    @Autowired
+    private WechatMessageAdminService wechatMessageAdminService;
+
+    @ApiOperation(value="添加信息")
+    @PostMapping("add")
+    public MessageResult<WechatMessage> add(@ModelAttribute WechatMessage wechatMessage){
+        MessageResult<WechatMessage> msgResult = new MessageResult<>();
+
+        try {
+            wechatMessage.setId(UUID.randomUUID().toString());
+
+            int count = wechatMessageService.insert(wechatMessage);
+
+            if (count>0) {
+                msgResult.setResult(true);
+                msgResult.setData(wechatMessage);
+            } else {
+                msgResult.setResult(false);
+                msgResult.setMessage("数据库添加失败");
+            }
+        }
+        catch(Exception ex){
+            logger.error(ex.getMessage(),ex);
+
+            msgResult.setResult(false);
+            msgResult.setMessage(ex.getMessage());
+        }
+
+        return msgResult;
+    }
+
+    @ApiOperation(value="获取信息")
+    @GetMapping("detail/{id}")
+    public MessageResult<WechatMessage> detail(@PathVariable("id") String id){
+        MessageResult<WechatMessage> msgResult = new MessageResult<>();
+
+        try {
+            WechatMessage wechatMessage = wechatMessageService.get(id);
+
+            if (wechatMessage != null) {
+                msgResult.setResult(true);
+                msgResult.setData(wechatMessage);
+            } else {
+                msgResult.setResult(false);
+                msgResult.setMessage("数据库不存在该记录!");
+            }
+        }
+        catch(Exception ex){
+            logger.error(ex.getMessage(),ex);
+
+            msgResult.setResult(false);
+            msgResult.setMessage(ex.getMessage());
+        }
+
+        return msgResult;
+    }
+
+    @ApiOperation(value="更新用户")
+    @PostMapping("update")
+    public MessageResult<WechatMessage> update(@ModelAttribute WechatMessage wechatMessage){
+        MessageResult<WechatMessage> msgResult = new MessageResult<>();
+
+        try {
+            int affectCount = wechatMessageService.update(wechatMessage);
+
+            if (affectCount > 0) {
+                msgResult.setResult(true);
+                msgResult.setData(wechatMessage);
+            } else {
+                msgResult.setResult(false);
+                msgResult.setMessage("数据库更新失败");
+            }
+        }
+        catch(Exception ex){
+            logger.error(ex.getMessage(),ex);
+
+            msgResult.setResult(false);
+            msgResult.setMessage(ex.getMessage());
+        }
+
+        return msgResult;
+    }
+
+    @ApiOperation(value="删除用户")
+    @PostMapping("delete/{id}")
+    public MessageResult<WechatMessage> delete(@PathVariable("id") String id){
+        MessageResult<WechatMessage> msgResult = new MessageResult<>();
+
+        try {
+            int affectCount = wechatMessageService.delete(id);
+
+            if (affectCount > 0) {
+                msgResult.setResult(true);
+            } else {
+                msgResult.setResult(false);
+                msgResult.setMessage("数据库删除失败");
+            }
+        }
+        catch(Exception ex){
+            logger.error(ex.getMessage(),ex);
+
+            msgResult.setResult(false);
+            msgResult.setMessage(ex.getMessage());
+        }
+
+        return msgResult;
+    }
+
+
+    @ApiOperation(value="批量删除")
+    @PostMapping("batchDelete/{id}")
+    public MessageResult<WechatMessage> batchDelete(@PathVariable("id") String id){
+        MessageResult<WechatMessage> msgResult = new MessageResult<>();
+
+        msgResult.setResult(false);
+        msgResult.setMessage("未实现");
+
+        return msgResult;
+    }
+
+    @ApiOperation(value="列表")
+    @RequestMapping(value = "list",method = RequestMethod.POST)
+    public MessageResult<Map> list(
+            String title,
+            @RequestParam(value="draw",defaultValue="1") int draw,
+            @RequestParam(value="start",defaultValue="1") int start,
+            @RequestParam(value="length",defaultValue="20") int length,
+            HttpServletRequest request){
+
+        MessageResult<Map> msgResult = new MessageResult<>();
+
+        Map<String,Object> searchParms = new HashMap<>();
+
+        List<Sort> sortList = new ArrayList<>();
+        sortList.add(new Sort("id_","asc"));
+
+        if (StringUtils.isNotEmpty(title)) {
+            searchParms.put("title","%" + title + "%");
+        }
+
+        int pageNum = start / length;
+
+        pageNum++;
+
+        int pageSize = length;
+
+        Page<WechatMessage> page = wechatMessageService.pageSearch(searchParms,pageNum,pageSize,sortList);
+
+        msgResult.setResult(true);
+        msgResult.setData(PojoUtils.pageWrapper(page));
+
+        return msgResult;
+    }
+
+    @ApiOperation(value="发送微信消息")
+    @PostMapping("sendMessage")
+    public MessageResult<Map> sendMessage(String openIds,String title,String content,HttpServletRequest request){
+        String subject = (String)request.getAttribute("subject");
+        MessageResult<Map> msgResult = new MessageResult<>();
+        ResourceBundle rb = ResourceBundle.getBundle("server");
+        String appId = rb.getString("appId");
+        String appSecret = rb.getString("appSecret");
+        boolean flag = false;
+        try{
+            String[] openIdArray = openIds.split(",");
+            for (String openId:openIdArray) {
+                send_template_message(appId,appSecret,openId,title,content);
+            }
+
+            JpAdmin admin = jpAdminService.get(subject);
+
+            WechatMessage wechatMessage = new WechatMessage();
+            String id = UUID.randomUUID().toString();
+            wechatMessage.setId(id);
+            wechatMessage.setTitle(title);
+            wechatMessage.setContent(content);
+            wechatMessage.setCreateBy(admin.getId());
+            wechatMessage.setCreateDate(new Date());
+
+            wechatMessageService.insertAndChild(wechatMessage,openIdArray);
+
+            flag = true;
+        }
+        catch (Exception e){
+
+        }
+
+        msgResult.setResult(flag);
+        return msgResult;
+    }
+
+
+
+
+
+    /**
+     * 发送模板消息
+     * appId 公众账号的唯一标识
+     * appSecret 公众账号的密钥
+     * openId 用户标识
+     */
+    public void send_template_message(String appId, String appSecret, String openId,String title,String content) {
+        ResourceBundle rb = ResourceBundle.getBundle("server");
+        String templateId = rb.getString("templateId");
+
+        AccessToken token = WechatUtils.getAccessToken(appId, appSecret);
+        String access_token = token.getToken();
+        String url = "https://api.weixin.qq.com/cgi-bin/message/template/send?access_token="+access_token;
+        WxTemplate temp = new WxTemplate();
+        temp.setUrl("http://weixin.qq.com/download");
+        temp.setTouser(openId);
+        temp.setTopcolor("#000000");
+//        temp.setTemplate_id("ngqIpbwh8bUfcSsECmogfXcV14J0tQlEpBO27izEYtY");
+        temp.setTemplate_id(templateId);
+        Map<String,TemplateData> m = new HashMap<String,TemplateData>();
+        TemplateData first = new TemplateData();
+        first.setColor("#000000");
+        first.setValue(title);
+        m.put("first", first);
+        TemplateData message = new TemplateData();
+        message.setColor("#000000");
+        message.setValue(content);
+        m.put("message", message);
+
+        TemplateData remark = new TemplateData();
+        remark.setColor("#000000");
+        remark.setValue("备注说明");
+        m.put("remark", remark);
+        temp.setData(m);
+        String jsonString = net.sf.json.JSONObject.fromObject(temp).toString();
+        net.sf.json.JSONObject jsonObject = WechatUtils.httpRequest(url, "POST", jsonString);
+        System.out.println(jsonObject);
+        int result = 0;
+        if (null != jsonObject) {
+            if (0 != jsonObject.getInt("errcode")) {
+                result = jsonObject.getInt("errcode");
+                logger.error("错误 errcode:{} errmsg:{}", jsonObject.getInt("errcode"), jsonObject.getString("errmsg"));
+            }
+        }
+        logger.info("模板消息发送结果:"+result);
+    }
+}

+ 23 - 0
src/main/java/com/jpsoft/ipcps/dao/AdminRoleDAO.java

@@ -0,0 +1,23 @@
+package com.jpsoft.ipcps.dao;
+
+import java.util.List;
+
+import org.apache.ibatis.annotations.Param;
+import org.springframework.stereotype.Repository;
+import com.jpsoft.ipcps.entity.AdminRole;
+import java.util.Map;
+import com.jpsoft.ipcps.common.Sort;
+
+@Repository
+public interface AdminRoleDAO {
+	int insert(AdminRole entity);
+	int update(AdminRole entity);
+	int exist(String id);
+	AdminRole get(String id);
+	int delete(String id);
+	int findCountByAIdAndRName(String adminId,String roleName);
+	AdminRole findByAIdAndRId(@Param("adminId")String adminId, @Param("roleId")String roleId);
+	List<AdminRole> list();
+	List<AdminRole> listByAdminId(String adminId);
+	List<AdminRole> search(Map<String, Object> searchParams, List<Sort> sortList);
+}

+ 23 - 0
src/main/java/com/jpsoft/ipcps/dao/DepartmentDAO.java

@@ -0,0 +1,23 @@
+package com.jpsoft.ipcps.dao;
+
+import java.util.List;
+
+import org.apache.ibatis.annotations.Param;
+import org.springframework.stereotype.Repository;
+import com.jpsoft.ipcps.entity.Department;
+import java.util.Map;
+import com.jpsoft.ipcps.common.Sort;
+
+@Repository
+public interface DepartmentDAO {
+	int insert(Department entity);
+	int update(Department entity);
+	int exist(String id);
+	Department get(String id);
+	int delete(String id);
+	List<Department> list();
+	List<Department> search(Map<String, Object> searchParams, List<Sort> sortList);
+
+    List<Department> findByParkId(@Param("parkId") String parkId);
+	int deleteByParkId(@Param("parkId") String parkId);
+}

+ 30 - 0
src/main/java/com/jpsoft/ipcps/dao/JpAdminDAO.java

@@ -0,0 +1,30 @@
+package com.jpsoft.ipcps.dao;
+
+import java.util.List;
+
+import com.github.pagehelper.Page;
+import org.apache.ibatis.annotations.Param;
+import org.springframework.stereotype.Repository;
+import com.jpsoft.ipcps.entity.JpAdmin;
+import java.util.Map;
+import com.jpsoft.ipcps.common.Sort;
+
+@Repository
+public interface JpAdminDAO {
+	int insert(JpAdmin entity);
+	int update(JpAdmin entity);
+	int exist(String id);
+	JpAdmin get(String id);
+	int delete(String id);
+	int getUserByName(String userName);
+	JpAdmin getUserByOpenId(@Param("openId")String openId);
+	int findByRoleIds(String roleIds);
+	int findByOrgIds(String orgIds);
+	JpAdmin getUser(@Param("userName")String userName,@Param("password")String password);
+	List<JpAdmin> list();
+	Page<Map> findByName(@Param("userName") String userName);
+	List<JpAdmin> search(@Param("searchParams") Map<String, Object> searchParams, @Param("sortList")List<Sort> sortList);
+	List<Map> selectUser(@Param("searchParams") Map<String, Object> searchParams);
+    List<JpAdmin> findUserByRoleId(@Param("roleId") String roleId);
+    List<JpAdmin> findUserByOrgId(@Param("orgId") String orgId);
+}

+ 23 - 0
src/main/java/com/jpsoft/ipcps/dao/MenuDAO.java

@@ -0,0 +1,23 @@
+package com.jpsoft.ipcps.dao;
+
+import java.util.List;
+
+import com.jpsoft.ipcps.common.Sort;
+import org.apache.ibatis.annotations.Param;
+import org.springframework.stereotype.Repository;
+import com.jpsoft.ipcps.entity.Menu;
+import java.util.Map;
+
+@Repository
+public interface MenuDAO {
+	int insert(Menu entity);
+	int update(Menu entity);
+	int exist(String id);
+	Menu get(String id);
+	int delete(String id);
+	List<Menu> list();
+	List<Menu> search(Map<String, Object> searchParams, List<Sort> sortList);
+    List<Menu> findAllocMenu(@Param("userId") String userId, @Param("parentId") String parentId);
+    int countByUrlAndMethod(@Param("url")String url, @Param("method")String method);
+	int hasPermitted(String userId, String url, String method);
+}

+ 20 - 0
src/main/java/com/jpsoft/ipcps/dao/MessagesDAO.java

@@ -0,0 +1,20 @@
+package com.jpsoft.ipcps.dao;
+
+import java.util.List;
+
+import org.apache.ibatis.annotations.Param;
+import org.springframework.stereotype.Repository;
+import com.jpsoft.ipcps.entity.Messages;
+import java.util.Map;
+import com.jpsoft.ipcps.common.Sort;
+
+@Repository
+public interface MessagesDAO {
+	int insert(Messages entity);
+	int update(Messages entity);
+	int exist(String id);
+	Messages get(String id);
+	int delete(String id);
+	List<Messages> list();
+	List<Messages> search(@Param("searchParams")Map<String, Object> searchParams, @Param("sortList")List<Sort> sortList);
+}

+ 20 - 0
src/main/java/com/jpsoft/ipcps/dao/MonthPlanDAO.java

@@ -0,0 +1,20 @@
+package com.jpsoft.ipcps.dao;
+
+import java.util.List;
+import org.springframework.stereotype.Repository;
+import com.jpsoft.ipcps.entity.MonthPlan;
+import java.util.Map;
+import com.jpsoft.ipcps.common.Sort;
+
+@Repository
+public interface MonthPlanDAO {
+	int insert(MonthPlan entity);
+	int update(MonthPlan entity);
+	int exist(String id);
+	MonthPlan get(String id);
+	int delete(String id);
+	List<MonthPlan> list();
+	List<MonthPlan> search(Map<String, Object> searchParams, List<Sort> sortList);
+
+    List<MonthPlan> findByProjectId(String projectId);
+}

+ 19 - 0
src/main/java/com/jpsoft/ipcps/dao/MonthPlanMatterDAO.java

@@ -0,0 +1,19 @@
+package com.jpsoft.ipcps.dao;
+
+import java.util.List;
+import org.springframework.stereotype.Repository;
+import com.jpsoft.ipcps.entity.MonthPlanMatter;
+import java.util.Map;
+import com.jpsoft.ipcps.common.Sort;
+
+@Repository
+public interface MonthPlanMatterDAO {
+	int insert(MonthPlanMatter entity);
+	int update(MonthPlanMatter entity);
+	int exist(String id);
+	MonthPlanMatter get(String id);
+	int delete(String id);
+	List<MonthPlanMatter> list();
+	List<MonthPlanMatter> search(Map<String, Object> searchParams, List<Sort> sortList);
+    List<MonthPlanMatter> findByPlanId(String planId);
+}

+ 22 - 0
src/main/java/com/jpsoft/ipcps/dao/OrgDAO.java

@@ -0,0 +1,22 @@
+package com.jpsoft.ipcps.dao;
+
+import java.util.List;
+
+import org.apache.ibatis.annotations.Param;
+import org.springframework.stereotype.Repository;
+import com.jpsoft.ipcps.entity.Org;
+import java.util.Map;
+import com.jpsoft.ipcps.common.Sort;
+
+@Repository
+public interface OrgDAO {
+	int insert(Org entity);
+	int update(Org entity);
+	int exist(String id);
+	Org get(String id);
+	int delete(String id);
+	List<Org> list();
+	List<Org> listByOrder();
+	Org getByOrder(int orgOrder);
+	List<Org> search(@Param("searchParams")Map<String, Object> searchParams, @Param("sortList")List<Sort> sortList);
+}

+ 21 - 0
src/main/java/com/jpsoft/ipcps/dao/ParkAdminDAO.java

@@ -0,0 +1,21 @@
+package com.jpsoft.ipcps.dao;
+
+import java.util.List;
+import org.springframework.stereotype.Repository;
+import com.jpsoft.ipcps.entity.ParkAdmin;
+import java.util.Map;
+import com.jpsoft.ipcps.common.Sort;
+
+@Repository
+public interface ParkAdminDAO {
+	int insert(ParkAdmin entity);
+	int update(ParkAdmin entity);
+	int exist(String id);
+	ParkAdmin get(String id);
+	int delete(String id);
+	List<ParkAdmin> list();
+	List<ParkAdmin> search(Map<String, Object> searchParams, List<Sort> sortList);
+	List<ParkAdmin> findParkAdminByParkId(String parkId);
+
+    int deleteByParkId(String parkId);
+}

+ 18 - 0
src/main/java/com/jpsoft/ipcps/dao/ParkDAO.java

@@ -0,0 +1,18 @@
+package com.jpsoft.ipcps.dao;
+
+import java.util.List;
+import org.springframework.stereotype.Repository;
+import com.jpsoft.ipcps.entity.Park;
+import java.util.Map;
+import com.jpsoft.ipcps.common.Sort;
+
+@Repository
+public interface ParkDAO {
+	int insert(Park entity);
+	int update(Park entity);
+	int exist(String id);
+	Park get(String id);
+	int delete(String id);
+	List<Park> list();
+	List<Park> search(Map<String, Object> searchParams, List<Sort> sortList);
+}

+ 25 - 0
src/main/java/com/jpsoft/ipcps/dao/ParkOrgDAO.java

@@ -0,0 +1,25 @@
+package com.jpsoft.ipcps.dao;
+
+import java.util.List;
+
+import com.jpsoft.ipcps.common.Sort;
+import com.jpsoft.ipcps.entity.Org;
+import org.springframework.stereotype.Repository;
+import com.jpsoft.ipcps.entity.ParkOrg;
+import java.util.Map;
+
+@Repository
+public interface ParkOrgDAO {
+	int insert(ParkOrg entity);
+	int update(ParkOrg entity);
+	int exist(String id);
+	ParkOrg get(String id);
+	int delete(String id);
+	List<ParkOrg> list();
+	List<ParkOrg> search(Map<String,Object> searchParams,List<Sort> sortList);
+
+	List<ParkOrg> findParkOrgByParkId(String parkId);
+	List<Org> findOrgByParkId(String parkId);
+
+	int deleteByParkId(String parkId);
+}

+ 26 - 0
src/main/java/com/jpsoft/ipcps/dao/ProcDefStepAssigneeDAO.java

@@ -0,0 +1,26 @@
+package com.jpsoft.ipcps.dao;
+
+import java.util.List;
+import org.springframework.stereotype.Repository;
+import com.jpsoft.ipcps.entity.ProcDefStepAssignee;
+import java.util.Map;
+import com.jpsoft.ipcps.common.Sort;
+
+@Repository
+public interface ProcDefStepAssigneeDAO {
+	int insert(ProcDefStepAssignee entity);
+	int update(ProcDefStepAssignee entity);
+	int exist(String id);
+	ProcDefStepAssignee get(String id);
+	int delete(String id);
+	List<ProcDefStepAssignee> list();
+	List<ProcDefStepAssignee> search(Map<String,Object> searchParams,List<Sort> sortList);
+
+	List<Map> findUserByStepId(String stepId);
+	List<Map> findRoleByStepId(String stepId);
+
+	int deleteByStepId(String stepId);
+
+    List<ProcDefStepAssignee> findByTemplateId(String templateId);
+
+}

+ 25 - 0
src/main/java/com/jpsoft/ipcps/dao/ProcDefStepNoticeDAO.java

@@ -0,0 +1,25 @@
+package com.jpsoft.ipcps.dao;
+
+import java.util.List;
+import org.springframework.stereotype.Repository;
+import com.jpsoft.ipcps.entity.ProcDefStepNotice;
+import java.util.Map;
+import com.jpsoft.ipcps.common.Sort;
+
+@Repository
+public interface ProcDefStepNoticeDAO {
+	int insert(ProcDefStepNotice entity);
+	int update(ProcDefStepNotice entity);
+	int exist(String id);
+	ProcDefStepNotice get(String id);
+	int delete(String id);
+	List<ProcDefStepNotice> list();
+	List<ProcDefStepNotice> search(Map<String,Object> searchParams,List<Sort> sortList);
+
+    List<Map> findUserByStepId(String stepId);
+	List<Map> findRoleByStepId(String stepId);
+
+	int deleteByStepId(String stepId);
+
+    List<ProcDefStepNotice> findByTemplateId(String templateId);
+}

+ 21 - 0
src/main/java/com/jpsoft/ipcps/dao/ProcDefStepToDoDAO.java

@@ -0,0 +1,21 @@
+package com.jpsoft.ipcps.dao;
+
+import java.util.List;
+import org.springframework.stereotype.Repository;
+import com.jpsoft.ipcps.entity.ProcDefStepToDo;
+import java.util.Map;
+import com.jpsoft.ipcps.common.Sort;
+
+@Repository
+public interface ProcDefStepToDoDAO {
+	int insert(ProcDefStepToDo entity);
+	int update(ProcDefStepToDo entity);
+	int exist(String id);
+	ProcDefStepToDo get(String id);
+	int delete(String id);
+	List<ProcDefStepToDo> list();
+	List<ProcDefStepToDo> search(Map<String,Object> searchParams,List<Sort> sortList);
+    List<ProcDefStepToDo> findByStepId(String stepId);
+
+    List<ProcDefStepToDo> findByTemplateId(String templateId);
+}

+ 21 - 0
src/main/java/com/jpsoft/ipcps/dao/ProcDefTemplateDAO.java

@@ -0,0 +1,21 @@
+package com.jpsoft.ipcps.dao;
+
+import java.util.List;
+import org.springframework.stereotype.Repository;
+import com.jpsoft.ipcps.entity.ProcDefTemplate;
+import java.util.Map;
+import com.jpsoft.ipcps.common.Sort;
+
+@Repository
+public interface ProcDefTemplateDAO {
+	int insert(ProcDefTemplate entity);
+	int update(ProcDefTemplate entity);
+	int exist(String id);
+	ProcDefTemplate get(String id);
+	int delete(String id);
+	List<ProcDefTemplate> list();
+	List<ProcDefTemplate> search(Map<String,Object> searchParams,List<Sort> sortList);
+    int setDefault(String procDefKey,String templateId);
+
+    List<ProcDefTemplate> findByProcDefKey(String key);
+}

+ 24 - 0
src/main/java/com/jpsoft/ipcps/dao/ProcDefTemplateStepDAO.java

@@ -0,0 +1,24 @@
+package com.jpsoft.ipcps.dao;
+
+import java.util.List;
+
+import org.apache.ibatis.annotations.Param;
+import org.springframework.stereotype.Repository;
+import com.jpsoft.ipcps.entity.ProcDefTemplateStep;
+import java.util.Map;
+import com.jpsoft.ipcps.common.Sort;
+
+@Repository
+public interface ProcDefTemplateStepDAO {
+	int insert(ProcDefTemplateStep entity);
+	int update(ProcDefTemplateStep entity);
+	int exist(String id);
+	ProcDefTemplateStep get(String id);
+	int delete(String id);
+	List<ProcDefTemplateStep> list();
+	List<ProcDefTemplateStep> search(Map<String,Object> searchParams,List<Sort> sortList);
+    ProcDefTemplateStep findByTemplateIdAndTaskDefKey(@Param("templateId")String templateId, @Param("taskDefKey")String taskDefKey);
+    List<ProcDefTemplateStep> findByTemplateId(String templateId);
+
+	int existByTemplateIdAndTaskDefKey(String templateId, String taskDefKey);
+}

+ 9 - 0
src/main/java/com/jpsoft/ipcps/dao/ProcInstDAO.java

@@ -0,0 +1,9 @@
+package com.jpsoft.ipcps.dao;
+
+import com.jpsoft.ipcps.common.Sort;
+import java.util.List;
+import java.util.Map;
+
+public interface ProcInstDAO {
+    List<Map> search(Map<String, Object> searchParams, List<Sort> sortList);
+}

+ 21 - 0
src/main/java/com/jpsoft/ipcps/dao/ProcInstStepDAO.java

@@ -0,0 +1,21 @@
+package com.jpsoft.ipcps.dao;
+
+import java.util.List;
+import org.springframework.stereotype.Repository;
+import com.jpsoft.ipcps.entity.ProcInstStep;
+import java.util.Map;
+import com.jpsoft.ipcps.common.Sort;
+
+@Repository
+public interface ProcInstStepDAO {
+	int insert(ProcInstStep entity);
+	int update(ProcInstStep entity);
+	int exist(String id);
+	ProcInstStep get(String id);
+	int delete(String id);
+	List<ProcInstStep> list();
+	List<ProcInstStep> search(Map<String,Object> searchParams,List<Sort> sortList);
+    ProcInstStep findByProjectIdAndKey(String projectId,String procDefKey, String taskDefKey);
+	int updateProcInstId(String projectId, String procDefKey, String procInstId);
+	List<ProcInstStep> findByProjectIdAndProcDefKey(String projectId, String procDefKey);
+}

+ 20 - 0
src/main/java/com/jpsoft/ipcps/dao/ProcInstTemplateDAO.java

@@ -0,0 +1,20 @@
+package com.jpsoft.ipcps.dao;
+
+import java.util.List;
+import org.springframework.stereotype.Repository;
+import com.jpsoft.ipcps.entity.ProcInstTemplate;
+import java.util.Map;
+import com.jpsoft.ipcps.common.Sort;
+
+@Repository
+public interface ProcInstTemplateDAO {
+	int insert(ProcInstTemplate entity);
+	int update(ProcInstTemplate entity);
+	int exist(String id);
+	ProcInstTemplate get(String id);
+	int delete(String id);
+	List<ProcInstTemplate> list();
+	List<ProcInstTemplate> search(Map<String,Object> searchParams,List<Sort> sortList);
+	int setProcessInstanceStarter(String procInstId,String userId);
+	List<ProcInstTemplate> findByProjectId(String projectId);
+}

+ 30 - 0
src/main/java/com/jpsoft/ipcps/dao/ProcInstToDoDAO.java

@@ -0,0 +1,30 @@
+package com.jpsoft.ipcps.dao;
+
+import java.util.Date;
+import java.util.List;
+import org.springframework.stereotype.Repository;
+import com.jpsoft.ipcps.entity.ProcInstToDo;
+import java.util.Map;
+import com.jpsoft.ipcps.common.Sort;
+
+@Repository
+public interface ProcInstToDoDAO {
+	int insert(ProcInstToDo entity);
+	int update(ProcInstToDo entity);
+	int exist(String id);
+	ProcInstToDo get(String id);
+	int delete(String id);
+	List<ProcInstToDo> list();
+	List<ProcInstToDo> search(Map<String,Object> searchParams,List<Sort> sortList);
+    List<Map> findByProcInstIdAndTaskDefKey(String procInstId, String taskDefKey);
+
+	int updateCheckedFlag(String id, int checkedFlag, Date updateDate);
+
+    List<Map> doneList(String templateId, String taskDefKey,String procInstId,String taskId);
+
+	List<ProcInstToDo> findDoneListByProjectIdAndCreateDate(String projectId, String year, String month);
+
+    List<Map> findByProcInstIdAndTaskId(String procInstId, String taskId);
+
+    int updateTaskId(String processInstanceId, String lastTaskId, String taskId);
+}

+ 34 - 0
src/main/java/com/jpsoft/ipcps/dao/ProjectDAO.java

@@ -0,0 +1,34 @@
+package com.jpsoft.ipcps.dao;
+
+import java.util.List;
+
+import org.apache.ibatis.annotations.Param;
+import org.springframework.stereotype.Repository;
+import com.jpsoft.ipcps.entity.Project;
+import java.util.Map;
+import com.jpsoft.ipcps.common.Sort;
+
+@Repository
+public interface ProjectDAO {
+	int insert(Project entity);
+	int update(Project entity);
+	int exist(String id);
+	Project get(String id);
+	int delete(String id);
+	List<Project> list();
+	int getProjectByStatus(String status);
+	int getProjectByStatusANDLAIdANDKey(@Param("status")String status,@Param("userType")String userType,@Param("leaderAdminId")String leaderAdminId,@Param("procDefKey")String procDefKey);
+	List<Map<String, Object>> groupByParkId();
+	List<Map<String, Object>> groupByStatus(String parkId);
+	List<Project> search(@Param("searchParams") Map<String, Object> searchParams, @Param("sortList")List<Sort> sortList);
+	List<String> listAdminId();
+
+	/**
+	 * 单表查询
+	 * @param searchParams
+	 * @param sortList
+	 * @return
+	 */
+	List<Project> search2(@Param("searchParams") Map<String, Object> searchParams, @Param("sortList")List<Sort> sortList);
+	List<Project> listForTimeNode(int timeNode, String year, String month);
+}

+ 18 - 0
src/main/java/com/jpsoft/ipcps/dao/ProjectErrorDAO.java

@@ -0,0 +1,18 @@
+package com.jpsoft.ipcps.dao;
+
+import java.util.List;
+import org.springframework.stereotype.Repository;
+import com.jpsoft.ipcps.entity.ProjectError;
+import java.util.Map;
+import com.jpsoft.ipcps.common.Sort;
+
+@Repository
+public interface ProjectErrorDAO {
+	int insert(ProjectError entity);
+	int update(ProjectError entity);
+	int exist(String id);
+	ProjectError get(String id);
+	int delete(String id);
+	List<ProjectError> list();
+	List<ProjectError> search(Map<String, Object> searchParams, List<Sort> sortList);
+}

+ 21 - 0
src/main/java/com/jpsoft/ipcps/dao/ProjectFileDAO.java

@@ -0,0 +1,21 @@
+package com.jpsoft.ipcps.dao;
+
+import java.util.List;
+
+import org.apache.ibatis.annotations.Param;
+import org.springframework.stereotype.Repository;
+import com.jpsoft.ipcps.entity.ProjectFile;
+import java.util.Map;
+import com.jpsoft.ipcps.common.Sort;
+
+@Repository
+public interface ProjectFileDAO {
+	int insert(ProjectFile entity);
+	int update(ProjectFile entity);
+	int exist(String id);
+	ProjectFile get(String id);
+	int delete(String id);
+	List<ProjectFile> findByPictureId(@Param("pictureId")String pictureId);
+	List<ProjectFile> list(@Param("searchParams") Map<String, Object> searchParams);
+	List<ProjectFile> search(@Param("searchParams") Map<String, Object> searchParams, @Param("sortList")List<Sort> sortList);
+}

+ 18 - 0
src/main/java/com/jpsoft/ipcps/dao/ProjectImagesDAO.java

@@ -0,0 +1,18 @@
+package com.jpsoft.ipcps.dao;
+
+import java.util.List;
+import org.springframework.stereotype.Repository;
+import com.jpsoft.ipcps.entity.ProjectImages;
+import java.util.Map;
+import com.jpsoft.ipcps.common.Sort;
+
+@Repository
+public interface ProjectImagesDAO {
+	int insert(ProjectImages entity);
+	int update(ProjectImages entity);
+	int exist(String id);
+	ProjectImages get(String id);
+	int delete(String id);
+	List<ProjectImages> list();
+	List<ProjectImages> search(Map<String, Object> searchParams, List<Sort> sortList);
+}

+ 21 - 0
src/main/java/com/jpsoft/ipcps/dao/ProjectPictureDAO.java

@@ -0,0 +1,21 @@
+package com.jpsoft.ipcps.dao;
+
+import java.util.List;
+
+import com.jpsoft.ipcps.entity.ProjectFile;
+import org.apache.ibatis.annotations.Param;
+import org.springframework.stereotype.Repository;
+import com.jpsoft.ipcps.entity.ProjectPicture;
+import java.util.Map;
+import com.jpsoft.ipcps.common.Sort;
+
+@Repository
+public interface ProjectPictureDAO {
+	int insert(ProjectPicture entity);
+	int update(ProjectPicture entity);
+	int exist(String id);
+	ProjectPicture get(String id);
+	int delete(String id);
+	List<ProjectPicture> list();
+	List<ProjectPicture> search(@Param("searchParams") Map<String, Object> searchParams, @Param("sortList")List<Sort> sortList);
+}

+ 18 - 0
src/main/java/com/jpsoft/ipcps/dao/ProjectQuestionDAO.java

@@ -0,0 +1,18 @@
+package com.jpsoft.ipcps.dao;
+
+import java.util.List;
+import org.springframework.stereotype.Repository;
+import com.jpsoft.ipcps.entity.ProjectQuestion;
+import java.util.Map;
+import com.jpsoft.ipcps.common.Sort;
+
+@Repository
+public interface ProjectQuestionDAO {
+	int insert(ProjectQuestion entity);
+	int update(ProjectQuestion entity);
+	int exist(String id);
+	ProjectQuestion get(String id);
+	int delete(String id);
+	List<ProjectQuestion> list();
+	List<ProjectQuestion> search(Map<String, Object> searchParams, List<Sort> sortList);
+}

+ 18 - 0
src/main/java/com/jpsoft/ipcps/dao/ProjectReplyDAO.java

@@ -0,0 +1,18 @@
+package com.jpsoft.ipcps.dao;
+
+import java.util.List;
+import org.springframework.stereotype.Repository;
+import com.jpsoft.ipcps.entity.ProjectReply;
+import java.util.Map;
+import com.jpsoft.ipcps.common.Sort;
+
+@Repository
+public interface ProjectReplyDAO {
+	int insert(ProjectReply entity);
+	int update(ProjectReply entity);
+	int exist(String id);
+	ProjectReply get(String id);
+	int delete(String id);
+	List<ProjectReply> list();
+	List<ProjectReply> search(Map<String, Object> searchParams, List<Sort> sortList);
+}

+ 23 - 0
src/main/java/com/jpsoft/ipcps/dao/ProjectTaskDAO.java

@@ -0,0 +1,23 @@
+package com.jpsoft.ipcps.dao;
+
+import com.jpsoft.ipcps.common.Sort;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.Date;
+import java.util.List;
+import java.util.Map;
+
+public interface ProjectTaskDAO {
+    List<Map> taskList(@Param("searchParams")Map<String,Object> searchParams,@Param("sortList")List<Sort> sortList);
+
+    List<Map> finishList(Map<String, Object> searchParams, List<Sort> sortList);
+
+    List<Map> warningList(@Param("searchParams")Map<String, Object> searchParams, @Param("sortList")List<Sort> sortList);
+
+    int countRunningProjectByOrgId(@Param("orgId") String orgId,@Param("parkId") String parkId,@Param("status") String status);
+    int countHistoryProjectByOrgId(@Param("orgId") String orgId);
+    int warningCountByProjectId(@Param("projectId") String projectId);
+    int updateHistoricTask(String taskId, Date startTime, Date dueDate, Date endTime);
+    List<Map> queryOtherProjectTask(Map<String, Object> searchParams, List<Sort> sortList);
+    int countRunningProjectByAdminId(@Param("adminId") String adminId,@Param("parkId") String parkId,@Param("status") String status);
+}

+ 21 - 0
src/main/java/com/jpsoft/ipcps/dao/ProjectWarningDAO.java

@@ -0,0 +1,21 @@
+package com.jpsoft.ipcps.dao;
+
+import java.util.List;
+
+import org.apache.ibatis.annotations.Param;
+import org.springframework.stereotype.Repository;
+import com.jpsoft.ipcps.entity.ProjectWarning;
+import java.util.Map;
+import com.jpsoft.ipcps.common.Sort;
+
+@Repository
+public interface ProjectWarningDAO {
+	int insert(ProjectWarning entity);
+	int update(ProjectWarning entity);
+	int exist(String id);
+	ProjectWarning get(String id);
+	int delete(String id);
+	List<Map> findByPIdAndProcInstIdAndTaskDefKey(@Param("projectId")String projectId,@Param("procInstId")String procInstId,@Param("taskDefKey")String taskDefKey);
+	List<ProjectWarning> list();
+	List<ProjectWarning> search(@Param("searchParams") Map<String, Object> searchParams, @Param("sortList")List<Sort> sortList);
+}

+ 22 - 0
src/main/java/com/jpsoft/ipcps/dao/RoleDAO.java

@@ -0,0 +1,22 @@
+package com.jpsoft.ipcps.dao;
+
+import java.util.List;
+
+import org.apache.ibatis.annotations.Param;
+import org.springframework.stereotype.Repository;
+import com.jpsoft.ipcps.entity.Role;
+import java.util.Map;
+import com.jpsoft.ipcps.common.Sort;
+
+@Repository
+public interface RoleDAO {
+	int insert(Role entity);
+	int update(Role entity);
+	int exist(String id);
+	Role get(String id);
+	int delete(String id);
+	List<Role> list();
+	List<Role> search(@Param("searchParams") Map<String, Object> searchParams, @Param("sortList")List<Sort> sortList);
+
+    List<Map> selectRole(@Param("searchParams") Map<String, Object> searchParams);
+}

+ 23 - 0
src/main/java/com/jpsoft/ipcps/dao/RoleMenuDAO.java

@@ -0,0 +1,23 @@
+package com.jpsoft.ipcps.dao;
+
+import java.util.List;
+
+import com.jpsoft.ipcps.common.Sort;
+import com.jpsoft.ipcps.entity.RoleMenu;
+import org.springframework.stereotype.Repository;
+import java.util.Map;
+
+@Repository
+public interface RoleMenuDAO {
+	int insert(RoleMenu entity);
+	int update(RoleMenu entity);
+	int exist(String id);
+	RoleMenu get(String id);
+	int delete(String id);
+	List<RoleMenu> list();
+	List<RoleMenu> search(Map<String, Object> searchParams, List<Sort> sortList);
+
+	List<RoleMenu> findByRoleId(String roleId);
+
+	int deleteByRoleId(String roleId);
+}

+ 20 - 0
src/main/java/com/jpsoft/ipcps/dao/WechatMessageAdminDAO.java

@@ -0,0 +1,20 @@
+package com.jpsoft.ipcps.dao;
+
+import java.util.List;
+
+import org.apache.ibatis.annotations.Param;
+import org.springframework.stereotype.Repository;
+import com.jpsoft.ipcps.entity.WechatMessageAdmin;
+import java.util.Map;
+import com.jpsoft.ipcps.common.Sort;
+
+@Repository
+public interface WechatMessageAdminDAO {
+	int insert(WechatMessageAdmin entity);
+	int update(WechatMessageAdmin entity);
+	int exist(String id);
+	WechatMessageAdmin get(String id);
+	int delete(String id);
+	List<WechatMessageAdmin> list();
+	List<WechatMessageAdmin> search(@Param("searchParams")Map<String, Object> searchParams, @Param("sortList")List<Sort> sortList);
+}

+ 20 - 0
src/main/java/com/jpsoft/ipcps/dao/WechatMessageDAO.java

@@ -0,0 +1,20 @@
+package com.jpsoft.ipcps.dao;
+
+import java.util.List;
+
+import org.apache.ibatis.annotations.Param;
+import org.springframework.stereotype.Repository;
+import com.jpsoft.ipcps.entity.WechatMessage;
+import java.util.Map;
+import com.jpsoft.ipcps.common.Sort;
+
+@Repository
+public interface WechatMessageDAO {
+	int insert(WechatMessage entity);
+	int update(WechatMessage entity);
+	int exist(String id);
+	WechatMessage get(String id);
+	int delete(String id);
+	List<WechatMessage> list();
+	List<WechatMessage> search(@Param("searchParams") Map<String, Object> searchParams, @Param("sortList")List<Sort> sortList);
+}

+ 51 - 0
src/main/java/com/jpsoft/ipcps/dto/MessageResult.java

@@ -0,0 +1,51 @@
+package com.jpsoft.ipcps.dto;
+
+import com.fasterxml.jackson.annotation.JsonFormat;
+
+public class MessageResult<T> {
+	private boolean result;
+	private String message;
+	private T data;
+	private String data2;
+	private int code;
+
+	public int getCode() {
+		return code;
+	}
+
+	public void setCode(int code) {
+		this.code = code;
+	}
+
+	public boolean isResult() {
+		return result;
+	}
+
+	public void setResult(boolean result) {
+		this.result = result;
+	}
+
+	public String getMessage() {
+		return message;
+	}
+
+	public void setMessage(String message) {
+		this.message = message;
+	}
+
+	public T getData() {
+		return data;
+	}
+
+	public void setData(T data) {
+		this.data = data;
+	}
+
+	public String getData2() {
+		return data2;
+	}
+
+	public void setData2(String data2) {
+		this.data2 = data2;
+	}
+}

+ 66 - 0
src/main/java/com/jpsoft/ipcps/dto/ProcDefStepDTO.java

@@ -0,0 +1,66 @@
+package com.jpsoft.ipcps.dto;
+
+import com.jpsoft.ipcps.entity.ProcDefStepAssignee;
+import com.jpsoft.ipcps.entity.ProcDefStepNotice;
+import com.jpsoft.ipcps.entity.ProcDefStepToDo;
+import com.jpsoft.ipcps.entity.ProcDefTemplateStep;
+import java.io.Serializable;
+import java.util.List;
+import java.util.Map;
+
+public class ProcDefStepDTO implements Serializable {
+    private ProcDefTemplateStep step;
+    private List<String> assigneeList;
+    private List<String> assigneeRoleList;
+    private List<String> noticeList;
+    private List<String> noticeRoleList;
+    private List<ProcDefStepToDo> todoList;
+
+    public ProcDefTemplateStep getStep() {
+        return step;
+    }
+
+    public void setStep(ProcDefTemplateStep step) {
+        this.step = step;
+    }
+
+    public List<ProcDefStepToDo> getTodoList() {
+        return todoList;
+    }
+
+    public void setTodoList(List<ProcDefStepToDo> todoList) {
+        this.todoList = todoList;
+    }
+
+    public List<String> getAssigneeList() {
+        return assigneeList;
+    }
+
+    public void setAssigneeList(List<String> assigneeList) {
+        this.assigneeList = assigneeList;
+    }
+
+    public List<String> getNoticeList() {
+        return noticeList;
+    }
+
+    public void setNoticeList(List<String> noticeList) {
+        this.noticeList = noticeList;
+    }
+
+    public List<String> getAssigneeRoleList() {
+        return assigneeRoleList;
+    }
+
+    public void setAssigneeRoleList(List<String> assigneeRoleList) {
+        this.assigneeRoleList = assigneeRoleList;
+    }
+
+    public List<String> getNoticeRoleList() {
+        return noticeRoleList;
+    }
+
+    public void setNoticeRoleList(List<String> noticeRoleList) {
+        this.noticeRoleList = noticeRoleList;
+    }
+}

+ 61 - 0
src/main/java/com/jpsoft/ipcps/dto/StartProcessDTO.java

@@ -0,0 +1,61 @@
+package com.jpsoft.ipcps.dto;
+
+import java.util.List;
+import java.util.Map;
+
+public class StartProcessDTO {
+    private String procDefKey;
+    private String projectId;
+    private String templateId;
+    private String templateId2;
+    private String templateId3;
+    public List<Map> stepList;
+
+    public String getProcDefKey() {
+        return procDefKey;
+    }
+
+    public void setProcDefKey(String procDefKey) {
+        this.procDefKey = procDefKey;
+    }
+
+    public String getProjectId() {
+        return projectId;
+    }
+
+    public void setProjectId(String projectId) {
+        this.projectId = projectId;
+    }
+
+    public List<Map> getStepList() {
+        return stepList;
+    }
+
+    public void setStepList(List<Map> stepList) {
+        this.stepList = stepList;
+    }
+
+    public String getTemplateId() {
+        return templateId;
+    }
+
+    public void setTemplateId(String templateId) {
+        this.templateId = templateId;
+    }
+
+    public String getTemplateId2() {
+        return templateId2;
+    }
+
+    public void setTemplateId2(String templateId2) {
+        this.templateId2 = templateId2;
+    }
+
+    public String getTemplateId3() {
+        return templateId3;
+    }
+
+    public void setTemplateId3(String templateId3) {
+        this.templateId3 = templateId3;
+    }
+}

+ 80 - 0
src/main/java/com/jpsoft/ipcps/dto/TaskRequestDTO.java

@@ -0,0 +1,80 @@
+package com.jpsoft.ipcps.dto;
+
+import com.fasterxml.jackson.annotation.JsonFormat;
+import org.springframework.format.annotation.DateTimeFormat;
+
+import java.io.Serializable;
+import java.util.Date;
+import java.util.List;
+
+public class TaskRequestDTO implements Serializable {
+    private String taskId;
+    private String assignee;
+    private List<String> todoList;
+    private List<String> undoList;
+    private Date startTime;
+    private Date dueDate;
+    private Date endTime;
+
+    @JsonFormat(pattern ="yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
+    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    public Date getStartTime() {
+        return startTime;
+    }
+
+    public void setStartTime(Date startTime) {
+        this.startTime = startTime;
+    }
+
+    @JsonFormat(pattern ="yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
+    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    public Date getDueDate() {
+        return dueDate;
+    }
+
+    public void setDueDate(Date dueDate) {
+        this.dueDate = dueDate;
+    }
+
+    @JsonFormat(pattern ="yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
+    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    public Date getEndTime() {
+        return endTime;
+    }
+
+    public void setEndTime(Date endTime) {
+        this.endTime = endTime;
+    }
+
+    public String getTaskId() {
+        return taskId;
+    }
+
+    public void setTaskId(String taskId) {
+        this.taskId = taskId;
+    }
+
+    public List<String> getTodoList() {
+        return todoList;
+    }
+
+    public void setTodoList(List<String> todoList) {
+        this.todoList = todoList;
+    }
+
+    public String getAssignee() {
+        return assignee;
+    }
+
+    public void setAssignee(String assignee) {
+        this.assignee = assignee;
+    }
+
+    public List<String> getUndoList() {
+        return undoList;
+    }
+
+    public void setUndoList(List<String> undoList) {
+        this.undoList = undoList;
+    }
+}

+ 88 - 0
src/main/java/com/jpsoft/ipcps/dto/TaskResponseDTO.java

@@ -0,0 +1,88 @@
+package com.jpsoft.ipcps.dto;
+
+import com.fasterxml.jackson.annotation.JsonFormat;
+import com.jpsoft.ipcps.entity.JpAdmin;
+
+import java.io.Serializable;
+import java.util.Date;
+import java.util.List;
+import java.util.Map;
+
+public class TaskResponseDTO implements Serializable
+{
+    private String taskId;
+    private String taskName;
+    private JpAdmin assignee;
+    private List<JpAdmin> candidates;
+    public List<Map> todoList;
+    private Date createTime;
+    private Date dueDate;
+    private Date endTime;
+
+    public String getTaskId() {
+        return taskId;
+    }
+
+    public void setTaskId(String taskId) {
+        this.taskId = taskId;
+    }
+
+    public String getTaskName() {
+        return taskName;
+    }
+
+    public void setTaskName(String taskName) {
+        this.taskName = taskName;
+    }
+
+    public List<Map> getTodoList() {
+        return todoList;
+    }
+
+    public void setTodoList(List<Map> todoList) {
+        this.todoList = todoList;
+    }
+
+    public JpAdmin getAssignee() {
+        return assignee;
+    }
+
+    public void setAssignee(JpAdmin assignee) {
+        this.assignee = assignee;
+    }
+
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone ="GMT+8")
+    public Date getEndTime() {
+        return endTime;
+    }
+
+    public void setEndTime(Date endTime) {
+        this.endTime = endTime;
+    }
+
+    public List<JpAdmin> getCandidates() {
+        return candidates;
+    }
+
+    public void setCandidates(List<JpAdmin> candidates) {
+        this.candidates = candidates;
+    }
+
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone ="GMT+8")
+    public Date getCreateTime() {
+        return createTime;
+    }
+
+    public void setCreateTime(Date createTime) {
+        this.createTime = createTime;
+    }
+
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone ="GMT+8")
+    public Date getDueDate() {
+        return dueDate;
+    }
+
+    public void setDueDate(Date dueDate) {
+        this.dueDate = dueDate;
+    }
+}

+ 68 - 0
src/main/java/com/jpsoft/ipcps/entity/AccessToken.java

@@ -0,0 +1,68 @@
+package com.jpsoft.ipcps.entity;
+
+import java.util.Date;
+
+/**
+ * 微信通用接口凭证
+ */
+public class AccessToken {
+    private String appId;
+    // 获取到的凭证
+    private String token;
+    // 凭证有效时间,单位:秒
+    private int expiresIn;
+    //用户唯一标识
+    private String openid;
+    private String scope;
+    private Date createDate;
+
+    public Date getCreateDate() {
+        return createDate;
+    }
+
+    public void setCreateDate(Date createDate) {
+        this.createDate = createDate;
+    }
+
+    public String getToken() {
+        return token;
+    }
+
+    public void setToken(String token) {
+        this.token = token;
+    }
+
+
+    public String getAppId() {
+        return appId;
+    }
+
+    public void setAppId(String appId) {
+        this.appId = appId;
+    }
+
+    public int getExpiresIn() {
+        return expiresIn;
+    }
+
+    public void setExpiresIn(int expiresIn) {
+        this.expiresIn = expiresIn;
+    }
+
+    public String getOpenid() {
+        return openid;
+    }
+
+    public void setOpenid(String openid) {
+        this.openid = openid;
+    }
+
+    public String getScope() {
+        return scope;
+    }
+
+    public void setScope(String scope) {
+        this.scope = scope;
+    }
+}
+

+ 87 - 0
src/main/java/com/jpsoft/ipcps/entity/AdminRole.java

@@ -0,0 +1,87 @@
+package com.jpsoft.ipcps.entity;
+
+import java.io.Serializable;
+import java.util.Date;
+import java.text.SimpleDateFormat;
+import java.math.BigDecimal;
+import org.springframework.format.annotation.DateTimeFormat;
+import com.fasterxml.jackson.annotation.JsonFormat;
+
+/**
+  描述:jp_admin_role的实体类
+ */
+public class AdminRole {
+	private String id;
+	private String roleId;
+	private String roleName;
+	private String roleDescription;
+	private String adminId;
+
+	
+		/**
+	 *获取ID
+	 */
+	public String getId(){
+		return id;
+	}
+	
+	/**
+	 *设置ID
+	 */
+	public void setId(String id){
+		this.id = id;
+	}
+		/**
+	 *获取角色ID
+	 */
+	public String getRoleId(){
+		return roleId;
+	}
+	
+	/**
+	 *设置角色ID
+	 */
+	public void setRoleId(String roleId){
+		this.roleId = roleId;
+	}
+
+	/**
+	 *获取标示角色名称
+	 */
+	public String getRoleName(){
+		return roleName;
+	}
+
+	/**
+	 *设置标示角色名称
+	 */
+	public void setRoleName(String roleName){
+		this.roleName = roleName;
+	}
+	/**
+	 *获取中文角色名称
+	 */
+	public String getRoleDescription(){
+		return roleDescription;
+	}
+
+	/**
+	 *设置中文角色名称
+	 */
+	public void setRoleDescription(String roleDescription){
+		this.roleDescription = roleDescription;
+	}
+		/**
+	 *获取用户ID
+	 */
+	public String getAdminId(){
+		return adminId;
+	}
+	
+	/**
+	 *设置用户ID
+	 */
+	public void setAdminId(String adminId){
+		this.adminId = adminId;
+	}
+}

+ 71 - 0
src/main/java/com/jpsoft/ipcps/entity/Department.java

@@ -0,0 +1,71 @@
+package com.jpsoft.ipcps.entity;
+
+import java.io.Serializable;
+import java.util.Date;
+import java.text.SimpleDateFormat;
+import java.math.BigDecimal;
+import org.springframework.format.annotation.DateTimeFormat;
+import com.fasterxml.jackson.annotation.JsonFormat;
+
+/**
+  描述:jp_department的实体类
+ */
+public class Department {
+	private String id;
+	private String orgId;
+	private String parkId;
+	private String name;
+	
+		/**
+	 *获取ID
+	 */
+	public String getId(){
+		return id;
+	}
+	
+	/**
+	 *设置ID
+	 */
+	public void setId(String id){
+		this.id = id;
+	}
+		/**
+	 *获取单位ID
+	 */
+	public String getOrgId(){
+		return orgId;
+	}
+	
+	/**
+	 *设置单位ID
+	 */
+	public void setOrgId(String orgId){
+		this.orgId = orgId;
+	}
+		/**
+	 *获取园区ID
+	 */
+	public String getParkId(){
+		return parkId;
+	}
+	
+	/**
+	 *设置园区ID
+	 */
+	public void setParkId(String parkId){
+		this.parkId = parkId;
+	}
+		/**
+	 *获取部门名称
+	 */
+	public String getName(){
+		return name;
+	}
+	
+	/**
+	 *设置部门名称
+	 */
+	public void setName(String name){
+		this.name = name;
+	}
+}

+ 371 - 0
src/main/java/com/jpsoft/ipcps/entity/JpAdmin.java

@@ -0,0 +1,371 @@
+package com.jpsoft.ipcps.entity;
+
+import java.io.Serializable;
+import java.util.Date;
+import java.text.SimpleDateFormat;
+import java.math.BigDecimal;
+import java.util.List;
+import java.util.ResourceBundle;
+
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import org.apache.commons.lang3.StringUtils;
+import org.springframework.format.annotation.DateTimeFormat;
+import com.fasterxml.jackson.annotation.JsonFormat;
+
+/**
+  描述:jp_admin的实体类
+ */
+@ApiModel("管理员")
+public class JpAdmin {
+	private String id;
+	private String roleId;
+	private String userName;
+	private String realName;
+	private String email;
+	private String pwd;
+	private String pictureUrl;
+	private String pictureUrlN;
+	private String gender;
+	private String orgId;
+	private String department;
+	private String office;
+	private String tel;
+//	private Role role;
+	private Org org;
+	private String createBy;
+	private JpAdmin createByAdmin;
+	private Date createDate;
+	private String updateBy;
+	private JpAdmin updateByAdmin;
+	private Date updateDate;
+	private Boolean delFlag;
+	private String openId;
+	private List<AdminRole> adminRoleList;
+	private String post;
+	
+		/**
+	 *获取id
+	 */
+	public String getId(){
+		return id;
+	}
+	
+	/**
+	 *设置id
+	 */
+	public void setId(String id){
+		this.id = id;
+	}
+		/**
+	 *获取角色编号
+	 */
+	public String getRoleId(){
+		return roleId;
+	}
+	
+	/**
+	 *设置角色编号
+	 */
+	public void setRoleId(String roleId){
+		this.roleId = roleId;
+	}
+		/**
+	 *获取用户名
+	 */
+	public String getUserName(){
+		return userName;
+	}
+	
+	/**
+	 *设置用户名
+	 */
+	public void setUserName(String userName){
+		this.userName = userName;
+	}
+		/**
+	 *获取真实姓名
+	 */
+	@ApiModelProperty("真实姓名")
+	public String getRealName(){
+		return realName;
+	}
+	
+	/**
+	 *设置真实姓名
+	 */
+	public void setRealName(String realName){
+		this.realName = realName;
+	}
+		/**
+	 *获取电子邮箱
+	 */
+	public String getEmail(){
+		return email;
+	}
+	
+	/**
+	 *设置电子邮箱
+	 */
+	public void setEmail(String email){
+		this.email = email;
+	}
+		/**
+	 *获取密码
+	 */
+	public String getPwd(){
+		return pwd;
+	}
+	
+	/**
+	 *设置密码
+	 */
+	public void setPwd(String pwd){
+		this.pwd = pwd;
+	}
+		/**
+	 *获取图片编号
+	 */
+	public String getPictureUrl(){
+		return pictureUrl;
+	}
+	
+	/**
+	 *设置图片编号
+	 */
+	public void setPictureUrlN(String pictureUrlN){
+		this.pictureUrlN = pictureUrlN;
+	}
+	/**
+	 *获取图片编号
+	 */
+	public String getPictureUrlN(){
+		ResourceBundle rb = ResourceBundle.getBundle("server");
+		String oosUrl = rb.getString("oosUrl");
+		String defaultPic=rb.getString("defaultPic");
+		if (StringUtils.isNotBlank(this.pictureUrl)){
+			oosUrl = oosUrl + "/" + this.pictureUrl;
+		}else {
+			oosUrl = oosUrl+"/"+defaultPic;
+		}
+		return oosUrl;
+	}
+
+	/**
+	 *设置图片编号
+	 */
+	public void setPictureUrl(String pictureUrl){
+		this.pictureUrl = pictureUrl;
+	}
+		/**
+	 *获取性别
+	 */
+	public String getGender(){
+		return gender;
+	}
+	
+	/**
+	 *设置性别
+	 */
+	public void setGender(String gender){
+		this.gender = gender;
+	}
+		/**
+	 *获取所属单位
+	 */
+	public String getOrgId(){
+		return orgId;
+	}
+	
+	/**
+	 *设置所属单位
+	 */
+	public void setOrgId(String orgId){
+		this.orgId = orgId;
+	}
+		/**
+	 *获取所属部门
+	 */
+	public String getDepartment(){
+		return department;
+	}
+	
+	/**
+	 *设置所属部门
+	 */
+	public void setDepartment(String department){
+		this.department = department;
+	}
+		/**
+	 *获取所属科室
+	 */
+	public String getOffice(){
+		return office;
+	}
+	
+	/**
+	 *设置所属科室
+	 */
+	public void setOffice(String office){
+		this.office = office;
+	}
+		/**
+	 *获取联系电话
+	 */
+	public String getTel(){
+		return tel;
+	}
+	
+	/**
+	 *设置联系电话
+	 */
+	public void setTel(String tel){
+		this.tel = tel;
+	}
+
+
+
+//	public Role getRole(){
+//		return role;
+//	}
+//	public void setRole(Role role){ this.role = role; }
+
+
+	public Org getOrg(){
+		return org;
+	}
+	public void setOrg(Org org){ this.org = org; }
+
+	/**
+	 *获取创建人
+	 */
+	public String getCreateBy(){
+		return createBy;
+	}
+
+	/**
+	 *设置创建人
+	 */
+	public void setCreateBy(String createBy){
+		this.createBy = createBy;
+	}
+
+	public JpAdmin getCreateByAdmin(){
+		return createByAdmin;
+	}
+	public void setCreateByAdmin(JpAdmin createByAdmin){
+		this.createByAdmin = createByAdmin;
+	}
+
+	@DateTimeFormat(pattern="yyyy-MM-dd HH:mm")
+	@JsonFormat(pattern = "yyyy-MM-dd HH:mm",timezone = "GMT+8")
+	/**
+	 *获取创建时间
+	 */
+	public Date getCreateDate(){
+		return createDate;
+	}
+
+	/**
+	 *设置创建时间
+	 */
+	public void setCreateDate(Date createDate){
+		this.createDate = createDate;
+	}
+	/**
+	 *获取更新人
+	 */
+	public String getUpdateBy(){
+		return updateBy;
+	}
+
+	/**
+	 *设置更新人
+	 */
+	public void setUpdateBy(String updateBy){
+		this.updateBy = updateBy;
+	}
+
+	public JpAdmin getUpdateByAdmin(){
+		return updateByAdmin;
+	}
+	public void setUpdateByAdmin(JpAdmin updateByAdmin){
+		this.updateByAdmin = updateByAdmin;
+	}
+
+	@DateTimeFormat(pattern="yyyy-MM-dd HH:mm")
+	@JsonFormat(pattern = "yyyy-MM-dd HH:mm",timezone = "GMT+8")
+	/**
+	 *获取更新时间
+	 */
+	public Date getUpdateDate(){
+		return updateDate;
+	}
+
+	/**
+	 *设置更新时间
+	 */
+	public void setUpdateDate(Date updateDate){
+		this.updateDate = updateDate;
+	}
+	/**
+	 *获取是否删除
+	 */
+	public Boolean getDelFlag(){
+		return delFlag;
+	}
+
+	/**
+	 *设置是否删除
+	 */
+	public void setDelFlag(Boolean delFlag){
+		this.delFlag = delFlag;
+	}
+
+
+
+	/**
+	 *获取角色列表
+	 */
+	public List<AdminRole> getAdminRoleList(){
+		return adminRoleList;
+	}
+
+	/**
+	 *设置角色列表
+	 */
+	public void setAdminRoleList(List<AdminRole> adminRoleList){
+		this.adminRoleList = adminRoleList;
+	}
+
+
+	/**
+	 *获取微信ID
+	 */
+	public String getOpenId(){
+		return openId;
+	}
+
+	/**
+	 *设置微信ID
+	 */
+	public void setOpenId(String opedId){
+		this.openId = opedId;
+	}
+
+
+	/**
+	 *获取职务
+	 */
+	public String getPost(){
+		return post;
+	}
+
+	/**
+	 *设置职务
+	 */
+	public void setPost(String post){
+		this.post = post;
+	}
+
+}

+ 222 - 0
src/main/java/com/jpsoft/ipcps/entity/Menu.java

@@ -0,0 +1,222 @@
+package com.jpsoft.ipcps.entity;
+
+import java.beans.Transient;
+import java.io.Serializable;
+import java.util.Date;
+import java.text.SimpleDateFormat;
+import java.math.BigDecimal;
+import java.util.List;
+
+import org.springframework.format.annotation.DateTimeFormat;
+import com.fasterxml.jackson.annotation.JsonFormat;
+import org.springframework.transaction.annotation.Transactional;
+
+/**
+  描述:sys_menu的实体类
+ */
+public class Menu {
+	private String id;
+	private String menuName;
+	private String parentId;
+	private Integer sortNo;
+	private String menuUrl;
+	private String method;
+	private String menuType;
+	private Date createTime;
+	private String createBy;
+	private Date updateTime;
+	private String updateBy;
+	private Boolean delFlag;
+	private String parentName;
+	private List<Menu> children;
+	private Boolean checked;
+	private String icon;
+
+		/**
+	 *获取菜单编号
+	 */
+	public String getId(){
+		return id;
+	}
+	
+	/**
+	 *设置菜单编号
+	 */
+	public void setId(String id){
+		this.id = id;
+	}
+		/**
+	 *获取菜单名称
+	 */
+	public String getMenuName(){
+		return menuName;
+	}
+	
+	/**
+	 *设置菜单名称
+	 */
+	public void setMenuName(String menuName){
+		this.menuName = menuName;
+	}
+		/**
+	 *获取上级菜单
+	 */
+	public String getParentId(){
+		return parentId;
+	}
+	
+	/**
+	 *设置上级菜单
+	 */
+	public void setParentId(String parentId){
+		this.parentId = parentId;
+	}
+		/**
+	 *获取排序号
+	 */
+	public Integer getSortNo(){
+		return sortNo;
+	}
+	
+	/**
+	 *设置排序号
+	 */
+	public void setSortNo(Integer sortNo){
+		this.sortNo = sortNo;
+	}
+		/**
+	 *获取菜单地址
+	 */
+	public String getMenuUrl(){
+		return menuUrl;
+	}
+	
+	/**
+	 *设置菜单地址
+	 */
+	public void setMenuUrl(String menuUrl){
+		this.menuUrl = menuUrl;
+	}
+		/**
+	 *获取菜单类型(1-后端、2-前端)
+	 */
+	public String getMenuType(){
+		return menuType;
+	}
+	
+	/**
+	 *设置菜单类型(1-后端、2-前端)
+	 */
+	public void setMenuType(String menuType){
+		this.menuType = menuType;
+	}
+		@DateTimeFormat(pattern="yyyy-MM-dd HH:mm")
+	@JsonFormat(pattern = "yyyy-MM-dd HH:mm",timezone ="GMT+8")
+		/**
+	 *获取
+	 */
+	public Date getCreateTime(){
+		return createTime;
+	}
+	
+	/**
+	 *设置
+	 */
+	public void setCreateTime(Date createTime){
+		this.createTime = createTime;
+	}
+		/**
+	 *获取
+	 */
+	public String getCreateBy(){
+		return createBy;
+	}
+	
+	/**
+	 *设置
+	 */
+	public void setCreateBy(String createBy){
+		this.createBy = createBy;
+	}
+		@DateTimeFormat(pattern="yyyy-MM-dd HH:mm")
+	@JsonFormat(pattern = "yyyy-MM-dd HH:mm",timezone ="GMT+8")
+		/**
+	 *获取
+	 */
+	public Date getUpdateTime(){
+		return updateTime;
+	}
+	
+	/**
+	 *设置
+	 */
+	public void setUpdateTime(Date updateTime){
+		this.updateTime = updateTime;
+	}
+		/**
+	 *获取
+	 */
+	public String getUpdateBy(){
+		return updateBy;
+	}
+	
+	/**
+	 *设置
+	 */
+	public void setUpdateBy(String updateBy){
+		this.updateBy = updateBy;
+	}
+		/**
+	 *获取
+	 */
+	public Boolean getDelFlag(){
+		return delFlag;
+	}
+	
+	/**
+	 *设置
+	 */
+	public void setDelFlag(Boolean delFlag){
+		this.delFlag = delFlag;
+	}
+
+	public String getParentName() {
+		return parentName;
+	}
+
+	public void setParentName(String parentName) {
+		this.parentName = parentName;
+	}
+
+	public List<Menu> getChildren() {
+		return children;
+	}
+
+	public void setChildren(List<Menu> children) {
+		this.children = children;
+	}
+
+	public String getIcon() {
+		return icon;
+	}
+
+	public void setIcon(String icon) {
+		this.icon = icon;
+	}
+
+	public Boolean getChecked() {
+		return checked;
+	}
+
+	public void setChecked(Boolean checked) {
+		this.checked = checked;
+	}
+
+	public String getMethod() {
+		return method;
+	}
+
+	public void setMethod(String method) {
+		this.method = method;
+	}
+}

+ 185 - 0
src/main/java/com/jpsoft/ipcps/entity/Messages.java

@@ -0,0 +1,185 @@
+package com.jpsoft.ipcps.entity;
+
+import java.io.Serializable;
+import java.util.Date;
+import java.text.SimpleDateFormat;
+import java.math.BigDecimal;
+import org.springframework.format.annotation.DateTimeFormat;
+import com.fasterxml.jackson.annotation.JsonFormat;
+
+/**
+  描述:jp_messages的实体类
+ */
+public class Messages {
+	private String id;
+	private String adminId;
+	private JpAdmin jpAdmin;
+	private String title;
+	private String detail;
+	private Boolean haveRead;
+	private Boolean delFlag;
+	private String createBy;
+	private JpAdmin createByAdmin;
+	private Date createDate;
+	private String updateBy;
+	private JpAdmin updateByAdmin;
+	private Date updateDate;
+	
+		/**
+	 *获取主键
+	 */
+	public String getId(){
+		return id;
+	}
+	
+	/**
+	 *设置主键
+	 */
+	public void setId(String id){
+		this.id = id;
+	}
+		/**
+	 *获取接收信息用户id
+	 */
+	public String getAdminId(){
+		return adminId;
+	}
+	
+	/**
+	 *设置接收信息用户id
+	 */
+	public void setAdminId(String adminId){
+		this.adminId = adminId;
+	}
+
+	public JpAdmin getJpAdmin(){
+		return jpAdmin;
+	}
+	public void setJpAdmin(JpAdmin jpAdmin){
+		this.jpAdmin = jpAdmin;
+	}
+		/**
+	 *获取消息标题
+	 */
+	public String getTitle(){
+		return title;
+	}
+	
+	/**
+	 *设置消息标题
+	 */
+	public void setTitle(String title){
+		this.title = title;
+	}
+		/**
+	 *获取消息详情
+	 */
+	public String getDetail(){
+		return detail;
+	}
+	
+	/**
+	 *设置消息详情
+	 */
+	public void setDetail(String detail){
+		this.detail = detail;
+	}
+	/**
+	 *获取是否已读
+	 */
+	public Boolean getHaveRead(){
+		return haveRead;
+	}
+
+	/**
+	 *设置是否已读
+	 */
+	public void setHaveRead(Boolean haveRead){
+		this.haveRead = haveRead;
+	}
+		/**
+	 *获取是否删除
+	 */
+	public Boolean getDelFlag(){
+		return delFlag;
+	}
+	
+	/**
+	 *设置是否删除
+	 */
+	public void setDelFlag(Boolean delFlag){
+		this.delFlag = delFlag;
+	}
+		/**
+	 *获取创建人
+	 */
+	public String getCreateBy(){
+		return createBy;
+	}
+	
+	/**
+	 *设置创建人
+	 */
+	public void setCreateBy(String createBy){
+		this.createBy = createBy;
+	}
+
+	public JpAdmin getCreateByAdmin(){
+		return createByAdmin;
+	}
+	public void setCreateByAdmin(JpAdmin createByAdmin){
+		this.createByAdmin = createByAdmin;
+	}
+
+		@DateTimeFormat(pattern="yyyy-MM-dd HH:mm")
+	@JsonFormat(pattern = "yyyy-MM-dd HH:mm",timezone = "GMT+8")
+		/**
+	 *获取创建时间
+	 */
+	public Date getCreateDate(){
+		return createDate;
+	}
+	
+	/**
+	 *设置创建时间
+	 */
+	public void setCreateDate(Date createDate){
+		this.createDate = createDate;
+	}
+		/**
+	 *获取更新人
+	 */
+	public String getUpdateBy(){
+		return updateBy;
+	}
+	
+	/**
+	 *设置更新人
+	 */
+	public void setUpdateBy(String updateBy){
+		this.updateBy = updateBy;
+	}
+
+	public JpAdmin getUpdateByAdmin(){
+		return updateByAdmin;
+	}
+	public void setUpdateByAdmin(JpAdmin updateByAdmin){
+		this.updateByAdmin = updateByAdmin;
+	}
+
+		@DateTimeFormat(pattern="yyyy-MM-dd HH:mm")
+	@JsonFormat(pattern = "yyyy-MM-dd HH:mm",timezone = "GMT+8")
+		/**
+	 *获取更新时间
+	 */
+	public Date getUpdateDate(){
+		return updateDate;
+	}
+	
+	/**
+	 *设置更新时间
+	 */
+	public void setUpdateDate(Date updateDate){
+		this.updateDate = updateDate;
+	}
+}

+ 183 - 0
src/main/java/com/jpsoft/ipcps/entity/MonthPlan.java

@@ -0,0 +1,183 @@
+package com.jpsoft.ipcps.entity;
+
+import java.io.Serializable;
+import java.util.Date;
+import java.text.SimpleDateFormat;
+import java.math.BigDecimal;
+import java.util.List;
+
+import org.springframework.format.annotation.DateTimeFormat;
+import com.fasterxml.jackson.annotation.JsonFormat;
+
+/**
+  描述:jp_month_plan的实体类
+ */
+public class MonthPlan {
+	private String id;
+	private String adminId;
+	private String projectId;
+	private String detail;
+	private String year;
+	private String month;
+	private Boolean finished;
+	private Boolean delFlag;
+	private String createBy;
+	private Date createDate;
+	private String updateBy;
+	private Date updateDate;
+	
+		/**
+	 *获取主键
+	 */
+	public String getId(){
+		return id;
+	}
+	
+	/**
+	 *设置主键
+	 */
+	public void setId(String id){
+		this.id = id;
+	}
+		/**
+	 *获取企业秘书id
+	 */
+	public String getAdminId(){
+		return adminId;
+	}
+	
+	/**
+	 *设置企业秘书id
+	 */
+	public void setAdminId(String adminId){
+		this.adminId = adminId;
+	}
+		/**
+	 *获取所属项目id
+	 */
+	public String getProjectId(){
+		return projectId;
+	}
+	
+	/**
+	 *设置所属项目id
+	 */
+	public void setProjectId(String projectId){
+		this.projectId = projectId;
+	}
+		/**
+	 *获取完成事项
+	 */
+	public String getDetail(){
+		return detail;
+	}
+	
+	/**
+	 *设置完成事项
+	 */
+	public void setDetail(String detail){
+		this.detail = detail;
+	}
+		/**
+	 *获取年
+	 */
+	public String getYear(){
+		return year;
+	}
+	
+	/**
+	 *设置年
+	 */
+	public void setYear(String year){
+		this.year = year;
+	}
+		/**
+	 *获取月
+	 */
+	public String getMonth(){
+		return month;
+	}
+	
+	/**
+	 *设置月
+	 */
+	public void setMonth(String month){
+		this.month = month;
+	}
+
+	public Boolean getFinished(){
+		return finished;
+	}
+	public void setFinished(Boolean finished){
+		this.finished = finished;
+	}
+		/**
+	 *获取是否删除
+	 */
+	public Boolean getDelFlag(){
+		return delFlag;
+	}
+	
+	/**
+	 *设置是否删除
+	 */
+	public void setDelFlag(Boolean delFlag){
+		this.delFlag = delFlag;
+	}
+		/**
+	 *获取创建人
+	 */
+	public String getCreateBy(){
+		return createBy;
+	}
+	
+	/**
+	 *设置创建人
+	 */
+	public void setCreateBy(String createBy){
+		this.createBy = createBy;
+	}
+		@DateTimeFormat(pattern="yyyy-MM-dd HH:mm")
+	@JsonFormat(pattern = "yyyy-MM-dd HH:mm")
+		/**
+	 *获取创建时间
+	 */
+	public Date getCreateDate(){
+		return createDate;
+	}
+	
+	/**
+	 *设置创建时间
+	 */
+	public void setCreateDate(Date createDate){
+		this.createDate = createDate;
+	}
+		/**
+	 *获取更新人
+	 */
+	public String getUpdateBy(){
+		return updateBy;
+	}
+	
+	/**
+	 *设置更新人
+	 */
+	public void setUpdateBy(String updateBy){
+		this.updateBy = updateBy;
+	}
+		@DateTimeFormat(pattern="yyyy-MM-dd HH:mm")
+	@JsonFormat(pattern = "yyyy-MM-dd HH:mm")
+		/**
+	 *获取更新时间
+	 */
+	public Date getUpdateDate(){
+		return updateDate;
+	}
+	
+	/**
+	 *设置更新时间
+	 */
+	public void setUpdateDate(Date updateDate){
+		this.updateDate = updateDate;
+	}
+}

+ 85 - 0
src/main/java/com/jpsoft/ipcps/entity/MonthPlanMatter.java

@@ -0,0 +1,85 @@
+package com.jpsoft.ipcps.entity;
+
+import java.io.Serializable;
+import java.util.Date;
+import java.text.SimpleDateFormat;
+import java.math.BigDecimal;
+import org.springframework.format.annotation.DateTimeFormat;
+import com.fasterxml.jackson.annotation.JsonFormat;
+
+/**
+  描述:jp_month_plan_matter的实体类
+ */
+public class MonthPlanMatter {
+	private String id;
+	private String planId;
+	private String todoId;
+	private String todoTitle;
+	private String todoDetail;
+	
+		/**
+	 *获取主键
+	 */
+	public String getId(){
+		return id;
+	}
+	
+	/**
+	 *设置主键
+	 */
+	public void setId(String id){
+		this.id = id;
+	}
+		/**
+	 *获取月计划ID
+	 */
+	public String getPlanId(){
+		return planId;
+	}
+	
+	/**
+	 *设置月计划ID
+	 */
+	public void setPlanId(String planId){
+		this.planId = planId;
+	}
+		/**
+	 *获取事务ID
+	 */
+	public String getTodoId(){
+		return todoId;
+	}
+	
+	/**
+	 *设置事务ID
+	 */
+	public void setTodoId(String todoId){
+		this.todoId = todoId;
+	}
+		/**
+	 *获取步骤名
+	 */
+	public String getTodoTitle(){
+		return todoTitle;
+	}
+	
+	/**
+	 *设置步骤名
+	 */
+	public void setTodoTitle(String todoTitle){
+		this.todoTitle = todoTitle;
+	}
+		/**
+	 *获取事务名
+	 */
+	public String getTodoDetail(){
+		return todoDetail;
+	}
+	
+	/**
+	 *设置事务名
+	 */
+	public void setTodoDetail(String todoDetail){
+		this.todoDetail = todoDetail;
+	}
+}

+ 89 - 0
src/main/java/com/jpsoft/ipcps/entity/Org.java

@@ -0,0 +1,89 @@
+package com.jpsoft.ipcps.entity;
+
+import java.io.Serializable;
+import java.util.Date;
+import java.text.SimpleDateFormat;
+import java.math.BigDecimal;
+import org.springframework.format.annotation.DateTimeFormat;
+import com.fasterxml.jackson.annotation.JsonFormat;
+
+/**
+  描述:jp_org的实体类
+ */
+public class Org {
+	private String orgId;
+	private String orgName;
+	private Integer orgOrder;
+	private Boolean delFlag;
+	private Integer type;
+
+	/**
+	 *获取组织机构编号
+	 */
+	public String getOrgId(){
+		return orgId;
+	}
+	
+	/**
+	 *设置组织机构编号
+	 */
+	public void setOrgId(String orgId){
+		this.orgId = orgId;
+	}
+		/**
+	 *获取组织机构名称
+	 */
+	public String getOrgName(){
+		return orgName;
+	}
+
+	/**
+	 *设置组织机构名称
+	 */
+	public void setOrgName(String orgName){
+		this.orgName = orgName;
+	}
+
+	/**
+	 *获取序号
+	 */
+	public Integer getOrgOrder(){
+		return orgOrder;
+	}
+
+	/**
+	 *设置序号
+	 */
+	public void setOrgOrder(Integer orgOrder){
+		this.orgOrder = orgOrder;
+	}
+
+	/**
+	 *获取是否删除
+	 */
+	public Boolean getDelFlag(){
+		return delFlag;
+	}
+
+	/**
+	 *设置是否删除
+	 */
+	public void setDelFlag(Boolean delFlag){
+		this.delFlag = delFlag;
+	}
+
+
+	/**
+	 *获取类型
+	 */
+	public Integer getType(){
+		return type;
+	}
+
+	/**
+	 *设置类型
+	 */
+	public void setType(Integer type){
+		this.type = type;
+	}
+}

+ 214 - 0
src/main/java/com/jpsoft/ipcps/entity/Park.java

@@ -0,0 +1,214 @@
+package com.jpsoft.ipcps.entity;
+
+import java.io.Serializable;
+import java.util.Date;
+import java.text.SimpleDateFormat;
+import java.math.BigDecimal;
+import java.util.List;
+
+import org.springframework.format.annotation.DateTimeFormat;
+import com.fasterxml.jackson.annotation.JsonFormat;
+
+/**
+  描述:jp_park的实体类
+ */
+public class Park {
+	private String parkId;
+	private String title;
+	private String adminId;
+//	private JpAdmin jpAdmin;
+	private Integer orderId;
+	private String details;
+	private Boolean delFlag;
+	private String createBy;
+	private JpAdmin createByAdmin;
+	private Date createDate;
+	private String updateBy;
+	private JpAdmin updateByAdmin;
+	private Date updateDate;
+	private List<ParkAdmin> parkAdminList;
+	private List<ParkOrg> parkOrgList;
+	private List<Department> parkTownList;
+	
+	/**
+	 *获取园区主键
+	*/
+	public String getParkId(){
+		return parkId;
+	}
+	
+	/**
+	 *设置园区主键
+	 */
+	public void setParkId(String parkId){
+		this.parkId = parkId;
+	}
+		/**
+	 *获取园区名称
+	 */
+	public String getTitle(){
+		return title;
+	}
+	
+	/**
+	 *设置园区名称
+	 */
+	public void setTitle(String title){
+		this.title = title;
+	}
+		/**
+	 *获取包联领导用户id
+	 */
+	public String getAdminId(){
+		return adminId;
+	}
+	
+	/**
+	 *设置包联领导用户id
+	 */
+	public void setAdminId(String adminId){
+		this.adminId = adminId;
+	}
+
+//	public JpAdmin getJpAdmin(){
+//		return jpAdmin;
+//	}
+//	public void setJpAdmin(JpAdmin jpAdmin){
+//		this.jpAdmin = jpAdmin;
+//	}
+		/**
+	 *获取顺序编号
+	 */
+	public Integer getOrderId(){
+		return orderId;
+	}
+	
+	/**
+	 *设置顺序编号
+	 */
+	public void setOrderId(Integer orderId){
+		this.orderId = orderId;
+	}
+
+	public String getDetails(){
+		return details;
+	}
+	public void setDetails(String details){
+		this.details = details;
+	}
+		/**
+	 *获取是否删除
+	 */
+	public Boolean getDelFlag(){
+		return delFlag;
+	}
+	
+	/**
+	 *设置是否删除
+	 */
+	public void setDelFlag(Boolean delFlag){
+		this.delFlag = delFlag;
+	}
+		/**
+	 *获取创建人
+	 */
+	public String getCreateBy(){
+		return createBy;
+	}
+	
+	/**
+	 *设置创建人
+	 */
+	public void setCreateBy(String createBy){
+		this.createBy = createBy;
+	}
+
+	public JpAdmin getCreateByAdmin(){
+		return createByAdmin;
+	}
+	public void setCreateByAdmin(JpAdmin createByAdmin){
+		this.createByAdmin = createByAdmin;
+	}
+
+		@DateTimeFormat(pattern="yyyy-MM-dd HH:mm")
+	@JsonFormat(pattern = "yyyy-MM-dd HH:mm",timezone = "GMT+8")
+		/**
+	 *获取创建时间
+	 */
+	public Date getCreateDate(){
+		return createDate;
+	}
+	
+	/**
+	 *设置创建时间
+	 */
+	public void setCreateDate(Date createDate){
+		this.createDate = createDate;
+	}
+		/**
+	 *获取更新人
+	 */
+	public String getUpdateBy(){
+		return updateBy;
+	}
+	
+	/**
+	 *设置更新人
+	 */
+	public void setUpdateBy(String updateBy){
+		this.updateBy = updateBy;
+	}
+
+	public JpAdmin getUpdateByAdmin(){
+		return updateByAdmin;
+	}
+	public void setUpdateByAdmin(JpAdmin updateByAdmin){
+		this.updateByAdmin = updateByAdmin;
+	}
+
+		@DateTimeFormat(pattern="yyyy-MM-dd HH:mm")
+	@JsonFormat(pattern = "yyyy-MM-dd HH:mm",timezone = "GMT+8")
+		/**
+	 *获取更新时间
+	 */
+	public Date getUpdateDate(){
+		return updateDate;
+	}
+	
+	/**
+	 *设置更新时间
+	 */
+	public void setUpdateDate(Date updateDate){
+		this.updateDate = updateDate;
+	}
+
+	/**
+	 *获取园区办列表
+	 */
+	public List<ParkAdmin> getParkAdminList(){
+		return parkAdminList;
+	}
+
+	/**
+	 *设置园区办列表
+	 */
+	public void setParkAdminList(List<ParkAdmin> parkAdminList){
+		this.parkAdminList = parkAdminList;
+	}
+
+	public List<ParkOrg> getParkOrgList() {
+		return parkOrgList;
+	}
+
+	public void setParkOrgList(List<ParkOrg> parkOrgList) {
+		this.parkOrgList = parkOrgList;
+	}
+
+	public List<Department> getParkTownList() {
+		return parkTownList;
+	}
+
+	public void setParkTownList(List<Department> parkTownList) {
+		this.parkTownList = parkTownList;
+	}
+}

+ 71 - 0
src/main/java/com/jpsoft/ipcps/entity/ParkAdmin.java

@@ -0,0 +1,71 @@
+package com.jpsoft.ipcps.entity;
+
+import java.io.Serializable;
+import java.util.Date;
+import java.text.SimpleDateFormat;
+import java.math.BigDecimal;
+import org.springframework.format.annotation.DateTimeFormat;
+import com.fasterxml.jackson.annotation.JsonFormat;
+
+/**
+  描述:jp_park_admin的实体类
+ */
+public class ParkAdmin {
+	private String id;
+	private String parkId;
+	private String adminId;
+	private String adminName;
+	
+		/**
+	 *获取ID
+	 */
+	public String getId(){
+		return id;
+	}
+	
+	/**
+	 *设置ID
+	 */
+	public void setId(String id){
+		this.id = id;
+	}
+		/**
+	 *获取园区ID
+	 */
+	public String getParkId(){
+		return parkId;
+	}
+	
+	/**
+	 *设置园区ID
+	 */
+	public void setParkId(String parkId){
+		this.parkId = parkId;
+	}
+		/**
+	 *获取用户ID
+	 */
+	public String getAdminId(){
+		return adminId;
+	}
+	
+	/**
+	 *设置用户ID
+	 */
+	public void setAdminId(String adminId){
+		this.adminId = adminId;
+	}
+		/**
+	 *获取用户名称
+	 */
+	public String getAdminName(){
+		return adminName;
+	}
+	
+	/**
+	 *设置用户名称
+	 */
+	public void setAdminName(String adminName){
+		this.adminName = adminName;
+	}
+}

+ 57 - 0
src/main/java/com/jpsoft/ipcps/entity/ParkOrg.java

@@ -0,0 +1,57 @@
+package com.jpsoft.ipcps.entity;
+
+import java.io.Serializable;
+import java.util.Date;
+import java.text.SimpleDateFormat;
+import java.math.BigDecimal;
+import org.springframework.format.annotation.DateTimeFormat;
+import com.fasterxml.jackson.annotation.JsonFormat;
+
+/**
+  描述:jp_park_org的实体类
+ */
+public class ParkOrg {
+	private String id;
+	private String orgId;
+	private String parkId;
+	
+		/**
+	 *获取
+	 */
+	public String getId(){
+		return id;
+	}
+	
+	/**
+	 *设置
+	 */
+	public void setId(String id){
+		this.id = id;
+	}
+		/**
+	 *获取
+	 */
+	public String getOrgId(){
+		return orgId;
+	}
+	
+	/**
+	 *设置
+	 */
+	public void setOrgId(String orgId){
+		this.orgId = orgId;
+	}
+		/**
+	 *获取
+	 */
+	public String getParkId(){
+		return parkId;
+	}
+	
+	/**
+	 *设置
+	 */
+	public void setParkId(String parkId){
+		this.parkId = parkId;
+	}
+}

+ 140 - 0
src/main/java/com/jpsoft/ipcps/entity/ProcDefStepAssignee.java

@@ -0,0 +1,140 @@
+package com.jpsoft.ipcps.entity;
+
+import java.io.Serializable;
+import java.util.Date;
+import java.text.SimpleDateFormat;
+import java.math.BigDecimal;
+import org.springframework.format.annotation.DateTimeFormat;
+import com.fasterxml.jackson.annotation.JsonFormat;
+
+/**
+  描述:jp_procdef_step_assignee的实体类
+ */
+public class ProcDefStepAssignee {
+	private String id;
+	private String stepId;
+	private String userId;
+	private String roleId;
+	private Boolean delFlag;
+	private String createBy;
+	private Date createDate;
+	private String updateBy;
+	private Date updateDate;
+	
+		/**
+	 *获取
+	 */
+	public String getId(){
+		return id;
+	}
+	
+	/**
+	 *设置
+	 */
+	public void setId(String id){
+		this.id = id;
+	}
+		/**
+	 *获取步骤编号
+	 */
+	public String getStepId(){
+		return stepId;
+	}
+	
+	/**
+	 *设置步骤编号
+	 */
+	public void setStepId(String stepId){
+		this.stepId = stepId;
+	}
+		/**
+	 *获取用户编号
+	 */
+	public String getUserId(){
+		return userId;
+	}
+	
+	/**
+	 *设置用户编号
+	 */
+	public void setUserId(String userId){
+		this.userId = userId;
+	}
+		/**
+	 *获取是否删除
+	 */
+	public Boolean getDelFlag(){
+		return delFlag;
+	}
+	
+	/**
+	 *设置是否删除
+	 */
+	public void setDelFlag(Boolean delFlag){
+		this.delFlag = delFlag;
+	}
+		/**
+	 *获取创建人
+	 */
+	public String getCreateBy(){
+		return createBy;
+	}
+	
+	/**
+	 *设置创建人
+	 */
+	public void setCreateBy(String createBy){
+		this.createBy = createBy;
+	}
+		@DateTimeFormat(pattern="yyyy-MM-dd HH:mm")
+	@JsonFormat(pattern = "yyyy-MM-dd HH:mm")
+		/**
+	 *获取创建时间
+	 */
+	public Date getCreateDate(){
+		return createDate;
+	}
+	
+	/**
+	 *设置创建时间
+	 */
+	public void setCreateDate(Date createDate){
+		this.createDate = createDate;
+	}
+		/**
+	 *获取更新人
+	 */
+	public String getUpdateBy(){
+		return updateBy;
+	}
+	
+	/**
+	 *设置更新人
+	 */
+	public void setUpdateBy(String updateBy){
+		this.updateBy = updateBy;
+	}
+		@DateTimeFormat(pattern="yyyy-MM-dd HH:mm")
+	@JsonFormat(pattern = "yyyy-MM-dd HH:mm")
+		/**
+	 *获取更新时间
+	 */
+	public Date getUpdateDate(){
+		return updateDate;
+	}
+	
+	/**
+	 *设置更新时间
+	 */
+	public void setUpdateDate(Date updateDate){
+		this.updateDate = updateDate;
+	}
+
+	public String getRoleId() {
+		return roleId;
+	}
+
+	public void setRoleId(String roleId) {
+		this.roleId = roleId;
+	}
+}

+ 140 - 0
src/main/java/com/jpsoft/ipcps/entity/ProcDefStepNotice.java

@@ -0,0 +1,140 @@
+package com.jpsoft.ipcps.entity;
+
+import java.io.Serializable;
+import java.util.Date;
+import java.text.SimpleDateFormat;
+import java.math.BigDecimal;
+import org.springframework.format.annotation.DateTimeFormat;
+import com.fasterxml.jackson.annotation.JsonFormat;
+
+/**
+  描述:jp_procdef_step_notice的实体类
+ */
+public class ProcDefStepNotice {
+	private String id;
+	private String stepId;
+	private String userId;
+	private String roleId;
+	private Boolean delFlag;
+	private String createBy;
+	private Date createDate;
+	private String updateBy;
+	private Date updateDate;
+	
+		/**
+	 *获取主键
+	 */
+	public String getId(){
+		return id;
+	}
+	
+	/**
+	 *设置主键
+	 */
+	public void setId(String id){
+		this.id = id;
+	}
+		/**
+	 *获取步骤ID
+	 */
+	public String getStepId(){
+		return stepId;
+	}
+	
+	/**
+	 *设置步骤ID
+	 */
+	public void setStepId(String stepId){
+		this.stepId = stepId;
+	}
+		/**
+	 *获取通知人id
+	 */
+	public String getUserId(){
+		return userId;
+	}
+	
+	/**
+	 *设置通知人id
+	 */
+	public void setUserId(String userId){
+		this.userId = userId;
+	}
+		/**
+	 *获取是否删除
+	 */
+	public Boolean getDelFlag(){
+		return delFlag;
+	}
+	
+	/**
+	 *设置是否删除
+	 */
+	public void setDelFlag(Boolean delFlag){
+		this.delFlag = delFlag;
+	}
+		/**
+	 *获取创建人
+	 */
+	public String getCreateBy(){
+		return createBy;
+	}
+	
+	/**
+	 *设置创建人
+	 */
+	public void setCreateBy(String createBy){
+		this.createBy = createBy;
+	}
+		@DateTimeFormat(pattern="yyyy-MM-dd HH:mm")
+	@JsonFormat(pattern = "yyyy-MM-dd HH:mm")
+		/**
+	 *获取创建时间
+	 */
+	public Date getCreateDate(){
+		return createDate;
+	}
+	
+	/**
+	 *设置创建时间
+	 */
+	public void setCreateDate(Date createDate){
+		this.createDate = createDate;
+	}
+		/**
+	 *获取更新人
+	 */
+	public String getUpdateBy(){
+		return updateBy;
+	}
+	
+	/**
+	 *设置更新人
+	 */
+	public void setUpdateBy(String updateBy){
+		this.updateBy = updateBy;
+	}
+		@DateTimeFormat(pattern="yyyy-MM-dd HH:mm")
+	@JsonFormat(pattern = "yyyy-MM-dd HH:mm")
+		/**
+	 *获取更新时间
+	 */
+	public Date getUpdateDate(){
+		return updateDate;
+	}
+	
+	/**
+	 *设置更新时间
+	 */
+	public void setUpdateDate(Date updateDate){
+		this.updateDate = updateDate;
+	}
+
+	public String getRoleId() {
+		return roleId;
+	}
+
+	public void setRoleId(String roleId) {
+		this.roleId = roleId;
+	}
+}

+ 140 - 0
src/main/java/com/jpsoft/ipcps/entity/ProcDefStepToDo.java

@@ -0,0 +1,140 @@
+package com.jpsoft.ipcps.entity;
+
+import java.io.Serializable;
+import java.util.Date;
+import java.text.SimpleDateFormat;
+import java.math.BigDecimal;
+import org.springframework.format.annotation.DateTimeFormat;
+import com.fasterxml.jackson.annotation.JsonFormat;
+
+/**
+  描述:jp_procdef_step_to_do的实体类
+ */
+public class ProcDefStepToDo {
+	private String id;
+	private Integer no;
+	private String stepId;
+	private String detail;
+	private Boolean delFlag;
+	private String createBy;
+	private Date createDate;
+	private String updateBy;
+	private Date updateDate;
+	
+		/**
+	 *获取主键
+	 */
+	public String getId(){
+		return id;
+	}
+	
+	/**
+	 *设置主键
+	 */
+	public void setId(String id){
+		this.id = id;
+	}
+		/**
+	 *获取步骤id
+	 */
+	public String getStepId(){
+		return stepId;
+	}
+	
+	/**
+	 *设置步骤id
+	 */
+	public void setStepId(String stepId){
+		this.stepId = stepId;
+	}
+		/**
+	 *获取事项名称
+	 */
+	public String getDetail(){
+		return detail;
+	}
+	
+	/**
+	 *设置事项名称
+	 */
+	public void setDetail(String detail){
+		this.detail = detail;
+	}
+		/**
+	 *获取是否删除
+	 */
+	public Boolean getDelFlag(){
+		return delFlag;
+	}
+	
+	/**
+	 *设置是否删除
+	 */
+	public void setDelFlag(Boolean delFlag){
+		this.delFlag = delFlag;
+	}
+		/**
+	 *获取创建人
+	 */
+	public String getCreateBy(){
+		return createBy;
+	}
+	
+	/**
+	 *设置创建人
+	 */
+	public void setCreateBy(String createBy){
+		this.createBy = createBy;
+	}
+		@DateTimeFormat(pattern="yyyy-MM-dd HH:mm")
+	@JsonFormat(pattern = "yyyy-MM-dd HH:mm")
+		/**
+	 *获取创建时间
+	 */
+	public Date getCreateDate(){
+		return createDate;
+	}
+	
+	/**
+	 *设置创建时间
+	 */
+	public void setCreateDate(Date createDate){
+		this.createDate = createDate;
+	}
+		/**
+	 *获取更新人
+	 */
+	public String getUpdateBy(){
+		return updateBy;
+	}
+	
+	/**
+	 *设置更新人
+	 */
+	public void setUpdateBy(String updateBy){
+		this.updateBy = updateBy;
+	}
+		@DateTimeFormat(pattern="yyyy-MM-dd HH:mm")
+	@JsonFormat(pattern = "yyyy-MM-dd HH:mm")
+		/**
+	 *获取更新时间
+	 */
+	public Date getUpdateDate(){
+		return updateDate;
+	}
+	
+	/**
+	 *设置更新时间
+	 */
+	public void setUpdateDate(Date updateDate){
+		this.updateDate = updateDate;
+	}
+
+	public Integer getNo() {
+		return no;
+	}
+
+	public void setNo(Integer no) {
+		this.no = no;
+	}
+}

+ 150 - 0
src/main/java/com/jpsoft/ipcps/entity/ProcDefTemplate.java

@@ -0,0 +1,150 @@
+package com.jpsoft.ipcps.entity;
+
+import java.io.Serializable;
+import java.util.Date;
+import java.text.SimpleDateFormat;
+import java.math.BigDecimal;
+import org.springframework.format.annotation.DateTimeFormat;
+import com.fasterxml.jackson.annotation.JsonFormat;
+
+/**
+  描述:jp_procdef_template的实体类
+ */
+public class ProcDefTemplate {
+	private String id;
+	private String procDefKey;
+	private String title;
+	private Boolean delFlag;
+	private String createBy;
+	private Date createDate;
+	private String updateBy;
+	private Date updateDate;
+	private Boolean defaultFlag;
+	
+		/**
+	 *获取主键
+	 */
+	public String getId(){
+		return id;
+	}
+	
+	/**
+	 *设置主键
+	 */
+	public void setId(String id){
+		this.id = id;
+	}
+		/**
+	 *获取流程定义编号
+	 */
+	public String getProcDefKey(){
+		return procDefKey;
+	}
+	
+	/**
+	 *设置流程定义编号
+	 */
+	public void setProcDefKey(String procDefKey){
+		this.procDefKey = procDefKey;
+	}
+		/**
+	 *获取模板名称
+	 */
+	public String getTitle(){
+		return title;
+	}
+	
+	/**
+	 *设置模板名称
+	 */
+	public void setTitle(String title){
+		this.title = title;
+	}
+		/**
+	 *获取是否删除
+	 */
+	public Boolean getDelFlag(){
+		return delFlag;
+	}
+	
+	/**
+	 *设置是否删除
+	 */
+	public void setDelFlag(Boolean delFlag){
+		this.delFlag = delFlag;
+	}
+		/**
+	 *获取创建人
+	 */
+	public String getCreateBy(){
+		return createBy;
+	}
+	
+	/**
+	 *设置创建人
+	 */
+	public void setCreateBy(String createBy){
+		this.createBy = createBy;
+	}
+	@DateTimeFormat(pattern="yyyy-MM-dd HH:mm")
+	@JsonFormat(pattern = "yyyy-MM-dd HH:mm",timezone = "GMT+8")
+		/**
+	 *获取创建时间
+	 */
+	public Date getCreateDate(){
+		return createDate;
+	}
+	
+	/**
+	 *设置创建时间
+	 */
+	public void setCreateDate(Date createDate){
+		this.createDate = createDate;
+	}
+		/**
+	 *获取更新人
+	 */
+	public String getUpdateBy(){
+		return updateBy;
+	}
+	
+	/**
+	 *设置更新人
+	 */
+	public void setUpdateBy(String updateBy){
+		this.updateBy = updateBy;
+	}
+		@DateTimeFormat(pattern="yyyy-MM-dd HH:mm")
+	@JsonFormat(pattern = "yyyy-MM-dd HH:mm",timezone = "GMT+8")
+		/**
+	 *获取更新时间
+	 */
+	public Date getUpdateDate(){
+		return updateDate;
+	}
+	
+	/**
+	 *设置更新时间
+	 */
+	public void setUpdateDate(Date updateDate){
+		this.updateDate = updateDate;
+	}
+		/**
+	 *获取是否默认模板
+	 */
+	public Boolean getDefaultFlag(){
+		if (defaultFlag==null){
+			return false;
+		}
+		else {
+			return defaultFlag;
+		}
+	}
+	
+	/**
+	 *设置是否默认模板
+	 */
+	public void setDefaultFlag(Boolean defaultFlag){
+		this.defaultFlag = defaultFlag;
+	}
+}

+ 186 - 0
src/main/java/com/jpsoft/ipcps/entity/ProcDefTemplateStep.java

@@ -0,0 +1,186 @@
+package com.jpsoft.ipcps.entity;
+
+import java.io.Serializable;
+import java.util.Date;
+import java.text.SimpleDateFormat;
+import java.math.BigDecimal;
+import org.springframework.format.annotation.DateTimeFormat;
+import com.fasterxml.jackson.annotation.JsonFormat;
+
+/**
+  描述:jp_procdef_template_step的实体类
+ */
+public class ProcDefTemplateStep {
+	private String id;
+	private String templateId;
+	private String taskDefKey;
+	private String title;
+	private Integer day;
+	private Integer ignore;
+	private Boolean delFlag;
+	private Integer no;
+	private String createBy;
+	private Date createDate;
+	private String updateBy;
+	private Date updateDate;
+	
+		/**
+	 *获取主键
+	 */
+	public String getId(){
+		return id;
+	}
+	
+	/**
+	 *设置主键
+	 */
+	public void setId(String id){
+		this.id = id;
+	}
+		/**
+	 *获取模板编号
+	 */
+	public String getTemplateId(){
+		return templateId;
+	}
+	
+	/**
+	 *设置模板编号
+	 */
+	public void setTemplateId(String templateId){
+		this.templateId = templateId;
+	}
+		/**
+	 *获取
+	 */
+	public String getTaskDefKey(){
+		return taskDefKey;
+	}
+	
+	/**
+	 *设置
+	 */
+	public void setTaskDefKey(String taskDefKey){
+		this.taskDefKey = taskDefKey;
+	}
+		/**
+	 *获取步骤名称
+	 */
+	public String getTitle(){
+		return title;
+	}
+	
+	/**
+	 *设置步骤名称
+	 */
+	public void setTitle(String title){
+		this.title = title;
+	}
+		/**
+	 *获取预估完成工作日
+	 */
+	public Integer getDay(){
+		return day;
+	}
+	
+	/**
+	 *设置预估完成工作日
+	 */
+	public void setDay(Integer day){
+		this.day = day;
+	}
+		/**
+	 *获取是否忽略
+	 */
+	public Integer getIgnore(){
+		return ignore;
+	}
+	
+	/**
+	 *设置是否忽略
+	 */
+	public void setIgnore(Integer ignore){
+		this.ignore = ignore;
+	}
+		/**
+	 *获取是否删除
+	 */
+	public Boolean getDelFlag(){
+		return delFlag;
+	}
+	
+	/**
+	 *设置是否删除
+	 */
+	public void setDelFlag(Boolean delFlag){
+		this.delFlag = delFlag;
+	}
+		/**
+	 *获取创建人
+	 */
+	public String getCreateBy(){
+		return createBy;
+	}
+	
+	/**
+	 *设置创建人
+	 */
+	public void setCreateBy(String createBy){
+		this.createBy = createBy;
+	}
+		@DateTimeFormat(pattern="yyyy-MM-dd HH:mm")
+	@JsonFormat(pattern = "yyyy-MM-dd HH:mm")
+		/**
+	 *获取创建时间
+	 */
+	public Date getCreateDate(){
+		return createDate;
+	}
+	
+	/**
+	 *设置创建时间
+	 */
+	public void setCreateDate(Date createDate){
+		this.createDate = createDate;
+	}
+		/**
+	 *获取更新人
+	 */
+	public String getUpdateBy(){
+		return updateBy;
+	}
+	
+	/**
+	 *设置更新人
+	 */
+	public void setUpdateBy(String updateBy){
+		this.updateBy = updateBy;
+	}
+		@DateTimeFormat(pattern="yyyy-MM-dd HH:mm")
+	@JsonFormat(pattern = "yyyy-MM-dd HH:mm")
+		/**
+	 *获取更新时间
+	 */
+	public Date getUpdateDate(){
+		return updateDate;
+	}
+	
+	/**
+	 *设置更新时间
+	 */
+	public void setUpdateDate(Date updateDate){
+		this.updateDate = updateDate;
+	}
+
+	/**
+	 * 序号
+	 * @return
+	 */
+	public Integer getNo() {
+		return no;
+	}
+
+	public void setNo(Integer no) {
+		this.no = no;
+	}
+}

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