Quellcode durchsuchen

初始化仓库

wuyunfeng vor 2 Jahren
Commit
2f128a4c5c
100 geänderte Dateien mit 8607 neuen und 0 gelöschten Zeilen
  1. 33 0
      .gitignore
  2. BIN
      .mvn/wrapper/maven-wrapper.jar
  3. 2 0
      .mvn/wrapper/maven-wrapper.properties
  4. 316 0
      mvnw
  5. 188 0
      mvnw.cmd
  6. 229 0
      pom.xml
  7. 67 0
      src/main/java/com/wdkl/pdm/BaseSecurityConfig.java
  8. 41 0
      src/main/java/com/wdkl/pdm/ConfigSwagger2.java
  9. 114 0
      src/main/java/com/wdkl/pdm/DataSourceConfig.java
  10. 16 0
      src/main/java/com/wdkl/pdm/PdmApplication.java
  11. 32 0
      src/main/java/com/wdkl/pdm/WebConfig.java
  12. 66 0
      src/main/java/com/wdkl/pdm/context/ApplicationContextHolder.java
  13. 88 0
      src/main/java/com/wdkl/pdm/context/SnakeToCamelArgumentResolver.java
  14. 45 0
      src/main/java/com/wdkl/pdm/context/SnakeToCamelModelAttributeMethodProcessor.java
  15. 71 0
      src/main/java/com/wdkl/pdm/context/SnakeToCamelRequestDataBinder.java
  16. 48 0
      src/main/java/com/wdkl/pdm/context/SystemConfig.java
  17. 47 0
      src/main/java/com/wdkl/pdm/context/ThreadContextHolder.java
  18. 53 0
      src/main/java/com/wdkl/pdm/context/WdklRequestInterceptor.java
  19. 60 0
      src/main/java/com/wdkl/pdm/context/WebInterceptorConfigurer.java
  20. 52 0
      src/main/java/com/wdkl/pdm/controller/LoginController.java
  21. 40 0
      src/main/java/com/wdkl/pdm/controller/UploadController.java
  22. 81 0
      src/main/java/com/wdkl/pdm/controller/WdChipController.java
  23. 80 0
      src/main/java/com/wdkl/pdm/controller/WdCustomPrintController.java
  24. 81 0
      src/main/java/com/wdkl/pdm/controller/WdLabellanguageController.java
  25. 60 0
      src/main/java/com/wdkl/pdm/controller/WdMacDispatchRecordController.java
  26. 81 0
      src/main/java/com/wdkl/pdm/controller/WdPrintItemController.java
  27. 91 0
      src/main/java/com/wdkl/pdm/controller/WdPrintSolutionController.java
  28. 81 0
      src/main/java/com/wdkl/pdm/controller/WdPrintTemplateParamController.java
  29. 81 0
      src/main/java/com/wdkl/pdm/controller/WdPrintTemplateParamGroupController.java
  30. 80 0
      src/main/java/com/wdkl/pdm/controller/WdProduceFileController.java
  31. 82 0
      src/main/java/com/wdkl/pdm/controller/WdProduceVersionController.java
  32. 71 0
      src/main/java/com/wdkl/pdm/controller/WdProducedProductController.java
  33. 79 0
      src/main/java/com/wdkl/pdm/controller/WdProductCategoryController.java
  34. 80 0
      src/main/java/com/wdkl/pdm/controller/WdProductCategoryLabelPrefixController.java
  35. 84 0
      src/main/java/com/wdkl/pdm/controller/WdProductController.java
  36. 89 0
      src/main/java/com/wdkl/pdm/controller/WdThemometerProducedController.java
  37. 82 0
      src/main/java/com/wdkl/pdm/controller/WdThermometerCategoryController.java
  38. 82 0
      src/main/java/com/wdkl/pdm/controller/WdThermometerSchedualController.java
  39. 73 0
      src/main/java/com/wdkl/pdm/controller/WdUserController.java
  40. 46 0
      src/main/java/com/wdkl/pdm/database/CRUDBaseManager.java
  41. 34 0
      src/main/java/com/wdkl/pdm/database/ColumnMeta.java
  42. 43 0
      src/main/java/com/wdkl/pdm/database/DBRuntimeException.java
  43. 288 0
      src/main/java/com/wdkl/pdm/database/DaoSupport.java
  44. 45 0
      src/main/java/com/wdkl/pdm/database/DataMeta.java
  45. 21 0
      src/main/java/com/wdkl/pdm/database/DoubleMapper.java
  46. 29 0
      src/main/java/com/wdkl/pdm/database/DynamicField.java
  47. 17 0
      src/main/java/com/wdkl/pdm/database/ISqlFileExecutor.java
  48. 20 0
      src/main/java/com/wdkl/pdm/database/IntegerMapper.java
  49. 24 0
      src/main/java/com/wdkl/pdm/database/ObjectNotFoundException.java
  50. 138 0
      src/main/java/com/wdkl/pdm/database/Page.java
  51. 40 0
      src/main/java/com/wdkl/pdm/database/SqlMetaBuilder.java
  52. 21 0
      src/main/java/com/wdkl/pdm/database/StringMapper.java
  53. 21 0
      src/main/java/com/wdkl/pdm/database/annotation/Column.java
  54. 17 0
      src/main/java/com/wdkl/pdm/database/annotation/Id.java
  55. 17 0
      src/main/java/com/wdkl/pdm/database/annotation/NotDbField.java
  56. 17 0
      src/main/java/com/wdkl/pdm/database/annotation/PrimaryKeyField.java
  57. 21 0
      src/main/java/com/wdkl/pdm/database/annotation/Table.java
  58. 62 0
      src/main/java/com/wdkl/pdm/database/impl/CRUDBaseManagerImpl.java
  59. 603 0
      src/main/java/com/wdkl/pdm/database/impl/DaoSupportImpl.java
  60. 36 0
      src/main/java/com/wdkl/pdm/database/impl/FilterColumnMapRowMapper.java
  61. 25 0
      src/main/java/com/wdkl/pdm/database/impl/IRowMapperColumnFilter.java
  62. 19 0
      src/main/java/com/wdkl/pdm/database/impl/LowerCaseJdbcTemplate.java
  63. 36 0
      src/main/java/com/wdkl/pdm/database/impl/MySqlColumnMapRowMapper.java
  64. 90 0
      src/main/java/com/wdkl/pdm/database/impl/MySqlMetaBuilderImpl.java
  65. 51 0
      src/main/java/com/wdkl/pdm/database/impl/OracleColumnMapRowMapper.java
  66. 42 0
      src/main/java/com/wdkl/pdm/database/impl/SqlPaser.java
  67. 131 0
      src/main/java/com/wdkl/pdm/dos/WdChipDO.java
  68. 124 0
      src/main/java/com/wdkl/pdm/dos/WdCustomPrintDO.java
  69. 83 0
      src/main/java/com/wdkl/pdm/dos/WdLabelLanguageDO.java
  70. 113 0
      src/main/java/com/wdkl/pdm/dos/WdMacDispatchRecordDO.java
  71. 113 0
      src/main/java/com/wdkl/pdm/dos/WdPrintItemDO.java
  72. 113 0
      src/main/java/com/wdkl/pdm/dos/WdPrintSolutionDO.java
  73. 89 0
      src/main/java/com/wdkl/pdm/dos/WdPrintTemplateParamDO.java
  74. 101 0
      src/main/java/com/wdkl/pdm/dos/WdPrintTemplateParamGroupDO.java
  75. 249 0
      src/main/java/com/wdkl/pdm/dos/WdProduceFileDO.java
  76. 127 0
      src/main/java/com/wdkl/pdm/dos/WdProduceVersionDO.java
  77. 96 0
      src/main/java/com/wdkl/pdm/dos/WdProducedProductDO.java
  78. 114 0
      src/main/java/com/wdkl/pdm/dos/WdProductCategoryDO.java
  79. 113 0
      src/main/java/com/wdkl/pdm/dos/WdProductCategoryLabelPrefixDO.java
  80. 319 0
      src/main/java/com/wdkl/pdm/dos/WdProductDO.java
  81. 199 0
      src/main/java/com/wdkl/pdm/dos/WdThemometerProducedDO.java
  82. 127 0
      src/main/java/com/wdkl/pdm/dos/WdThermometerCategoryDO.java
  83. 83 0
      src/main/java/com/wdkl/pdm/dos/WdThermometerSchedualDO.java
  84. 83 0
      src/main/java/com/wdkl/pdm/dos/WdUsersDO.java
  85. 76 0
      src/main/java/com/wdkl/pdm/exception/ErrorMessage.java
  86. 54 0
      src/main/java/com/wdkl/pdm/exception/ErrorMessageWithData.java
  87. 102 0
      src/main/java/com/wdkl/pdm/exception/JavashopExceptionHandler.java
  88. 20 0
      src/main/java/com/wdkl/pdm/exception/NoPermissionException.java
  89. 21 0
      src/main/java/com/wdkl/pdm/exception/ResourceNotFoundException.java
  90. 57 0
      src/main/java/com/wdkl/pdm/exception/ServiceException.java
  91. 30 0
      src/main/java/com/wdkl/pdm/exception/SystemErrorCodeV1.java
  92. 17 0
      src/main/java/com/wdkl/pdm/exception/ValidateConfig.java
  93. 14 0
      src/main/java/com/wdkl/pdm/mvc/Filter.java
  94. 129 0
      src/main/java/com/wdkl/pdm/mvc/GridParameter.java
  95. 323 0
      src/main/java/com/wdkl/pdm/mvc/GridParameterParser.java
  96. 56 0
      src/main/java/com/wdkl/pdm/mvc/JsonResponse.java
  97. 62 0
      src/main/java/com/wdkl/pdm/security/AccessDeniedFormatConfig.java
  98. 72 0
      src/main/java/com/wdkl/pdm/security/PathFilter.java
  99. 328 0
      src/main/java/com/wdkl/pdm/security/RSAUtils.java
  100. 0 0
      src/main/java/com/wdkl/pdm/security/SecretDESUtil.java

+ 33 - 0
.gitignore

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

BIN
.mvn/wrapper/maven-wrapper.jar


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

@@ -0,0 +1,2 @@
+distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.8.4/apache-maven-3.8.4-bin.zip
+wrapperUrl=https://repo.maven.apache.org/maven2/org/apache/maven/wrapper/maven-wrapper/3.1.0/maven-wrapper-3.1.0.jar

+ 316 - 0
mvnw

@@ -0,0 +1,316 @@
+#!/bin/sh
+# ----------------------------------------------------------------------------
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#    https://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+# ----------------------------------------------------------------------------
+
+# ----------------------------------------------------------------------------
+# Maven Start Up Batch script
+#
+# Required ENV vars:
+# ------------------
+#   JAVA_HOME - location of a JDK home dir
+#
+# Optional ENV vars
+# -----------------
+#   M2_HOME - location of maven2's installed home dir
+#   MAVEN_OPTS - parameters passed to the Java VM when running Maven
+#     e.g. to debug Maven itself, use
+#       set MAVEN_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000
+#   MAVEN_SKIP_RC - flag to disable loading of mavenrc files
+# ----------------------------------------------------------------------------
+
+if [ -z "$MAVEN_SKIP_RC" ] ; then
+
+  if [ -f /usr/local/etc/mavenrc ] ; then
+    . /usr/local/etc/mavenrc
+  fi
+
+  if [ -f /etc/mavenrc ] ; then
+    . /etc/mavenrc
+  fi
+
+  if [ -f "$HOME/.mavenrc" ] ; then
+    . "$HOME/.mavenrc"
+  fi
+
+fi
+
+# OS specific support.  $var _must_ be set to either true or false.
+cygwin=false;
+darwin=false;
+mingw=false
+case "`uname`" in
+  CYGWIN*) cygwin=true ;;
+  MINGW*) mingw=true;;
+  Darwin*) darwin=true
+    # Use /usr/libexec/java_home if available, otherwise fall back to /Library/Java/Home
+    # See https://developer.apple.com/library/mac/qa/qa1170/_index.html
+    if [ -z "$JAVA_HOME" ]; then
+      if [ -x "/usr/libexec/java_home" ]; then
+        export JAVA_HOME="`/usr/libexec/java_home`"
+      else
+        export JAVA_HOME="/Library/Java/Home"
+      fi
+    fi
+    ;;
+esac
+
+if [ -z "$JAVA_HOME" ] ; then
+  if [ -r /etc/gentoo-release ] ; then
+    JAVA_HOME=`java-config --jre-home`
+  fi
+fi
+
+if [ -z "$M2_HOME" ] ; then
+  ## resolve links - $0 may be a link to maven's home
+  PRG="$0"
+
+  # need this for relative symlinks
+  while [ -h "$PRG" ] ; do
+    ls=`ls -ld "$PRG"`
+    link=`expr "$ls" : '.*-> \(.*\)$'`
+    if expr "$link" : '/.*' > /dev/null; then
+      PRG="$link"
+    else
+      PRG="`dirname "$PRG"`/$link"
+    fi
+  done
+
+  saveddir=`pwd`
+
+  M2_HOME=`dirname "$PRG"`/..
+
+  # make it fully qualified
+  M2_HOME=`cd "$M2_HOME" && pwd`
+
+  cd "$saveddir"
+  # echo Using m2 at $M2_HOME
+fi
+
+# For Cygwin, ensure paths are in UNIX format before anything is touched
+if $cygwin ; then
+  [ -n "$M2_HOME" ] &&
+    M2_HOME=`cygpath --unix "$M2_HOME"`
+  [ -n "$JAVA_HOME" ] &&
+    JAVA_HOME=`cygpath --unix "$JAVA_HOME"`
+  [ -n "$CLASSPATH" ] &&
+    CLASSPATH=`cygpath --path --unix "$CLASSPATH"`
+fi
+
+# For Mingw, ensure paths are in UNIX format before anything is touched
+if $mingw ; then
+  [ -n "$M2_HOME" ] &&
+    M2_HOME="`(cd "$M2_HOME"; pwd)`"
+  [ -n "$JAVA_HOME" ] &&
+    JAVA_HOME="`(cd "$JAVA_HOME"; pwd)`"
+fi
+
+if [ -z "$JAVA_HOME" ]; then
+  javaExecutable="`which javac`"
+  if [ -n "$javaExecutable" ] && ! [ "`expr \"$javaExecutable\" : '\([^ ]*\)'`" = "no" ]; then
+    # readlink(1) is not available as standard on Solaris 10.
+    readLink=`which readlink`
+    if [ ! `expr "$readLink" : '\([^ ]*\)'` = "no" ]; then
+      if $darwin ; then
+        javaHome="`dirname \"$javaExecutable\"`"
+        javaExecutable="`cd \"$javaHome\" && pwd -P`/javac"
+      else
+        javaExecutable="`readlink -f \"$javaExecutable\"`"
+      fi
+      javaHome="`dirname \"$javaExecutable\"`"
+      javaHome=`expr "$javaHome" : '\(.*\)/bin'`
+      JAVA_HOME="$javaHome"
+      export JAVA_HOME
+    fi
+  fi
+fi
+
+if [ -z "$JAVACMD" ] ; then
+  if [ -n "$JAVA_HOME"  ] ; then
+    if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
+      # IBM's JDK on AIX uses strange locations for the executables
+      JAVACMD="$JAVA_HOME/jre/sh/java"
+    else
+      JAVACMD="$JAVA_HOME/bin/java"
+    fi
+  else
+    JAVACMD="`\\unset -f command; \\command -v java`"
+  fi
+fi
+
+if [ ! -x "$JAVACMD" ] ; then
+  echo "Error: JAVA_HOME is not defined correctly." >&2
+  echo "  We cannot execute $JAVACMD" >&2
+  exit 1
+fi
+
+if [ -z "$JAVA_HOME" ] ; then
+  echo "Warning: JAVA_HOME environment variable is not set."
+fi
+
+CLASSWORLDS_LAUNCHER=org.codehaus.plexus.classworlds.launcher.Launcher
+
+# traverses directory structure from process work directory to filesystem root
+# first directory with .mvn subdirectory is considered project base directory
+find_maven_basedir() {
+
+  if [ -z "$1" ]
+  then
+    echo "Path not specified to find_maven_basedir"
+    return 1
+  fi
+
+  basedir="$1"
+  wdir="$1"
+  while [ "$wdir" != '/' ] ; do
+    if [ -d "$wdir"/.mvn ] ; then
+      basedir=$wdir
+      break
+    fi
+    # workaround for JBEAP-8937 (on Solaris 10/Sparc)
+    if [ -d "${wdir}" ]; then
+      wdir=`cd "$wdir/.."; pwd`
+    fi
+    # end of workaround
+  done
+  echo "${basedir}"
+}
+
+# concatenates all lines of a file
+concat_lines() {
+  if [ -f "$1" ]; then
+    echo "$(tr -s '\n' ' ' < "$1")"
+  fi
+}
+
+BASE_DIR=`find_maven_basedir "$(pwd)"`
+if [ -z "$BASE_DIR" ]; then
+  exit 1;
+fi
+
+##########################################################################################
+# Extension to allow automatically downloading the maven-wrapper.jar from Maven-central
+# This allows using the maven wrapper in projects that prohibit checking in binary data.
+##########################################################################################
+if [ -r "$BASE_DIR/.mvn/wrapper/maven-wrapper.jar" ]; then
+    if [ "$MVNW_VERBOSE" = true ]; then
+      echo "Found .mvn/wrapper/maven-wrapper.jar"
+    fi
+else
+    if [ "$MVNW_VERBOSE" = true ]; then
+      echo "Couldn't find .mvn/wrapper/maven-wrapper.jar, downloading it ..."
+    fi
+    if [ -n "$MVNW_REPOURL" ]; then
+      jarUrl="$MVNW_REPOURL/org/apache/maven/wrapper/maven-wrapper/3.1.0/maven-wrapper-3.1.0.jar"
+    else
+      jarUrl="https://repo.maven.apache.org/maven2/org/apache/maven/wrapper/maven-wrapper/3.1.0/maven-wrapper-3.1.0.jar"
+    fi
+    while IFS="=" read key value; do
+      case "$key" in (wrapperUrl) jarUrl="$value"; break ;;
+      esac
+    done < "$BASE_DIR/.mvn/wrapper/maven-wrapper.properties"
+    if [ "$MVNW_VERBOSE" = true ]; then
+      echo "Downloading from: $jarUrl"
+    fi
+    wrapperJarPath="$BASE_DIR/.mvn/wrapper/maven-wrapper.jar"
+    if $cygwin; then
+      wrapperJarPath=`cygpath --path --windows "$wrapperJarPath"`
+    fi
+
+    if command -v wget > /dev/null; then
+        if [ "$MVNW_VERBOSE" = true ]; then
+          echo "Found wget ... using wget"
+        fi
+        if [ -z "$MVNW_USERNAME" ] || [ -z "$MVNW_PASSWORD" ]; then
+            wget "$jarUrl" -O "$wrapperJarPath" || rm -f "$wrapperJarPath"
+        else
+            wget --http-user=$MVNW_USERNAME --http-password=$MVNW_PASSWORD "$jarUrl" -O "$wrapperJarPath" || rm -f "$wrapperJarPath"
+        fi
+    elif command -v curl > /dev/null; then
+        if [ "$MVNW_VERBOSE" = true ]; then
+          echo "Found curl ... using curl"
+        fi
+        if [ -z "$MVNW_USERNAME" ] || [ -z "$MVNW_PASSWORD" ]; then
+            curl -o "$wrapperJarPath" "$jarUrl" -f
+        else
+            curl --user $MVNW_USERNAME:$MVNW_PASSWORD -o "$wrapperJarPath" "$jarUrl" -f
+        fi
+
+    else
+        if [ "$MVNW_VERBOSE" = true ]; then
+          echo "Falling back to using Java to download"
+        fi
+        javaClass="$BASE_DIR/.mvn/wrapper/MavenWrapperDownloader.java"
+        # For Cygwin, switch paths to Windows format before running javac
+        if $cygwin; then
+          javaClass=`cygpath --path --windows "$javaClass"`
+        fi
+        if [ -e "$javaClass" ]; then
+            if [ ! -e "$BASE_DIR/.mvn/wrapper/MavenWrapperDownloader.class" ]; then
+                if [ "$MVNW_VERBOSE" = true ]; then
+                  echo " - Compiling MavenWrapperDownloader.java ..."
+                fi
+                # Compiling the Java class
+                ("$JAVA_HOME/bin/javac" "$javaClass")
+            fi
+            if [ -e "$BASE_DIR/.mvn/wrapper/MavenWrapperDownloader.class" ]; then
+                # Running the downloader
+                if [ "$MVNW_VERBOSE" = true ]; then
+                  echo " - Running MavenWrapperDownloader.java ..."
+                fi
+                ("$JAVA_HOME/bin/java" -cp .mvn/wrapper MavenWrapperDownloader "$MAVEN_PROJECTBASEDIR")
+            fi
+        fi
+    fi
+fi
+##########################################################################################
+# End of extension
+##########################################################################################
+
+export MAVEN_PROJECTBASEDIR=${MAVEN_BASEDIR:-"$BASE_DIR"}
+if [ "$MVNW_VERBOSE" = true ]; then
+  echo $MAVEN_PROJECTBASEDIR
+fi
+MAVEN_OPTS="$(concat_lines "$MAVEN_PROJECTBASEDIR/.mvn/jvm.config") $MAVEN_OPTS"
+
+# For Cygwin, switch paths to Windows format before running java
+if $cygwin; then
+  [ -n "$M2_HOME" ] &&
+    M2_HOME=`cygpath --path --windows "$M2_HOME"`
+  [ -n "$JAVA_HOME" ] &&
+    JAVA_HOME=`cygpath --path --windows "$JAVA_HOME"`
+  [ -n "$CLASSPATH" ] &&
+    CLASSPATH=`cygpath --path --windows "$CLASSPATH"`
+  [ -n "$MAVEN_PROJECTBASEDIR" ] &&
+    MAVEN_PROJECTBASEDIR=`cygpath --path --windows "$MAVEN_PROJECTBASEDIR"`
+fi
+
+# Provide a "standardized" way to retrieve the CLI args that will
+# work with both Windows and non-Windows executions.
+MAVEN_CMD_LINE_ARGS="$MAVEN_CONFIG $@"
+export MAVEN_CMD_LINE_ARGS
+
+WRAPPER_LAUNCHER=org.apache.maven.wrapper.MavenWrapperMain
+
+exec "$JAVACMD" \
+  $MAVEN_OPTS \
+  $MAVEN_DEBUG_OPTS \
+  -classpath "$MAVEN_PROJECTBASEDIR/.mvn/wrapper/maven-wrapper.jar" \
+  "-Dmaven.home=${M2_HOME}" \
+  "-Dmaven.multiModuleProjectDirectory=${MAVEN_PROJECTBASEDIR}" \
+  ${WRAPPER_LAUNCHER} $MAVEN_CONFIG "$@"

+ 188 - 0
mvnw.cmd

@@ -0,0 +1,188 @@
+@REM ----------------------------------------------------------------------------
+@REM Licensed to the Apache Software Foundation (ASF) under one
+@REM or more contributor license agreements.  See the NOTICE file
+@REM distributed with this work for additional information
+@REM regarding copyright ownership.  The ASF licenses this file
+@REM to you under the Apache License, Version 2.0 (the
+@REM "License"); you may not use this file except in compliance
+@REM with the License.  You may obtain a copy of the License at
+@REM
+@REM    https://www.apache.org/licenses/LICENSE-2.0
+@REM
+@REM Unless required by applicable law or agreed to in writing,
+@REM software distributed under the License is distributed on an
+@REM "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+@REM KIND, either express or implied.  See the License for the
+@REM specific language governing permissions and limitations
+@REM under the License.
+@REM ----------------------------------------------------------------------------
+
+@REM ----------------------------------------------------------------------------
+@REM Maven Start Up Batch script
+@REM
+@REM Required ENV vars:
+@REM JAVA_HOME - location of a JDK home dir
+@REM
+@REM Optional ENV vars
+@REM M2_HOME - location of maven2's installed home dir
+@REM MAVEN_BATCH_ECHO - set to 'on' to enable the echoing of the batch commands
+@REM MAVEN_BATCH_PAUSE - set to 'on' to wait for a keystroke before ending
+@REM MAVEN_OPTS - parameters passed to the Java VM when running Maven
+@REM     e.g. to debug Maven itself, use
+@REM set MAVEN_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000
+@REM MAVEN_SKIP_RC - flag to disable loading of mavenrc files
+@REM ----------------------------------------------------------------------------
+
+@REM Begin all REM lines with '@' in case MAVEN_BATCH_ECHO is 'on'
+@echo off
+@REM set title of command window
+title %0
+@REM enable echoing by setting MAVEN_BATCH_ECHO to 'on'
+@if "%MAVEN_BATCH_ECHO%" == "on"  echo %MAVEN_BATCH_ECHO%
+
+@REM set %HOME% to equivalent of $HOME
+if "%HOME%" == "" (set "HOME=%HOMEDRIVE%%HOMEPATH%")
+
+@REM Execute a user defined script before this one
+if not "%MAVEN_SKIP_RC%" == "" goto skipRcPre
+@REM check for pre script, once with legacy .bat ending and once with .cmd ending
+if exist "%USERPROFILE%\mavenrc_pre.bat" call "%USERPROFILE%\mavenrc_pre.bat" %*
+if exist "%USERPROFILE%\mavenrc_pre.cmd" call "%USERPROFILE%\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/org/apache/maven/wrapper/maven-wrapper/3.1.0/maven-wrapper-3.1.0.jar"
+
+FOR /F "usebackq tokens=1,2 delims==" %%A IN ("%MAVEN_PROJECTBASEDIR%\.mvn\wrapper\maven-wrapper.properties") DO (
+    IF "%%A"=="wrapperUrl" SET DOWNLOAD_URL=%%B
+)
+
+@REM Extension to allow automatically downloading the maven-wrapper.jar from Maven-central
+@REM This allows using the maven wrapper in projects that prohibit checking in binary data.
+if exist %WRAPPER_JAR% (
+    if "%MVNW_VERBOSE%" == "true" (
+        echo Found %WRAPPER_JAR%
+    )
+) else (
+    if not "%MVNW_REPOURL%" == "" (
+        SET DOWNLOAD_URL="%MVNW_REPOURL%/org/apache/maven/wrapper/maven-wrapper/3.1.0/maven-wrapper-3.1.0.jar"
+    )
+    if "%MVNW_VERBOSE%" == "true" (
+        echo Couldn't find %WRAPPER_JAR%, downloading it ...
+        echo Downloading from: %DOWNLOAD_URL%
+    )
+
+    powershell -Command "&{"^
+		"$webclient = new-object System.Net.WebClient;"^
+		"if (-not ([string]::IsNullOrEmpty('%MVNW_USERNAME%') -and [string]::IsNullOrEmpty('%MVNW_PASSWORD%'))) {"^
+		"$webclient.Credentials = new-object System.Net.NetworkCredential('%MVNW_USERNAME%', '%MVNW_PASSWORD%');"^
+		"}"^
+		"[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; $webclient.DownloadFile('%DOWNLOAD_URL%', '%WRAPPER_JAR%')"^
+		"}"
+    if "%MVNW_VERBOSE%" == "true" (
+        echo Finished downloading %WRAPPER_JAR%
+    )
+)
+@REM End of extension
+
+@REM Provide a "standardized" way to retrieve the CLI args that will
+@REM work with both Windows and non-Windows executions.
+set MAVEN_CMD_LINE_ARGS=%*
+
+%MAVEN_JAVA_EXE% ^
+  %JVM_CONFIG_MAVEN_PROPS% ^
+  %MAVEN_OPTS% ^
+  %MAVEN_DEBUG_OPTS% ^
+  -classpath %WRAPPER_JAR% ^
+  "-Dmaven.multiModuleProjectDirectory=%MAVEN_PROJECTBASEDIR%" ^
+  %WRAPPER_LAUNCHER% %MAVEN_CONFIG% %*
+if ERRORLEVEL 1 goto error
+goto end
+
+:error
+set ERROR_CODE=1
+
+:end
+@endlocal & set ERROR_CODE=%ERROR_CODE%
+
+if not "%MAVEN_SKIP_RC%"=="" goto skipRcPost
+@REM check for post script, once with legacy .bat ending and once with .cmd ending
+if exist "%USERPROFILE%\mavenrc_post.bat" call "%USERPROFILE%\mavenrc_post.bat"
+if exist "%USERPROFILE%\mavenrc_post.cmd" call "%USERPROFILE%\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%
+
+cmd /C exit /B %ERROR_CODE%

+ 229 - 0
pom.xml

@@ -0,0 +1,229 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
+    <modelVersion>4.0.0</modelVersion>
+    <parent>
+        <groupId>org.springframework.boot</groupId>
+        <artifactId>spring-boot-starter-parent</artifactId>
+        <version>2.0.1.RELEASE</version>
+        <relativePath/> <!-- lookup parent from repository -->
+    </parent>
+    <groupId>com.wdkl</groupId>
+    <artifactId>pdm</artifactId>
+    <version>0.0.1-SNAPSHOT</version>
+    <name>pdm</name>
+    <description>维鼎康联生产工具服务器端</description>
+    <properties>
+        <java.version>1.8</java.version>
+    </properties>
+    <dependencies>
+        <dependency>
+            <groupId>com.googlecode.owasp-java-html-sanitizer</groupId>
+            <artifactId>owasp-java-html-sanitizer</artifactId>
+            <version>r136</version>
+        </dependency>
+        <dependency>
+            <groupId>com.google.guava</groupId>
+            <artifactId>guava</artifactId>
+            <version>26.0-jre</version>
+        </dependency>
+        <dependency>
+            <groupId>org.jsoup</groupId>
+            <artifactId>jsoup</artifactId>
+            <version>1.11.3</version>
+        </dependency>
+        <dependency>
+            <groupId>org.springframework.boot</groupId>
+            <artifactId>spring-boot-starter-web</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.springframework.boot</groupId>
+            <artifactId>spring-boot-starter-jdbc</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.springframework.boot</groupId>
+            <artifactId>spring-boot-configuration-processor</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.springframework.boot</groupId>
+            <artifactId>spring-boot-starter-data-redis</artifactId>
+        </dependency>
+        <!--<dependency>-->
+            <!--<groupId>org.springframework.boot</groupId>-->
+            <!--<artifactId>spring-boot-starter-amqp</artifactId>-->
+        <!--</dependency>-->
+
+        <dependency>
+            <groupId>org.springframework.boot</groupId>
+            <artifactId>spring-boot-starter-actuator</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.springframework.boot</groupId>
+            <artifactId>spring-boot-starter-test</artifactId>
+        </dependency>
+
+
+        <dependency>
+            <groupId>com.alibaba</groupId>
+            <artifactId>druid-spring-boot-starter</artifactId>
+            <version>1.1.9</version>
+        </dependency>
+        <dependency>
+            <groupId>mysql</groupId>
+            <artifactId>mysql-connector-java</artifactId>
+        </dependency>
+        <!-- https://mvnrepository.com/artifact/com.microsoft.sqlserver/mssql-jdbc -->
+        <dependency>
+            <groupId>com.microsoft.sqlserver</groupId>
+            <artifactId>mssql-jdbc</artifactId>
+            <version>8.2.2.jre8</version>
+        </dependency>
+
+
+        <dependency>
+            <groupId>com.google.code.gson</groupId>
+            <artifactId>gson</artifactId>
+            <version>2.8.2</version>
+        </dependency>
+        <dependency>
+            <groupId>commons-beanutils</groupId>
+            <artifactId>commons-beanutils</artifactId>
+            <version>1.8.0</version>
+        </dependency>
+
+        <dependency>
+            <groupId>commons-codec</groupId>
+            <artifactId>commons-codec</artifactId>
+            <version>1.10</version>
+        </dependency>
+
+
+        <dependency>
+            <groupId>com.aliyun.oss</groupId>
+            <artifactId>aliyun-sdk-oss</artifactId>
+            <version>2.6.1</version>
+        </dependency>
+
+
+        <dependency>
+            <groupId>io.jsonwebtoken</groupId>
+            <artifactId>jjwt</artifactId>
+            <version>0.7.0</version>
+        </dependency>
+        <dependency>
+            <groupId>io.springfox</groupId>
+            <artifactId>springfox-swagger2</artifactId>
+            <version>2.8.0</version>
+        </dependency>
+        <dependency>
+            <groupId>io.springfox</groupId>
+            <artifactId>springfox-swagger-ui</artifactId>
+            <version>2.8.0</version>
+        </dependency>
+
+        <dependency>
+            <groupId>io.springfox</groupId>
+            <artifactId>springfox-bean-validators</artifactId>
+            <version>2.9.2</version>
+        </dependency>
+
+        <dependency>
+            <groupId>redis.clients</groupId>
+            <artifactId>jedis</artifactId>
+            <version>2.9.0</version>
+            <exclusions>
+                <exclusion>
+                    <groupId>org.apache.commons</groupId>
+                    <artifactId>commons-pool2</artifactId>
+                </exclusion>
+            </exclusions>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.commons</groupId>
+            <artifactId>commons-pool2</artifactId>
+            <version>2.5.0</version>
+        </dependency>
+
+        <dependency>
+            <groupId>org.aspectj</groupId>
+            <artifactId>aspectjweaver</artifactId>
+            <version>1.8.9</version>
+        </dependency>
+
+        <dependency>
+            <groupId>org.redisson</groupId>
+            <artifactId>redisson</artifactId>
+            <version>3.5.5</version>
+        </dependency>
+
+        <dependency>
+            <groupId>org.hibernate.validator</groupId>
+            <artifactId>hibernate-validator</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.ant</groupId>
+            <artifactId>ant</artifactId>
+            <version>1.10.2</version>
+        </dependency>
+
+        <dependency>
+            <groupId>commons-io</groupId>
+            <artifactId>commons-io</artifactId>
+            <version>2.6</version>
+        </dependency>
+
+        <dependency>
+            <groupId>javax.mail</groupId>
+            <artifactId>mail</artifactId>
+            <version>1.4.1</version>
+        </dependency>
+
+        <dependency>
+            <groupId>org.mockito</groupId>
+            <artifactId>mockito-core</artifactId>
+            <version>2.18.3</version>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.poi</groupId>
+            <artifactId>poi-ooxml</artifactId>
+            <version>3.17</version>
+        </dependency>
+        <dependency>
+            <groupId>javax.xml.bind</groupId>
+            <artifactId>jaxb-api</artifactId>
+            <version>2.3.0</version>
+        </dependency>
+
+        <dependency>
+            <groupId>com.github.xiaoymin</groupId>
+            <artifactId>swagger-bootstrap-ui</artifactId>
+            <version>1.9.3</version>
+        </dependency>
+
+        <dependency>
+            <groupId>com.alibaba</groupId>
+            <artifactId>fastjson</artifactId>
+            <version>1.2.68</version>
+        </dependency>
+        <dependency>
+            <groupId>org.mongodb</groupId>
+            <artifactId>bson</artifactId>
+            <version>3.6.3</version>
+        </dependency>
+        <dependency>
+            <groupId>org.springframework.boot</groupId>
+            <artifactId>spring-boot-starter-security</artifactId>
+        </dependency>
+    </dependencies>
+
+    <build>
+        <plugins>
+            <plugin>
+                <groupId>org.springframework.boot</groupId>
+                <artifactId>spring-boot-maven-plugin</artifactId>
+            </plugin>
+        </plugins>
+    </build>
+
+</project>

+ 67 - 0
src/main/java/com/wdkl/pdm/BaseSecurityConfig.java

@@ -0,0 +1,67 @@
+package com.wdkl.pdm;
+
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.context.annotation.Bean;
+import org.springframework.context.annotation.Configuration;
+import org.springframework.security.config.annotation.web.builders.HttpSecurity;
+import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity;
+import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter;
+import org.springframework.security.config.http.SessionCreationPolicy;
+import org.springframework.security.web.AuthenticationEntryPoint;
+import org.springframework.security.web.access.AccessDeniedHandler;
+import org.springframework.web.cors.CorsConfiguration;
+import org.springframework.web.cors.CorsConfigurationSource;
+import org.springframework.web.cors.UrlBasedCorsConfigurationSource;
+
+/**
+ * 描述
+ *
+ * @author allen
+ * 2020-09-04 17:43
+ */
+@Configuration
+@EnableWebSecurity
+public class BaseSecurityConfig extends WebSecurityConfigurerAdapter {
+    @Autowired
+    private AccessDeniedHandler accessDeniedHandler;
+
+    @Autowired
+    private AuthenticationEntryPoint authenticationEntryPoint;
+
+    @Override
+    protected void configure(HttpSecurity http) throws Exception {
+
+
+        http.cors().and().csrf().disable()
+                //禁用session
+                .sessionManagement().sessionCreationPolicy(SessionCreationPolicy.STATELESS).and()
+
+                //定义验权失败返回格式
+                .exceptionHandling().accessDeniedHandler( accessDeniedHandler ).authenticationEntryPoint(authenticationEntryPoint).and()
+
+                .authorizeRequests().anyRequest().anonymous().and().headers().frameOptions().disable().and().headers().cacheControl();
+
+        //过滤掉swagger的路径
+        http.authorizeRequests().antMatchers("/v2/api-docs", "/configuration/ui", "/swagger-resources", "/configuration/security", "/swagger-ui.html", "/webjars/**").anonymous();
+
+    }
+
+
+
+
+    /**
+     * 定义跨域配置
+     * @return
+     */
+    @Bean
+    CorsConfigurationSource corsConfigurationSource() {
+        UrlBasedCorsConfigurationSource source = new UrlBasedCorsConfigurationSource();
+        CorsConfiguration config = new CorsConfiguration();
+        config.setAllowCredentials(true);
+        config.addAllowedOrigin(CorsConfiguration.ALL);
+        config.addAllowedHeader(CorsConfiguration.ALL);
+        config.addAllowedMethod(CorsConfiguration.ALL);
+        source.registerCorsConfiguration("/**", config);
+        return source;
+    }
+}

+ 41 - 0
src/main/java/com/wdkl/pdm/ConfigSwagger2.java

@@ -0,0 +1,41 @@
+package com.wdkl.pdm;
+
+import org.springframework.context.annotation.Bean;
+import org.springframework.context.annotation.Configuration;
+import springfox.documentation.builders.ApiInfoBuilder;
+import springfox.documentation.builders.PathSelectors;
+import springfox.documentation.builders.RequestHandlerSelectors;
+import springfox.documentation.service.ApiInfo;
+import springfox.documentation.service.Contact;
+import springfox.documentation.spi.DocumentationType;
+import springfox.documentation.spring.web.plugins.Docket;
+import springfox.documentation.swagger2.annotations.EnableSwagger2;
+
+/**
+ * 描述
+ *
+ * @author allen
+ * 2020-09-07 17:22
+ */
+@Configuration
+@EnableSwagger2
+public class ConfigSwagger2 {
+    private ApiInfo apiInfo() {
+        return new ApiInfoBuilder()
+                .title("生产工具接口")
+                .description("生产工具接口")
+                .version("1.0.0")
+                .contact(new Contact("WDKL", "http://www.wdklian.com", "service@wdklian.com"))
+                .build();
+    }
+//
+    @Bean
+    public Docket docket() {
+        return new Docket(DocumentationType.SWAGGER_2)
+                .apiInfo(apiInfo())
+                .select()
+                .apis(RequestHandlerSelectors.basePackage("com.wdkl.pdm"))
+                .paths(PathSelectors.any())
+                .build();
+    }
+}

+ 114 - 0
src/main/java/com/wdkl/pdm/DataSourceConfig.java

@@ -0,0 +1,114 @@
+package com.wdkl.pdm;
+
+import com.alibaba.druid.spring.boot.autoconfigure.DruidDataSourceBuilder;
+import com.wdkl.pdm.database.DaoSupport;
+import com.wdkl.pdm.database.impl.DaoSupportImpl;
+import org.springframework.beans.factory.annotation.Qualifier;
+import org.springframework.boot.context.properties.ConfigurationProperties;
+import org.springframework.context.annotation.Bean;
+import org.springframework.context.annotation.Configuration;
+import org.springframework.context.annotation.Primary;
+import org.springframework.jdbc.core.JdbcTemplate;
+import org.springframework.jdbc.datasource.DataSourceTransactionManager;
+import org.springframework.transaction.PlatformTransactionManager;
+
+import javax.sql.DataSource;
+
+
+/**
+ * Created by Allen
+ */
+@Configuration
+public class DataSourceConfig {
+
+    /*----------------------------------------------------------------------------*/
+    /*                           DaoSupport配置                                    */
+    /*----------------------------------------------------------------------------*/
+
+    /**
+     * 系统daoSupport
+     * @param jdbcTemplate 系统 jdbcTemplate
+     * @return
+     */
+    @Primary
+    @Bean(name = "systemDaoSupport")
+    public DaoSupport systemDaoSupport(@Qualifier("systemJdbcTemplate") JdbcTemplate jdbcTemplate) {
+        DaoSupport daosupport = new DaoSupportImpl(jdbcTemplate);
+        return daosupport;
+    }
+
+//    @Bean(name = "oldDaoSupport")
+//    public DaoSupport oldDaoSupport(@Qualifier("oldJdbcTemplate") JdbcTemplate jdbcTemplate) {
+//        DaoSupport daosupport = new DaoSupportImpl(jdbcTemplate);
+//        return daosupport;
+//    }
+//
+
+
+    /*----------------------------------------------------------------------------*/
+    /*                           JdbcTemplate 配置                                */
+    /*----------------------------------------------------------------------------*/
+
+
+    /**
+     * 系统jdbcTemplate
+     * @param dataSource 系统数据源
+     * @return
+     */
+    @Primary
+    @Bean(name = "systemJdbcTemplate")
+    public JdbcTemplate systemJdbcTemplate(
+            @Qualifier("systemDataSource") DataSource dataSource) {
+        return new JdbcTemplate(dataSource);
+    }
+
+//    @Bean(name = "oldJdbcTemplate")
+//    public JdbcTemplate oldJdbcTemplate(
+//            @Qualifier("oldDataSource") DataSource dataSource) {
+//        return new JdbcTemplate(dataSource);
+//    }
+
+    /*----------------------------------------------------------------------------*/
+    /*                           数据源配置                                        */
+    /*----------------------------------------------------------------------------*/
+
+    /**
+     * 系统数据源
+     * @return
+     */
+    @Primary
+    @Bean(name = "systemDataSource")
+    @Qualifier("systemDataSource")
+    @ConfigurationProperties(prefix="spring.datasource.druid.system")
+    public DataSource systemDataSource() {
+        return DruidDataSourceBuilder.create().build();
+    }
+
+
+//    @Bean(name = "oldDataSource")
+//    @Qualifier("oldDataSource")
+//    @ConfigurationProperties(prefix="spring.datasource.druid.old")
+//    public DataSource oldDataSource() {
+//        return DruidDataSourceBuilder.create().build();
+//    }
+
+    /*----------------------------------------------------------------------------*/
+    /*                           事务配置                                         */
+    /*----------------------------------------------------------------------------*/
+
+
+    /**
+     * 系统事务
+     * @param dataSource
+     * @return
+     */
+    @Bean
+    public PlatformTransactionManager systemTransactionManager(@Qualifier("systemDataSource") DataSource dataSource) {
+        return new DataSourceTransactionManager(dataSource);
+    }
+
+//    @Bean
+//    public PlatformTransactionManager hospitalTransactionManager(@Qualifier("oldDataSource") DataSource dataSource) {
+//        return new DataSourceTransactionManager(dataSource);
+//    }
+}

+ 16 - 0
src/main/java/com/wdkl/pdm/PdmApplication.java

@@ -0,0 +1,16 @@
+package com.wdkl.pdm;
+
+import org.springframework.boot.SpringApplication;
+import org.springframework.boot.autoconfigure.SpringBootApplication;
+
+@SpringBootApplication
+//@EnableSwagger2
+//@ServletComponentScan
+//@ComponentScan("com.wdkl.pdm")
+public class PdmApplication {
+
+    public static void main(String[] args) {
+        SpringApplication.run(PdmApplication.class, args);
+    }
+
+}

+ 32 - 0
src/main/java/com/wdkl/pdm/WebConfig.java

@@ -0,0 +1,32 @@
+package com.wdkl.pdm;
+
+import com.wdkl.pdm.context.SystemConfig;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.context.annotation.Configuration;
+import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
+import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
+
+import java.io.File;
+
+/**
+ * @author wuyunfeng
+ * 2021-03-21 17:36
+ * web 配置类
+ */
+@Configuration
+public class WebConfig implements WebMvcConfigurer {
+
+    @Autowired
+    private SystemConfig systemConfig;
+
+    /**
+     * 配置上传文件虚拟目录
+     * @param registry
+     */
+    @Override
+    public void addResourceHandlers(ResourceHandlerRegistry registry) {
+        // 将上传文件的访问目录映射到物理路径
+        registry.addResourceHandler(systemConfig.getUploadVirtualPath()+"/**").addResourceLocations("file:"+ systemConfig.getUploadPhysicalPath() + File.separator);
+    }
+
+}

+ 66 - 0
src/main/java/com/wdkl/pdm/context/ApplicationContextHolder.java

@@ -0,0 +1,66 @@
+package com.wdkl.pdm.context;
+
+import org.springframework.beans.BeansException;
+import org.springframework.context.ApplicationContext;
+import org.springframework.context.ApplicationContextAware;
+import org.springframework.stereotype.Component;
+
+/**
+ *
+ * spring 上下文件获取类
+ * Created by Allen on 2018/3/23.
+ * @author Allen
+ * @version 1.0.0
+ */
+@Component
+public class ApplicationContextHolder implements ApplicationContextAware {
+
+    /**
+     * 上下文对象实例
+     */
+    private static ApplicationContext applicationContext;
+
+    @Override
+    public void setApplicationContext(ApplicationContext appContext) throws BeansException {
+        applicationContext = appContext;
+    }
+
+    /**
+     * 获取applicationContext
+     * @return  spring applicationContext
+     */
+    public static ApplicationContext getApplicationContext() {
+        return applicationContext;
+    }
+
+    /**
+     * 通过name获取 Bean.
+     * @param name bean的名字
+     * @return bean实例
+     */
+    public static Object getBean(String name){
+        return getApplicationContext().getBean(name);
+    }
+
+    /**
+     * 通过class获取Bean.
+     * @param clazz bean的类型
+     * @param <T> bean的类型
+     * @return bean实例
+     */
+    public static <T> T getBean(Class<T> clazz){
+        return getApplicationContext().getBean(clazz);
+    }
+
+    /**
+     * 通过name,以及Clazz返回指定的Bean
+     * @param name bean的名字
+     * @param clazz bean的类型
+     * @param <T>  bean的类型
+     * @return bean实例
+     */
+    public static <T> T getBean(String name, Class<T> clazz){
+        return getApplicationContext().getBean(name, clazz);
+    }
+
+}

+ 88 - 0
src/main/java/com/wdkl/pdm/context/SnakeToCamelArgumentResolver.java

@@ -0,0 +1,88 @@
+package com.wdkl.pdm.context;
+
+import com.google.common.base.CaseFormat;
+import org.jsoup.Jsoup;
+import org.jsoup.safety.Whitelist;
+import org.springframework.beans.BeanUtils;
+import org.springframework.beans.SimpleTypeConverter;
+import org.springframework.core.MethodParameter;
+import org.springframework.web.bind.support.WebDataBinderFactory;
+import org.springframework.web.context.request.NativeWebRequest;
+import org.springframework.web.method.support.HandlerMethodArgumentResolver;
+import org.springframework.web.method.support.ModelAndViewContainer;
+
+/**
+ * 蛇形转驼峰参数转换器
+ * 以及防xss的参数过滤
+ * 用于基本类型
+ * @author Allen
+ * @version 1.0
+ */
+public class SnakeToCamelArgumentResolver implements HandlerMethodArgumentResolver {
+
+	/**
+	 * 默认分页大小
+	 */
+	private static final int DEFAULT_SIZE = 10;
+
+	/**
+	 * 默认开始页码
+	 */
+	private static final int DEFAULT_NO = 1;
+	
+	/**
+	 * 定义只有基本类型参数才转换
+	 * @param parameter spring机制传过来的当前要处理的参数
+	 * @return 只有基本类型参数才返回true,否则返回false
+	 */
+	@Override
+	public boolean supportsParameter(MethodParameter parameter) {
+		//只处理基本类型的参数
+		return  BeanUtils.isSimpleProperty(parameter.getParameterType());
+	}
+
+
+	/**
+	 * 将蛇形参数值转换给驼峰参数值
+	 * @param parameter 要处理的参数
+	 * @param mavContainer spring mavContainer
+	 * @param webRequest  spring  webRequest
+	 * @param binderFactory spring binderFactory
+	 * @return 转换后的参数值
+	 * @throws Exception
+	 */
+	@Override
+	public Object resolveArgument(MethodParameter parameter, ModelAndViewContainer mavContainer,
+                                  NativeWebRequest webRequest, WebDataBinderFactory binderFactory) throws Exception {
+
+		//将蛇形参数名转为驼峰参数名,再读值返回
+		String paramName  = parameter.getParameterName();
+		String camelName = CaseFormat.LOWER_CAMEL.to(CaseFormat.LOWER_UNDERSCORE, paramName);
+		SimpleTypeConverter converter = new SimpleTypeConverter();
+
+		Object param = converter.convertIfNecessary(webRequest.getParameter(camelName),parameter.getParameterType());
+
+		//如果是字串型参数,则进行xss过滤
+		if( param instanceof String){
+			param = Jsoup.clean((String)param, Whitelist.basicWithImages());
+		}
+
+		//分页相关,增加默认分页
+		if(param == null ){
+			if ("pageNo".equals(paramName)) {
+
+				return DEFAULT_NO;
+			}
+
+			if ("pageSize".equals(paramName)) {
+
+				return DEFAULT_SIZE;
+			}
+		}
+
+		return 	param;
+
+	}
+
+
+}

+ 45 - 0
src/main/java/com/wdkl/pdm/context/SnakeToCamelModelAttributeMethodProcessor.java

@@ -0,0 +1,45 @@
+package com.wdkl.pdm.context;
+
+import org.springframework.web.bind.WebDataBinder;
+import org.springframework.web.bind.annotation.InitBinder;
+import org.springframework.web.context.request.NativeWebRequest;
+import org.springframework.web.servlet.mvc.method.annotation.ServletModelAttributeMethodProcessor;
+
+import javax.servlet.ServletRequest;
+
+/**
+ * 蛇形转驼峰参数转换器
+ * 用于非基本类型
+ * Created by Allen.
+ *
+ * @author Allen
+ * @version 1.0
+ */
+public class SnakeToCamelModelAttributeMethodProcessor extends ServletModelAttributeMethodProcessor {
+
+
+    /**
+     * 构造函数
+     *
+     * @param annotationNotRequired 注解是否必须
+     */
+    public SnakeToCamelModelAttributeMethodProcessor(boolean annotationNotRequired) {
+        super(annotationNotRequired);
+    }
+
+    /**
+     * 绑定蛇形转驼峰Binder
+     *
+     * @param binder  spring 机制传琛来的binder
+     * @param request spring机制的web request
+     */
+    @Override
+    @InitBinder
+    protected void bindRequestParameters(WebDataBinder binder, NativeWebRequest request) {
+        SnakeToCamelRequestDataBinder camelBinder = new SnakeToCamelRequestDataBinder(binder.getTarget(), binder.getObjectName());
+        camelBinder.bind(request.getNativeRequest(ServletRequest.class));
+        super.bindRequestParameters(binder, request);
+    }
+
+
+}

+ 71 - 0
src/main/java/com/wdkl/pdm/context/SnakeToCamelRequestDataBinder.java

@@ -0,0 +1,71 @@
+package com.wdkl.pdm.context;
+
+import com.fasterxml.jackson.annotation.JsonProperty;
+import com.google.common.base.CaseFormat;
+import org.springframework.beans.MutablePropertyValues;
+import org.springframework.beans.PropertyValue;
+import org.springframework.web.servlet.mvc.method.annotation.ExtendedServletRequestDataBinder;
+
+import javax.servlet.ServletRequest;
+import java.lang.reflect.Field;
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * 蛇形转驼峰数据绑定器
+ * Created by Allen
+ *
+ * @author Allen
+ * @version 1.0
+ */
+public class SnakeToCamelRequestDataBinder extends ExtendedServletRequestDataBinder {
+
+
+    /**
+     * 构造器,根据spring机制机要求存在
+     *
+     * @param target     spring 机制传递 target
+     * @param objectName spring 机制传递 objectName
+     */
+    public SnakeToCamelRequestDataBinder(Object target, String objectName) {
+        super(target, objectName);
+    }
+
+    /**
+     * 对蛇形参数绑定值
+     *
+     * @param mpvs    spring 机制传递   mpvs
+     * @param request spring 机制传递  request
+     */
+    @Override
+    protected void addBindValues(MutablePropertyValues mpvs, ServletRequest request) {
+        super.addBindValues(mpvs, request);
+
+        //处理JsonProperty注释的对象
+        Class<?> targetClass = getTarget().getClass();
+        Field[] fields = targetClass.getDeclaredFields();
+        for (Field field : fields) {
+            JsonProperty jsonPropertyAnnotation = field.getAnnotation(JsonProperty.class);
+            if (jsonPropertyAnnotation != null && mpvs.contains(jsonPropertyAnnotation.value())) {
+                if (!mpvs.contains(field.getName())) {
+                    mpvs.add(field.getName(), mpvs.getPropertyValue(jsonPropertyAnnotation.value()).getValue());
+                }
+            }
+        }
+
+        List<PropertyValue> covertValues = new ArrayList<PropertyValue>();
+        for (PropertyValue propertyValue : mpvs.getPropertyValueList()) {
+            if (propertyValue.getName().contains("_")) {
+                String camelName = CaseFormat.UPPER_UNDERSCORE.to(CaseFormat.UPPER_CAMEL, propertyValue.getName());
+                if (!mpvs.contains(camelName)) {
+                    covertValues.add(new PropertyValue(camelName, propertyValue.getValue()));
+                }
+            }
+        }
+
+
+        mpvs.getPropertyValueList().addAll(covertValues);
+    }
+
+
+}

+ 48 - 0
src/main/java/com/wdkl/pdm/context/SystemConfig.java

@@ -0,0 +1,48 @@
+package com.wdkl.pdm.context;
+
+import org.springframework.beans.factory.annotation.Value;
+import org.springframework.context.annotation.Configuration;
+
+/**
+ * 描述
+ *
+ * @author allen
+ * 2020-09-04 12:21
+ */
+@Configuration
+//@ConfigurationProperties(prefix = "wdkl")
+public class SystemConfig {
+
+    /**
+     * 文件上传物理路径
+     */
+    @Value("${wdkl.upload.physicalPath:#{null}}")
+    private String uploadPhysicalPath;
+
+    /**
+     * 上传文件访问虚拟目录
+     */
+    @Value("${wdkl.upload.virtualPath:#{null}}")
+    private String uploadVirtualPath;
+
+
+
+    public SystemConfig(){}
+
+
+    public String getUploadPhysicalPath() {
+        return uploadPhysicalPath;
+    }
+
+    public void setUploadPhysicalPath(String uploadPhysicalPath) {
+        this.uploadPhysicalPath = uploadPhysicalPath;
+    }
+
+    public String getUploadVirtualPath() {
+        return uploadVirtualPath;
+    }
+
+    public void setUploadVirtualPath(String uploadVirtualPath) {
+        this.uploadVirtualPath = uploadVirtualPath;
+    }
+}

+ 47 - 0
src/main/java/com/wdkl/pdm/context/ThreadContextHolder.java

@@ -0,0 +1,47 @@
+package com.wdkl.pdm.context;
+
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+
+/**
+ *  用ThreadLocal来存储Session,以便实现Session any where 
+ * @author Allen
+ * @version 1.1
+ * 新增request any where
+ */
+public class ThreadContextHolder  {
+
+	private static ThreadLocal<HttpServletRequest> requestThreadLocalHolder = new ThreadLocal<HttpServletRequest>();
+	private static ThreadLocal<HttpServletResponse> responseThreadLocalHolder = new ThreadLocal<HttpServletResponse>();
+
+
+	public static void setHttpRequest(HttpServletRequest request){
+		
+		requestThreadLocalHolder.set(request);
+	}
+
+	public static void setHttpResponse(HttpServletResponse response){
+		responseThreadLocalHolder.set(response);
+	}
+
+	
+	public static void remove(){
+		requestThreadLocalHolder.remove();
+		responseThreadLocalHolder.remove();
+	}
+	
+	
+
+	public static HttpServletResponse getHttpResponse(){
+		
+		return responseThreadLocalHolder.get();
+	}
+	public static HttpServletRequest getHttpRequest(){
+		return  requestThreadLocalHolder.get();
+	}
+
+
+	
+}

+ 53 - 0
src/main/java/com/wdkl/pdm/context/WdklRequestInterceptor.java

@@ -0,0 +1,53 @@
+package com.wdkl.pdm.context;
+
+import org.springframework.lang.Nullable;
+import org.springframework.web.servlet.handler.HandlerInterceptorAdapter;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+
+/**
+ * 上下文初始化
+ * 以及跨域的支持
+ * @author Allen
+ * @version v1.0
+ */
+public class WdklRequestInterceptor extends HandlerInterceptorAdapter {
+
+
+	/**
+	 * 拦截request和response并放到上下文中
+	 * @param request 要拦截的request
+	 * @param response 要拦截的response
+	 * @param handler spring 机制传递过来的
+	 * @return 不中断,继续执行,返回为true
+	 * @throws Exception
+	 */
+	@Override
+    public boolean preHandle(HttpServletRequest request,
+                             HttpServletResponse response, Object handler) throws Exception {
+
+		//request 和response存到 上下文中
+		ThreadContextHolder.setHttpResponse(response);
+		ThreadContextHolder.setHttpRequest(request);
+
+		return super.preHandle(request, response, handler);
+	}
+
+
+	/**
+	 * 处理完成 从上下文中移除 request 和respseon
+	 * @param request
+	 * @param response
+	 * @param handler
+	 * @param ex
+	 * @throws Exception
+	 */
+	@Override
+	public void afterCompletion(HttpServletRequest request, HttpServletResponse response, Object handler, @Nullable Exception ex) throws Exception {
+		ThreadContextHolder.remove();
+
+		super.afterCompletion(request, response, handler, ex);
+	}
+}

+ 60 - 0
src/main/java/com/wdkl/pdm/context/WebInterceptorConfigurer.java

@@ -0,0 +1,60 @@
+package com.wdkl.pdm.context;
+
+import com.fasterxml.jackson.databind.ObjectMapper;
+import com.fasterxml.jackson.databind.module.SimpleModule;
+import com.wdkl.pdm.security.XssStringJsonSerializer;
+import org.springframework.context.annotation.Bean;
+import org.springframework.context.annotation.Configuration;
+import org.springframework.context.annotation.Primary;
+import org.springframework.http.converter.json.Jackson2ObjectMapperBuilder;
+import org.springframework.web.method.support.HandlerMethodArgumentResolver;
+import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
+import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
+
+import java.util.List;
+
+/**
+ * 
+ * 加载自定义的 拦截器
+ * @author Chopper
+ * @version v1.0
+ * @since v6.2 2019年3月7日 下午5:29:56
+ *
+ */
+@Configuration
+public class WebInterceptorConfigurer implements WebMvcConfigurer {
+
+	@Override
+	public void addArgumentResolvers(List<HandlerMethodArgumentResolver> argumentResolvers) {
+
+		//参数蛇形转驼峰拦截
+		argumentResolvers.add(new SnakeToCamelModelAttributeMethodProcessor(true));
+		argumentResolvers.add(new SnakeToCamelArgumentResolver());
+
+	}
+
+	@Override
+	public void addInterceptors(InterceptorRegistry registry) {
+		registry.addInterceptor(new WdklRequestInterceptor()).addPathPatterns("/**");
+	}
+
+	/**
+	 * 自定义 ObjectMapper ,用于xss攻击过滤
+ 	 * @param builder
+	 * @return
+	 */
+	@Bean
+	@Primary
+	public ObjectMapper xssObjectMapper(Jackson2ObjectMapperBuilder builder) {
+		//解析器
+		ObjectMapper objectMapper = builder.createXmlMapper(false).build();
+		//注册xss解析器
+		SimpleModule xssModule = new SimpleModule("XssStringJsonSerializer");
+		xssModule.addSerializer(new XssStringJsonSerializer());
+		objectMapper.registerModule(xssModule);
+		//返回
+		return objectMapper;
+	}
+
+
+}

+ 52 - 0
src/main/java/com/wdkl/pdm/controller/LoginController.java

@@ -0,0 +1,52 @@
+package com.wdkl.pdm.controller;
+
+import com.wdkl.pdm.dos.WdUsersDO;
+import com.wdkl.pdm.service.WdUserManager;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiImplicitParam;
+import io.swagger.annotations.ApiImplicitParams;
+import io.swagger.annotations.ApiOperation;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.validation.annotation.Validated;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+/**
+ * @author wuyunfeng
+ * 2022-04-06 14:28
+ */
+@RequestMapping(value = "/pdm/authorize")
+@RestController
+@Api(value = "用户登录", description = "用户登录", tags = "用户登录")
+@Validated
+public class LoginController {
+
+    @Autowired
+    private WdUserManager wdUserManager;
+
+    @GetMapping(value = "/login")
+    @ApiOperation(value = "登陆", response = String.class)
+    @ApiImplicitParams({
+            @ApiImplicitParam(name = "UserName", value = "用户名", dataType = "String", paramType = "query", required = true),
+            @ApiImplicitParam(name = "Password", value = "密码", dataType = "String", paramType = "query", required = true)
+    })
+    public WdUsersDO Login(String username, String password) {
+
+        if (username.equalsIgnoreCase("superadmin") && password.equalsIgnoreCase("40684c2c6499d30dd8616cf56b17d8a2")) {
+            WdUsersDO superUser = this.wdUserManager.getUserByUserName(username);
+            WdUsersDO wdUsersDO = new WdUsersDO();
+            wdUsersDO.setUserName("superadmin");
+            wdUsersDO.setTrueName("超级管理员");
+            wdUsersDO.setPassword("40684c2c6499d30dd8616cf56b17d8a2");
+            if (superUser != null) {
+                 this.wdUserManager.edit(wdUsersDO, superUser.getId());
+            } else {
+                superUser = this.wdUserManager.add(wdUsersDO);
+            }
+            return superUser;
+        }
+        return wdUserManager.login(username, password);
+
+    }
+}

+ 40 - 0
src/main/java/com/wdkl/pdm/controller/UploadController.java

@@ -0,0 +1,40 @@
+package com.wdkl.pdm.controller;
+
+import com.wdkl.pdm.service.FileUploadManager;
+import com.wdkl.pdm.vos.FileVO;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiImplicitParam;
+import io.swagger.annotations.ApiImplicitParams;
+import org.assertj.core.util.Strings;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.PathVariable;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+import org.springframework.web.multipart.MultipartFile;
+
+import javax.servlet.http.HttpServletRequest;
+import java.io.IOException;
+
+/**
+ * @author wuyunfeng
+ * 2022-04-08 11:57
+ */
+@RestController
+@RequestMapping("/pdm/upload")
+@Api(description = "上传相关API", tags = "上传相关API")
+public class UploadController {
+
+    @Autowired
+    private FileUploadManager fileUploadManager;
+
+    //处理文件上传的方法
+    @PostMapping("/{folder}")
+    @ApiImplicitParams({
+            @ApiImplicitParam(name = "folder", value = "文件夹名称", required = false, dataType = "string", paramType = "path")
+    })
+    public FileVO upload(MultipartFile file, HttpServletRequest request, @PathVariable String folder) throws IOException {
+        return this.fileUploadManager.uploadFile(file,request, Strings.isNullOrEmpty(folder)?"file":folder);
+    }
+
+}

+ 81 - 0
src/main/java/com/wdkl/pdm/controller/WdChipController.java

@@ -0,0 +1,81 @@
+package com.wdkl.pdm.controller;
+
+import com.wdkl.pdm.database.Page;
+import com.wdkl.pdm.dos.WdChipDO;
+import com.wdkl.pdm.mvc.GridParameter;
+import com.wdkl.pdm.mvc.GridParameterParser;
+import com.wdkl.pdm.service.WdChipManager;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiImplicitParam;
+import io.swagger.annotations.ApiImplicitParams;
+import io.swagger.annotations.ApiOperation;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.validation.annotation.Validated;
+import org.springframework.web.bind.annotation.*;
+import springfox.documentation.annotations.ApiIgnore;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.validation.Valid;
+import javax.validation.constraints.NotNull;
+import java.util.List;
+
+/**
+ * @author wuyunfeng
+ * 2022-04-02 16:12
+ */
+@RequestMapping(value = "/pdm/chip")
+@RestController
+@Api(value = "产品芯片类型管理",description = "产品芯片类型管理",tags = "产品芯片类型管理")
+@Validated
+public class WdChipController {
+
+    @Autowired
+    private WdChipManager wdChipManager;
+
+    @ApiOperation(value = "查询芯片列表", response = WdChipDO.class)
+    @ApiImplicitParams({
+            @ApiImplicitParam(name = "page_no", value = "页码", required = true, dataType = "int", example ="1", paramType = "query"),
+            @ApiImplicitParam(name = "page_size", value = "每页显示数量", required = true, dataType = "int", example ="20", paramType = "query")
+    })
+    @PostMapping("/page")
+    public Page list(@ApiIgnore @NotNull(message = "页码不能为空") Integer pageNo,
+                     @ApiIgnore @NotNull(message = "页容量") Integer pageSize,
+                     HttpServletRequest request) {
+        GridParameter gp = GridParameterParser.parse(WdChipDO.class, request.getParameterMap());
+
+        return this.wdChipManager.list(gp);
+    }
+
+
+    @ApiOperation(value = "添加芯片类型信息", response = WdChipDO.class)
+    @PostMapping
+    public WdChipDO add(@Valid WdChipDO wdChipDO) {
+        this.wdChipManager.add(wdChipDO);
+        return wdChipDO;
+    }
+
+    @PutMapping(value = "/{id}")
+    @ApiOperation(value = "修改芯片类型信息", response = WdChipDO.class)
+    @ApiImplicitParams({
+            @ApiImplicitParam(name = "id", value = "主键", required = true, dataType = "int", example = "1" ,paramType = "path")})
+    public WdChipDO edit(@Valid WdChipDO wdChipDO, @PathVariable Integer id) {
+        this.wdChipManager.edit(wdChipDO, id);
+        return wdChipDO;
+    }
+
+    @DeleteMapping(value = "/{ids}")
+    @ApiOperation(value = "删除芯片类型信息")
+    @ApiImplicitParams({
+            @ApiImplicitParam(name = "ids", value = "要删除的产品主键集合", required = true, dataType = "int", example = "1",paramType = "path", allowMultiple = true)})
+    public String delete(@PathVariable Integer[] ids) {
+        this.wdChipManager.delete(ids);
+        return "";
+    }
+
+    @GetMapping("/all")
+    @ApiOperation(value = "获取所有芯片列表", response = WdChipDO.class)
+    public List<WdChipDO> getAll(){
+        return  this.wdChipManager.getAll();
+    }
+
+}

+ 80 - 0
src/main/java/com/wdkl/pdm/controller/WdCustomPrintController.java

@@ -0,0 +1,80 @@
+package com.wdkl.pdm.controller;
+
+import com.wdkl.pdm.database.Page;
+import com.wdkl.pdm.dos.WdCustomPrintDO;
+import com.wdkl.pdm.mvc.GridParameter;
+import com.wdkl.pdm.mvc.GridParameterParser;
+import com.wdkl.pdm.service.WdCustomPrintManager;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiImplicitParam;
+import io.swagger.annotations.ApiImplicitParams;
+import io.swagger.annotations.ApiOperation;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.validation.annotation.Validated;
+import org.springframework.web.bind.annotation.*;
+import springfox.documentation.annotations.ApiIgnore;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.validation.Valid;
+import javax.validation.constraints.NotNull;
+import java.util.List;
+
+/**
+ * @author wuyunfeng
+ * 2022-06-21 11:44
+ */
+@RequestMapping(value = "/pdm/customprint")
+@RestController
+@Api(value = "自定义打印文档", description = "自定义打印文档", tags = "自定义打印文档")
+@Validated
+public class WdCustomPrintController {
+
+    @Autowired
+    private WdCustomPrintManager wdCustomPrintManager;
+
+    @ApiOperation(value = "查询自定义打印文档列表", response = WdCustomPrintDO.class)
+    @ApiImplicitParams({
+            @ApiImplicitParam(name = "page_no", value = "页码", required = true, dataType = "int", example ="1", paramType = "query"),
+            @ApiImplicitParam(name = "page_size", value = "每页显示数量", required = true, dataType = "int", example ="20", paramType = "query")
+    })
+    @PostMapping("/page")
+    public Page list(@ApiIgnore @NotNull(message = "页码不能为空") Integer pageNo,
+                     @ApiIgnore @NotNull(message = "页容量") Integer pageSize,
+                     HttpServletRequest request) {
+        GridParameter gp = GridParameterParser.parse(WdCustomPrintDO.class, request.getParameterMap());
+
+        return this.wdCustomPrintManager.list(gp);
+    }
+
+
+    @ApiOperation(value = "添加自定义打印文档", response = WdCustomPrintDO.class)
+    @PostMapping
+    public WdCustomPrintDO add(@Valid WdCustomPrintDO wdCustomPrintDO) {
+        this.wdCustomPrintManager.add(wdCustomPrintDO);
+        return wdCustomPrintDO;
+    }
+
+    @PutMapping(value = "/{id}")
+    @ApiOperation(value = "修改自定义打印文档", response = WdCustomPrintDO.class)
+    @ApiImplicitParams({
+            @ApiImplicitParam(name = "id", value = "主键", required = true, dataType = "int", example = "1" ,paramType = "path")})
+    public WdCustomPrintDO edit(@Valid WdCustomPrintDO wdCustomPrintDO, @PathVariable Integer id) {
+        this.wdCustomPrintManager.edit(wdCustomPrintDO, id);
+        return wdCustomPrintDO;
+    }
+
+    @DeleteMapping(value = "/{ids}")
+    @ApiOperation(value = "删除自定义打印文档")
+    @ApiImplicitParams({
+            @ApiImplicitParam(name = "ids", value = "要删除的自定义打印文档主键集合", required = true, dataType = "int", example = "1",paramType = "path", allowMultiple = true)})
+    public String delete(@PathVariable Integer[] ids) {
+        this.wdCustomPrintManager.delete(ids);
+        return "";
+    }
+
+    @GetMapping("/all")
+    @ApiOperation(value = "获取所有自定义打印文档列表")
+    public List<WdCustomPrintDO> getAll(){
+        return this.wdCustomPrintManager.getAll();
+    }
+}

+ 81 - 0
src/main/java/com/wdkl/pdm/controller/WdLabellanguageController.java

@@ -0,0 +1,81 @@
+package com.wdkl.pdm.controller;
+
+import com.wdkl.pdm.database.Page;
+import com.wdkl.pdm.dos.WdLabelLanguageDO;
+import com.wdkl.pdm.mvc.GridParameter;
+import com.wdkl.pdm.mvc.GridParameterParser;
+import com.wdkl.pdm.service.WdLabelLanguageManager;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiImplicitParam;
+import io.swagger.annotations.ApiImplicitParams;
+import io.swagger.annotations.ApiOperation;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.validation.annotation.Validated;
+import org.springframework.web.bind.annotation.*;
+import springfox.documentation.annotations.ApiIgnore;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.validation.Valid;
+import javax.validation.constraints.NotNull;
+import java.util.List;
+
+/**
+ * @author wuyunfeng
+ * 2022-06-24 15:23
+ */
+@RequestMapping(value = "/pdm/labellanguage")
+@RestController
+@Api(value = "标签编码前缀语言", description = "标签编码前缀语言", tags = "标签编码前缀语言")
+@Validated
+public class WdLabellanguageController {
+
+
+    @Autowired
+    private WdLabelLanguageManager wdLabelLanuageManager;
+
+    @ApiOperation(value = "查询标签编码前缀语言列表", response = WdLabelLanguageDO.class)
+    @ApiImplicitParams({
+            @ApiImplicitParam(name = "page_no", value = "页码", required = true, dataType = "int", example = "1", paramType = "query"),
+            @ApiImplicitParam(name = "page_size", value = "每页显示数量", required = true, dataType = "int", example = "20", paramType = "query")
+    })
+    @PostMapping("/page")
+    public Page list(@ApiIgnore @NotNull(message = "页码不能为空") Integer pageNo,
+                     @ApiIgnore @NotNull(message = "页容量") Integer pageSize,
+                     HttpServletRequest request) {
+        GridParameter gp = GridParameterParser.parse(WdLabelLanguageDO.class, request.getParameterMap());
+
+        return this.wdLabelLanuageManager.list(gp);
+    }
+
+
+    @ApiOperation(value = "添加标签编码前缀语言", response = WdLabelLanguageDO.class)
+    @PostMapping
+    public WdLabelLanguageDO add(@Valid WdLabelLanguageDO wdPrintItemDO) {
+        this.wdLabelLanuageManager.add(wdPrintItemDO);
+        return wdPrintItemDO;
+    }
+
+    @PutMapping(value = "/{id}")
+    @ApiOperation(value = "修改标签编码前缀语言", response = WdLabelLanguageDO.class)
+    @ApiImplicitParams({
+            @ApiImplicitParam(name = "id", value = "主键", required = true, dataType = "int", example = "1", paramType = "path")})
+    public WdLabelLanguageDO edit(@Valid WdLabelLanguageDO wdPrintItemDO, @PathVariable Integer id) {
+        this.wdLabelLanuageManager.edit(wdPrintItemDO, id);
+        return wdPrintItemDO;
+    }
+
+    @DeleteMapping(value = "/{ids}")
+    @ApiOperation(value = "删除标签编码前缀语言")
+    @ApiImplicitParams({
+            @ApiImplicitParam(name = "ids", value = "要删除的标签编码前缀语言主键集合", required = true, dataType = "int", example = "1", paramType = "path", allowMultiple = true)})
+    public String delete(@PathVariable Integer[] ids) {
+        this.wdLabelLanuageManager.delete(ids);
+        return "";
+    }
+
+    @GetMapping("/all")
+    @ApiOperation(value = "获取所有标签编码前缀语言列表")
+    public List<WdLabelLanguageDO> getAll() {
+        return this.wdLabelLanuageManager.getAll();
+    }
+}

+ 60 - 0
src/main/java/com/wdkl/pdm/controller/WdMacDispatchRecordController.java

@@ -0,0 +1,60 @@
+package com.wdkl.pdm.controller;
+
+import com.wdkl.pdm.database.Page;
+import com.wdkl.pdm.dos.WdMacDispatchRecordDO;
+import com.wdkl.pdm.mvc.GridParameter;
+import com.wdkl.pdm.mvc.GridParameterParser;
+import com.wdkl.pdm.service.WdMacDispatchRecordManager;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiImplicitParam;
+import io.swagger.annotations.ApiImplicitParams;
+import io.swagger.annotations.ApiOperation;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.validation.annotation.Validated;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+import springfox.documentation.annotations.ApiIgnore;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.validation.constraints.NotNull;
+
+/**
+ * @author wuyunfeng
+ * 2022-04-10 13:34
+ */
+
+@RequestMapping(value = "/pdm/macdispatch")
+@RestController
+@Api(value = "MAC地址分配接口", description = "MAC地址分配接口", tags = "MAC地址分配接口")
+@Validated
+public class WdMacDispatchRecordController {
+
+    @Autowired
+    private WdMacDispatchRecordManager wdMacDispatchRecordManager;
+
+    @ApiOperation(value = "查询MAC地址分配记录", response = WdMacDispatchRecordDO.class)
+    @ApiImplicitParams({
+            @ApiImplicitParam(name = "page_no", value = "页码", required = true, dataType = "int", example = "1", paramType = "query"),
+            @ApiImplicitParam(name = "page_size", value = "每页显示数量", required = true, dataType = "int", example = "20", paramType = "query")
+    })
+    @PostMapping("/page")
+    public Page list(@ApiIgnore @NotNull(message = "页码不能为空") Integer pageNo,
+                     @ApiIgnore @NotNull(message = "页容量") Integer pageSize,
+                     HttpServletRequest request) {
+        GridParameter gp = GridParameterParser.parse(WdMacDispatchRecordDO.class, request.getParameterMap());
+        return this.wdMacDispatchRecordManager.list(gp);
+    }
+
+
+    @ApiOperation(value = "申请mac地址", response = WdMacDispatchRecordDO.class)
+    @ApiImplicitParams({
+            @ApiImplicitParam(name = "qty", value = "请求分配数量", required = true, dataType = "int", example = "1", paramType = "query"),
+    })
+    @GetMapping("/dispatch")
+    public WdMacDispatchRecordDO list(@ApiIgnore @NotNull(message = "要分配的数量不能为空") Integer qty) {
+        return this.wdMacDispatchRecordManager.dispatchMAC(qty);
+    }
+
+}

+ 81 - 0
src/main/java/com/wdkl/pdm/controller/WdPrintItemController.java

@@ -0,0 +1,81 @@
+package com.wdkl.pdm.controller;
+
+import com.wdkl.pdm.database.Page;
+import com.wdkl.pdm.dos.WdPrintItemDO;
+import com.wdkl.pdm.mvc.GridParameter;
+import com.wdkl.pdm.mvc.GridParameterParser;
+import com.wdkl.pdm.service.WdPrintItemManager;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiImplicitParam;
+import io.swagger.annotations.ApiImplicitParams;
+import io.swagger.annotations.ApiOperation;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.validation.annotation.Validated;
+import org.springframework.web.bind.annotation.*;
+import springfox.documentation.annotations.ApiIgnore;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.validation.Valid;
+import javax.validation.constraints.NotNull;
+import java.util.List;
+
+/**
+ * @author wuyunfeng
+ * 2022-06-21 11:19
+ */
+@RequestMapping(value = "/pdm/printitem")
+@RestController
+@Api(value = "自定义打印项",description = "自定义打印项",tags = "自定义打印项")
+@Validated
+public class WdPrintItemController {
+
+
+    @Autowired
+    private WdPrintItemManager wdPrintItemManager;
+
+    @ApiOperation(value = "查询自定义打印项列表", response = WdPrintItemDO.class)
+    @ApiImplicitParams({
+            @ApiImplicitParam(name = "page_no", value = "页码", required = true, dataType = "int", example ="1", paramType = "query"),
+            @ApiImplicitParam(name = "page_size", value = "每页显示数量", required = true, dataType = "int", example ="20", paramType = "query")
+    })
+    @PostMapping("/page")
+    public Page list(@ApiIgnore @NotNull(message = "页码不能为空") Integer pageNo,
+                     @ApiIgnore @NotNull(message = "页容量") Integer pageSize,
+                     HttpServletRequest request) {
+        GridParameter gp = GridParameterParser.parse(WdPrintItemDO.class, request.getParameterMap());
+
+        return this.wdPrintItemManager.list(gp);
+    }
+
+
+    @ApiOperation(value = "添加自定义打印项", response = WdPrintItemDO.class)
+    @PostMapping
+    public WdPrintItemDO add(@Valid WdPrintItemDO wdPrintItemDO) {
+        this.wdPrintItemManager.add(wdPrintItemDO);
+        return wdPrintItemDO;
+    }
+
+    @PutMapping(value = "/{id}")
+    @ApiOperation(value = "修改自定义打印项", response = WdPrintItemDO.class)
+    @ApiImplicitParams({
+            @ApiImplicitParam(name = "id", value = "主键", required = true, dataType = "int", example = "1" ,paramType = "path")})
+    public WdPrintItemDO edit(@Valid WdPrintItemDO wdPrintItemDO, @PathVariable Integer id) {
+        this.wdPrintItemManager.edit(wdPrintItemDO, id);
+        return wdPrintItemDO;
+    }
+
+    @DeleteMapping(value = "/{ids}")
+    @ApiOperation(value = "删除自定义打印项")
+    @ApiImplicitParams({
+            @ApiImplicitParam(name = "ids", value = "要删除的自定义打印项主键集合", required = true, dataType = "int", example = "1",paramType = "path", allowMultiple = true)})
+    public String delete(@PathVariable Integer[] ids) {
+        this.wdPrintItemManager.delete(ids);
+        return "";
+    }
+
+    @GetMapping("/all")
+    @ApiOperation(value = "获取所有自定义打印项列表")
+    public List<WdPrintItemDO> getAll(){
+        return this.wdPrintItemManager.getAll();
+    }
+}

+ 91 - 0
src/main/java/com/wdkl/pdm/controller/WdPrintSolutionController.java

@@ -0,0 +1,91 @@
+package com.wdkl.pdm.controller;
+
+import com.wdkl.pdm.database.Page;
+import com.wdkl.pdm.dos.WdPrintSolutionDO;
+import com.wdkl.pdm.mvc.GridParameter;
+import com.wdkl.pdm.mvc.GridParameterParser;
+import com.wdkl.pdm.service.WdPrintSolutionManager;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiImplicitParam;
+import io.swagger.annotations.ApiImplicitParams;
+import io.swagger.annotations.ApiOperation;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.validation.annotation.Validated;
+import org.springframework.web.bind.annotation.*;
+import springfox.documentation.annotations.ApiIgnore;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.validation.Valid;
+import javax.validation.constraints.NotNull;
+import java.util.List;
+
+/**
+ * @author wuyunfeng
+ * 2022-04-26 10:12
+ */
+@RequestMapping(value = "/pdm/printsolution")
+@RestController
+@Api(value = "打印方案管理",description = "打印方案管理",tags = "打印方案管理")
+@Validated
+public class WdPrintSolutionController {
+
+    @Autowired
+    private WdPrintSolutionManager wdPrintSolutionManager;
+
+    @ApiOperation(value = "打印方案列表", response = WdPrintSolutionDO.class)
+    @ApiImplicitParams({
+            @ApiImplicitParam(name = "page_no", value = "页码", required = true, dataType = "int", example ="1", paramType = "query"),
+            @ApiImplicitParam(name = "page_size", value = "每页显示数量", required = true, dataType = "int", example ="20", paramType = "query")
+    })
+    @PostMapping("/page")
+    public Page list(@ApiIgnore @NotNull(message = "页码不能为空") Integer pageNo,
+                     @ApiIgnore @NotNull(message = "页容量") Integer pageSize,
+                     HttpServletRequest request) {
+        GridParameter gp = GridParameterParser.parse(WdPrintSolutionDO.class, request.getParameterMap());
+
+        return this.wdPrintSolutionManager.list(gp);
+    }
+
+
+    @ApiOperation(value = "添加文件", response = WdPrintSolutionDO.class)
+    @PostMapping
+    public WdPrintSolutionDO add(@Valid WdPrintSolutionDO wdPrintSolutionDO) {
+        this.wdPrintSolutionManager.add(wdPrintSolutionDO);
+        return wdPrintSolutionDO;
+    }
+
+    @PutMapping(value = "/{id}")
+    @ApiOperation(value = "修改文件", response = WdPrintSolutionDO.class)
+    @ApiImplicitParams({
+            @ApiImplicitParam(name = "id", value = "主键", required = true, dataType = "int", example = "1" ,paramType = "path")})
+    public WdPrintSolutionDO edit(@Valid WdPrintSolutionDO wdPrintSolutionDO, @PathVariable Integer id) {
+        this.wdPrintSolutionManager.edit(wdPrintSolutionDO, id);
+        return wdPrintSolutionDO;
+    }
+
+    @DeleteMapping(value = "/{ids}")
+    @ApiOperation(value = "删除文件")
+    @ApiImplicitParams({
+            @ApiImplicitParam(name = "ids", value = "要删除的文件主键集合", required = true, dataType = "int", example = "1",paramType = "path", allowMultiple = true)})
+    public String delete(@PathVariable Integer[] ids) {
+        this.wdPrintSolutionManager.delete(ids);
+        return "";
+    }
+
+    @GetMapping("/all")
+    @ApiOperation(value = "获取所有全局打印方案")
+    public List<WdPrintSolutionDO> getAll(){
+        return this.wdPrintSolutionManager.getAll();
+    }
+
+//    @PostMapping("/upload")
+//    @ApiOperation(value = "上传打印方案", notes = "上传客户端设置的打印方案,只处理全局方案",
+//            response = JsonResponse.class)
+//    @ApiImplicitParams({
+//            @ApiImplicitParam(name = "list", value = "方案列表", allowMultiple = true, required = true, dataType = "WdPrintSolutionDO", dataTypeClass = WdPrintSolutionDO.class)
+//    })
+//    public JsonResponse uploadPrintSolution(@RequestBody List<WdPrintSolutionDO> list) {
+//        return this.wdPrintSolutionManager.uploadPrintSolution(list);
+//    }
+
+}

+ 81 - 0
src/main/java/com/wdkl/pdm/controller/WdPrintTemplateParamController.java

@@ -0,0 +1,81 @@
+package com.wdkl.pdm.controller;
+
+import com.wdkl.pdm.database.Page;
+import com.wdkl.pdm.dos.WdPrintTemplateParamDO;
+import com.wdkl.pdm.mvc.GridParameter;
+import com.wdkl.pdm.mvc.GridParameterParser;
+import com.wdkl.pdm.service.WdPrintTemplateParamManager;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiImplicitParam;
+import io.swagger.annotations.ApiImplicitParams;
+import io.swagger.annotations.ApiOperation;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.validation.annotation.Validated;
+import org.springframework.web.bind.annotation.*;
+import springfox.documentation.annotations.ApiIgnore;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.validation.Valid;
+import javax.validation.constraints.NotNull;
+import java.util.List;
+
+/**
+ * @author wuyunfeng
+ * 2022-06-20 17:02
+ */
+@RequestMapping(value = "/pdm/templateparam")
+@RestController
+@Api(value = "自定义打印模版参数",description = "自定义打印模版参数",tags = "自定义打印模版参数")
+@Validated
+public class WdPrintTemplateParamController {
+
+
+    @Autowired
+    private WdPrintTemplateParamManager wdPrintTemplateParamManager;
+
+    @ApiOperation(value = "查询模版参数列表", response = WdPrintTemplateParamDO.class)
+    @ApiImplicitParams({
+            @ApiImplicitParam(name = "page_no", value = "页码", required = true, dataType = "int", example ="1", paramType = "query"),
+            @ApiImplicitParam(name = "page_size", value = "每页显示数量", required = true, dataType = "int", example ="20", paramType = "query")
+    })
+    @PostMapping("/page")
+    public Page list(@ApiIgnore @NotNull(message = "页码不能为空") Integer pageNo,
+                     @ApiIgnore @NotNull(message = "页容量") Integer pageSize,
+                     HttpServletRequest request) {
+        GridParameter gp = GridParameterParser.parse(WdPrintTemplateParamDO.class, request.getParameterMap());
+
+        return this.wdPrintTemplateParamManager.list(gp);
+    }
+
+
+    @ApiOperation(value = "添加模版参数", response = WdPrintTemplateParamDO.class)
+    @PostMapping
+    public WdPrintTemplateParamDO add(@Valid WdPrintTemplateParamDO wdProduceFileDO) {
+        this.wdPrintTemplateParamManager.add(wdProduceFileDO);
+        return wdProduceFileDO;
+    }
+
+    @PutMapping(value = "/{id}")
+    @ApiOperation(value = "修改模版参数", response = WdPrintTemplateParamDO.class)
+    @ApiImplicitParams({
+            @ApiImplicitParam(name = "id", value = "主键", required = true, dataType = "int", example = "1" ,paramType = "path")})
+    public WdPrintTemplateParamDO edit(@Valid WdPrintTemplateParamDO wdProduceFileDO, @PathVariable Integer id) {
+        this.wdPrintTemplateParamManager.edit(wdProduceFileDO, id);
+        return wdProduceFileDO;
+    }
+
+    @DeleteMapping(value = "/{ids}")
+    @ApiOperation(value = "删除模版参数")
+    @ApiImplicitParams({
+            @ApiImplicitParam(name = "ids", value = "要删除的模版参数主键集合", required = true, dataType = "int", example = "1",paramType = "path", allowMultiple = true)})
+    public String delete(@PathVariable Integer[] ids) {
+        this.wdPrintTemplateParamManager.delete(ids);
+        return "";
+    }
+
+    @GetMapping("/all")
+    @ApiOperation(value = "获取所有模版参数列表")
+    public List<WdPrintTemplateParamDO> getAll(){
+        return this.wdPrintTemplateParamManager.getAll();
+    }
+}

+ 81 - 0
src/main/java/com/wdkl/pdm/controller/WdPrintTemplateParamGroupController.java

@@ -0,0 +1,81 @@
+package com.wdkl.pdm.controller;
+
+import com.wdkl.pdm.database.Page;
+import com.wdkl.pdm.dos.WdPrintTemplateParamGroupDO;
+import com.wdkl.pdm.mvc.GridParameter;
+import com.wdkl.pdm.mvc.GridParameterParser;
+import com.wdkl.pdm.service.WdPrintTemplateParamGroupManager;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiImplicitParam;
+import io.swagger.annotations.ApiImplicitParams;
+import io.swagger.annotations.ApiOperation;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.validation.annotation.Validated;
+import org.springframework.web.bind.annotation.*;
+import springfox.documentation.annotations.ApiIgnore;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.validation.Valid;
+import javax.validation.constraints.NotNull;
+import java.util.List;
+
+/**
+ * @author wuyunfeng
+ * 2022-06-21 11:15
+ */
+@RequestMapping(value = "/pdm/templateparamgroup")
+@RestController
+@Api(value = "自定义打印模版参数分组",description = "自定义打印模版参数分组",tags = "自定义打印模版参数分组")
+@Validated
+public class WdPrintTemplateParamGroupController {
+
+
+    @Autowired
+    private WdPrintTemplateParamGroupManager wdPrintTemplateParamGroupManager;
+
+    @ApiOperation(value = "查询模版参数分组列表", response = WdPrintTemplateParamGroupDO.class)
+    @ApiImplicitParams({
+            @ApiImplicitParam(name = "page_no", value = "页码", required = true, dataType = "int", example ="1", paramType = "query"),
+            @ApiImplicitParam(name = "page_size", value = "每页显示数量", required = true, dataType = "int", example ="20", paramType = "query")
+    })
+    @PostMapping("/page")
+    public Page list(@ApiIgnore @NotNull(message = "页码不能为空") Integer pageNo,
+                     @ApiIgnore @NotNull(message = "页容量") Integer pageSize,
+                     HttpServletRequest request) {
+        GridParameter gp = GridParameterParser.parse(WdPrintTemplateParamGroupDO.class, request.getParameterMap());
+
+        return this.wdPrintTemplateParamGroupManager.list(gp);
+    }
+
+
+    @ApiOperation(value = "添加模版参数分组", response = WdPrintTemplateParamGroupDO.class)
+    @PostMapping
+    public WdPrintTemplateParamGroupDO add(@Valid WdPrintTemplateParamGroupDO wdProduceFileDO) {
+        this.wdPrintTemplateParamGroupManager.add(wdProduceFileDO);
+        return wdProduceFileDO;
+    }
+
+    @PutMapping(value = "/{id}")
+    @ApiOperation(value = "修改模版参数分组", response = WdPrintTemplateParamGroupDO.class)
+    @ApiImplicitParams({
+            @ApiImplicitParam(name = "id", value = "主键", required = true, dataType = "int", example = "1" ,paramType = "path")})
+    public WdPrintTemplateParamGroupDO edit(@Valid WdPrintTemplateParamGroupDO wdProduceFileDO, @PathVariable Integer id) {
+        this.wdPrintTemplateParamGroupManager.edit(wdProduceFileDO, id);
+        return wdProduceFileDO;
+    }
+
+    @DeleteMapping(value = "/{ids}")
+    @ApiOperation(value = "删除模版参数分组")
+    @ApiImplicitParams({
+            @ApiImplicitParam(name = "ids", value = "要删除的模版参数分组主键集合", required = true, dataType = "int", example = "1",paramType = "path", allowMultiple = true)})
+    public String delete(@PathVariable Integer[] ids) {
+        this.wdPrintTemplateParamGroupManager.delete(ids);
+        return "";
+    }
+
+    @GetMapping("/all")
+    @ApiOperation(value = "获取所有模版参数分组列表")
+    public List<WdPrintTemplateParamGroupDO> getAll(){
+        return this.wdPrintTemplateParamGroupManager.getAll();
+    }
+}

+ 80 - 0
src/main/java/com/wdkl/pdm/controller/WdProduceFileController.java

@@ -0,0 +1,80 @@
+package com.wdkl.pdm.controller;
+
+import com.wdkl.pdm.database.Page;
+import com.wdkl.pdm.dos.WdProduceFileDO;
+import com.wdkl.pdm.mvc.GridParameter;
+import com.wdkl.pdm.mvc.GridParameterParser;
+import com.wdkl.pdm.service.WdProduceFileManager;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiImplicitParam;
+import io.swagger.annotations.ApiImplicitParams;
+import io.swagger.annotations.ApiOperation;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.validation.annotation.Validated;
+import org.springframework.web.bind.annotation.*;
+import springfox.documentation.annotations.ApiIgnore;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.validation.Valid;
+import javax.validation.constraints.NotNull;
+import java.util.List;
+
+/**
+ * @author wuyunfeng
+ * 2022-04-02 16:18
+ */
+@RequestMapping(value = "/pdm/producefile")
+@RestController
+@Api(value = "产品烧录文件ROM文件管理",description = "产品烧录文件ROM文件管理",tags = "产品烧录文件ROM文件管理")
+@Validated
+public class WdProduceFileController {
+
+    @Autowired
+    private WdProduceFileManager wdProduceFileManager;
+
+    @ApiOperation(value = "查询产品列表", response = WdProduceFileDO.class)
+    @ApiImplicitParams({
+            @ApiImplicitParam(name = "page_no", value = "页码", required = true, dataType = "int", example ="1", paramType = "query"),
+            @ApiImplicitParam(name = "page_size", value = "每页显示数量", required = true, dataType = "int", example ="20", paramType = "query")
+    })
+    @PostMapping("/page")
+    public Page list(@ApiIgnore @NotNull(message = "页码不能为空") Integer pageNo,
+                     @ApiIgnore @NotNull(message = "页容量") Integer pageSize,
+                     HttpServletRequest request) {
+        GridParameter gp = GridParameterParser.parse(WdProduceFileDO.class, request.getParameterMap());
+
+        return this.wdProduceFileManager.list(gp);
+    }
+
+
+    @ApiOperation(value = "添加文件", response = WdProduceFileDO.class)
+    @PostMapping
+    public WdProduceFileDO add(@Valid WdProduceFileDO wdProduceFileDO) {
+        this.wdProduceFileManager.add(wdProduceFileDO);
+        return wdProduceFileDO;
+    }
+
+    @PutMapping(value = "/{id}")
+    @ApiOperation(value = "修改文件", response = WdProduceFileDO.class)
+    @ApiImplicitParams({
+            @ApiImplicitParam(name = "id", value = "主键", required = true, dataType = "int", example = "1" ,paramType = "path")})
+    public WdProduceFileDO edit(@Valid WdProduceFileDO wdProduceFileDO, @PathVariable Integer id) {
+        this.wdProduceFileManager.edit(wdProduceFileDO, id);
+        return wdProduceFileDO;
+    }
+
+    @DeleteMapping(value = "/{ids}")
+    @ApiOperation(value = "删除文件")
+    @ApiImplicitParams({
+            @ApiImplicitParam(name = "ids", value = "要删除的文件主键集合", required = true, dataType = "int", example = "1",paramType = "path", allowMultiple = true)})
+    public String delete(@PathVariable Integer[] ids) {
+        this.wdProduceFileManager.delete(ids);
+        return "";
+    }
+
+    @GetMapping("/all")
+    @ApiOperation(value = "获取所有文件列表")
+    public List<WdProduceFileDO> getAll(){
+        return this.wdProduceFileManager.getAll();
+    }
+}

+ 82 - 0
src/main/java/com/wdkl/pdm/controller/WdProduceVersionController.java

@@ -0,0 +1,82 @@
+package com.wdkl.pdm.controller;
+
+import com.wdkl.pdm.database.Page;
+import com.wdkl.pdm.dos.WdProduceVersionDO;
+import com.wdkl.pdm.mvc.GridParameter;
+import com.wdkl.pdm.mvc.GridParameterParser;
+import com.wdkl.pdm.service.WdProduceVersionManager;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiImplicitParam;
+import io.swagger.annotations.ApiImplicitParams;
+import io.swagger.annotations.ApiOperation;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.validation.annotation.Validated;
+import org.springframework.web.bind.annotation.*;
+import springfox.documentation.annotations.ApiIgnore;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.validation.Valid;
+import javax.validation.constraints.NotNull;
+
+/**
+ * @author wuyunfeng
+ * 2022-04-27 15:48
+ */
+@RequestMapping(value = "/pdm/version")
+@RestController
+@Api(value = "生产工具客户端版本管理接口",description = "生产工具客户端版本管理接口",tags = "生产工具客户端版本管理接口")
+@Validated
+public class WdProduceVersionController {
+
+    @Autowired
+    private WdProduceVersionManager wdProduceVersionManager;
+
+    @ApiOperation(value = "查询产品列表", response = WdProduceVersionDO.class)
+    @ApiImplicitParams({
+            @ApiImplicitParam(name = "page_no", value = "页码", required = true, dataType = "int", example ="1", paramType = "query"),
+            @ApiImplicitParam(name = "page_size", value = "每页显示数量", required = true, dataType = "int", example ="20", paramType = "query")
+    })
+    @PostMapping("/page")
+    public Page list(@ApiIgnore @NotNull(message = "页码不能为空") Integer pageNo,
+                     @ApiIgnore @NotNull(message = "页容量") Integer pageSize,
+                     HttpServletRequest request) {
+        GridParameter gp = GridParameterParser.parse(WdProduceVersionDO.class, request.getParameterMap());
+
+        return this.wdProduceVersionManager.list(gp);
+    }
+
+
+    @ApiOperation(value = "添加新版本", response = WdProduceVersionDO.class)
+    @PostMapping
+    public WdProduceVersionDO add(@Valid WdProduceVersionDO wdProduceVersionDO) {
+        this.wdProduceVersionManager.add(wdProduceVersionDO);
+        return wdProduceVersionDO;
+    }
+
+    @PutMapping(value = "/{id}")
+    @ApiOperation(value = "修改版本", response = WdProduceVersionDO.class)
+    @ApiImplicitParams({
+            @ApiImplicitParam(name = "id", value = "主键", required = true, dataType = "int", example = "1" ,paramType = "path")})
+    public WdProduceVersionDO edit(@Valid WdProduceVersionDO wdProduceVersionDO, @PathVariable Integer id) {
+        this.wdProduceVersionManager.edit(wdProduceVersionDO, id);
+        return wdProduceVersionDO;
+    }
+
+    @DeleteMapping(value = "/{ids}")
+    @ApiOperation(value = "删除版本")
+    @ApiImplicitParams({
+            @ApiImplicitParam(name = "ids", value = "要删除的版本主键集合", required = true, dataType = "int", example = "1",paramType = "path", allowMultiple = true)})
+    public String delete(@PathVariable Integer[] ids) {
+        this.wdProduceVersionManager.delete(ids);
+        return "";
+    }
+
+
+    @GetMapping(value = "/check")
+    @ApiOperation(value = "获取可更新的版本信息")
+    public WdProduceVersionDO getVersion() {
+        return this.wdProduceVersionManager.getVersion();
+
+    }
+
+}

Datei-Diff unterdrückt, da er zu groß ist
+ 71 - 0
src/main/java/com/wdkl/pdm/controller/WdProducedProductController.java


+ 79 - 0
src/main/java/com/wdkl/pdm/controller/WdProductCategoryController.java

@@ -0,0 +1,79 @@
+package com.wdkl.pdm.controller;
+
+import com.wdkl.pdm.database.Page;
+import com.wdkl.pdm.dos.WdProductCategoryDO;
+import com.wdkl.pdm.mvc.GridParameter;
+import com.wdkl.pdm.mvc.GridParameterParser;
+import com.wdkl.pdm.service.WdProductCategoryManager;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiImplicitParam;
+import io.swagger.annotations.ApiImplicitParams;
+import io.swagger.annotations.ApiOperation;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.validation.annotation.Validated;
+import org.springframework.web.bind.annotation.*;
+import springfox.documentation.annotations.ApiIgnore;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.validation.Valid;
+import javax.validation.constraints.NotNull;
+import java.util.List;
+
+/**
+ * @author wuyunfeng
+ * 2022-04-15 10:21
+ */
+@RequestMapping(value = "/pdm/category")
+@RestController
+@Api(value = "产品分类", description = "产品分类", tags = "产品分类")
+@Validated
+public class WdProductCategoryController {
+    @Autowired
+    private WdProductCategoryManager wdProductCategoryManager;
+
+    @ApiOperation(value = "查询产品分类列表", response = WdProductCategoryDO.class)
+    @ApiImplicitParams({
+            @ApiImplicitParam(name = "page_no", value = "页码", required = true, dataType = "int", example ="1", paramType = "query"),
+            @ApiImplicitParam(name = "page_size", value = "每页显示数量", required = true, dataType = "int", example ="20", paramType = "query")
+    })
+    @PostMapping("/page")
+    public Page list(@ApiIgnore @NotNull(message = "页码不能为空") Integer pageNo,
+                     @ApiIgnore @NotNull(message = "页容量") Integer pageSize,
+                     HttpServletRequest request) {
+        GridParameter gp = GridParameterParser.parse(WdProductCategoryDO.class, request.getParameterMap());
+
+        return this.wdProductCategoryManager.list(gp);
+    }
+
+
+    @ApiOperation(value = "添加产品分类", response = WdProductCategoryDO.class)
+    @PostMapping
+    public WdProductCategoryDO add(@Valid WdProductCategoryDO wdProductCategoryDO) {
+
+        return this.wdProductCategoryManager.add(wdProductCategoryDO);
+    }
+
+    @PutMapping(value = "/{id}")
+    @ApiOperation(value = "修改产品分类", response = WdProductCategoryDO.class)
+    @ApiImplicitParams({
+            @ApiImplicitParam(name = "id", value = "主键", required = true, dataType = "int", example = "1" ,paramType = "path")})
+    public WdProductCategoryDO edit(@Valid WdProductCategoryDO wdProductCategoryDO, @PathVariable Integer id) {
+        this.wdProductCategoryManager.edit(wdProductCategoryDO, id);
+        return wdProductCategoryDO;
+    }
+
+    @DeleteMapping(value = "/{ids}")
+    @ApiOperation(value = "删除产品分类")
+    @ApiImplicitParams({
+            @ApiImplicitParam(name = "ids", value = "要删除的产品分类主键集合", required = true, dataType = "int", example = "1",paramType = "path", allowMultiple = true)})
+    public String delete(@PathVariable Integer[] ids) {
+        this.wdProductCategoryManager.delete(ids);
+        return "";
+    }
+
+    @GetMapping("/all")
+    @ApiOperation(value = "获取所有产品分类", response = WdProductCategoryDO.class)
+    public List<WdProductCategoryDO> getAll(){
+        return  this.wdProductCategoryManager.getAll();
+    }
+}

+ 80 - 0
src/main/java/com/wdkl/pdm/controller/WdProductCategoryLabelPrefixController.java

@@ -0,0 +1,80 @@
+package com.wdkl.pdm.controller;
+
+import com.wdkl.pdm.database.Page;
+import com.wdkl.pdm.dos.WdProductCategoryLabelPrefixDO;
+import com.wdkl.pdm.mvc.GridParameter;
+import com.wdkl.pdm.mvc.GridParameterParser;
+import com.wdkl.pdm.service.WdProductCategoryLabelPrefixManager;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiImplicitParam;
+import io.swagger.annotations.ApiImplicitParams;
+import io.swagger.annotations.ApiOperation;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.validation.annotation.Validated;
+import org.springframework.web.bind.annotation.*;
+import springfox.documentation.annotations.ApiIgnore;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.validation.Valid;
+import javax.validation.constraints.NotNull;
+import java.util.List;
+
+/**
+ * @author wuyunfeng
+ * 2022-06-24 15:32
+ */
+@RequestMapping(value = "/pdm/categoryprefix")
+@RestController
+@Api(value = "产品分类标签前缀", description = "产品分类标签前缀", tags = "产品分类标签前缀")
+@Validated
+public class WdProductCategoryLabelPrefixController {
+
+    @Autowired
+    private WdProductCategoryLabelPrefixManager wdProductCategoryLabelPrefixManager;
+
+    @ApiOperation(value = "查询产品分类标签前缀列表", response = WdProductCategoryLabelPrefixDO.class)
+    @ApiImplicitParams({
+            @ApiImplicitParam(name = "page_no", value = "页码", required = true, dataType = "int", example = "1", paramType = "query"),
+            @ApiImplicitParam(name = "page_size", value = "每页显示数量", required = true, dataType = "int", example = "20", paramType = "query")
+    })
+    @PostMapping("/page")
+    public Page list(@ApiIgnore @NotNull(message = "页码不能为空") Integer pageNo,
+                     @ApiIgnore @NotNull(message = "页容量") Integer pageSize,
+                     HttpServletRequest request) {
+        GridParameter gp = GridParameterParser.parse(WdProductCategoryLabelPrefixDO.class, request.getParameterMap());
+
+        return this.wdProductCategoryLabelPrefixManager.list(gp);
+    }
+
+
+    @ApiOperation(value = "添加产品分类标签前缀", response = WdProductCategoryLabelPrefixDO.class)
+    @PostMapping
+    public WdProductCategoryLabelPrefixDO add(@Valid WdProductCategoryLabelPrefixDO wdProductCategoryLabelPrefixDO) {
+        this.wdProductCategoryLabelPrefixManager.add(wdProductCategoryLabelPrefixDO);
+        return wdProductCategoryLabelPrefixDO;
+    }
+
+    @PutMapping(value = "/{id}")
+    @ApiOperation(value = "修改产品分类标签前缀", response = WdProductCategoryLabelPrefixDO.class)
+    @ApiImplicitParams({
+            @ApiImplicitParam(name = "id", value = "主键", required = true, dataType = "int", example = "1", paramType = "path")})
+    public WdProductCategoryLabelPrefixDO edit(@Valid WdProductCategoryLabelPrefixDO wdProductCategoryLabelPrefixDO, @PathVariable Integer id) {
+        this.wdProductCategoryLabelPrefixManager.edit(wdProductCategoryLabelPrefixDO, id);
+        return wdProductCategoryLabelPrefixDO;
+    }
+
+    @DeleteMapping(value = "/{ids}")
+    @ApiOperation(value = "删除产品分类标签前缀")
+    @ApiImplicitParams({
+            @ApiImplicitParam(name = "ids", value = "要删除的产品分类标签前缀主键集合", required = true, dataType = "int", example = "1", paramType = "path", allowMultiple = true)})
+    public String delete(@PathVariable Integer[] ids) {
+        this.wdProductCategoryLabelPrefixManager.delete(ids);
+        return "";
+    }
+
+    @GetMapping("/all")
+    @ApiOperation(value = "获取所有产品分类标签前缀列表")
+    public List<WdProductCategoryLabelPrefixDO> getAll() {
+        return this.wdProductCategoryLabelPrefixManager.getAll();
+    }
+}

+ 84 - 0
src/main/java/com/wdkl/pdm/controller/WdProductController.java

@@ -0,0 +1,84 @@
+package com.wdkl.pdm.controller;
+
+import com.wdkl.pdm.database.Page;
+import com.wdkl.pdm.dos.WdProductDO;
+import com.wdkl.pdm.mvc.GridParameter;
+import com.wdkl.pdm.mvc.GridParameterParser;
+import com.wdkl.pdm.service.WdProductManager;
+import com.wdkl.pdm.vos.WdProductVO;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiImplicitParam;
+import io.swagger.annotations.ApiImplicitParams;
+import io.swagger.annotations.ApiOperation;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.validation.annotation.Validated;
+import org.springframework.web.bind.annotation.*;
+import springfox.documentation.annotations.ApiIgnore;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.validation.Valid;
+import javax.validation.constraints.NotNull;
+import java.util.List;
+
+/**
+ * @author wuyunfeng
+ * 2022-04-01 16:42
+ */
+@RequestMapping(value = "/pdm/product")
+@RestController
+@Api(value = "产品管理",description = "产品管理",tags = "产品管理")
+@Validated
+public class WdProductController {
+
+    @Autowired
+    private WdProductManager wdProductManager;
+
+    @ApiOperation(value = "查询产品列表", response = WdProductDO.class)
+    @ApiImplicitParams({
+            @ApiImplicitParam(name = "page_no", value = "页码", required = true, dataType = "int", example ="1", paramType = "query"),
+            @ApiImplicitParam(name = "page_size", value = "每页显示数量", required = true, dataType = "int", example ="20", paramType = "query")
+    })
+    @PostMapping("/page")
+    public Page list(@ApiIgnore @NotNull(message = "页码不能为空") Integer pageNo,
+                     @ApiIgnore @NotNull(message = "页容量") Integer pageSize,
+                     HttpServletRequest request) {
+        GridParameter gp = GridParameterParser.parse(WdProductVO.class, request.getParameterMap());
+        gp.setSqlSelect("SELECT*FROM (\n" +
+                "SELECT pd.*,mcu.file_name AS mcu_file_name,rom.file_name AS rom_file_name,mcuchip.chip_name AS mcu_chip_name,romchip.chip_name AS rom_chip_name FROM wd_product AS pd LEFT JOIN wd_produce_file AS mcu ON pd.mcu_file_union_id=mcu.union_id LEFT JOIN wd_produce_file AS rom ON pd.rom_file_union_id=rom.union_id LEFT JOIN wd_chip AS mcuchip ON pd.mcu_chip_union_id=mcuchip.union_id LEFT JOIN wd_chip AS romchip ON pd.rom_chip_union_id=romchip.union_id) a ");
+        return this.wdProductManager.list(gp);
+    }
+
+
+    @ApiOperation(value = "添加产品", response = WdProductDO.class)
+    @PostMapping
+    public WdProductDO add(@Valid WdProductDO wdProductDO) {
+        this.wdProductManager.add(wdProductDO);
+        return wdProductDO;
+    }
+
+    @PutMapping(value = "/{id}")
+    @ApiOperation(value = "修改产品", response = WdProductDO.class)
+    @ApiImplicitParams({
+            @ApiImplicitParam(name = "id", value = "主键", required = true, dataType = "int", example = "1" ,paramType = "path")})
+    public WdProductDO edit(@Valid WdProductDO wdProductDO, @PathVariable Integer id) {
+        this.wdProductManager.edit(wdProductDO, id);
+        return wdProductDO;
+    }
+
+    @DeleteMapping(value = "/{ids}")
+    @ApiOperation(value = "删除产品")
+    @ApiImplicitParams({
+            @ApiImplicitParam(name = "ids", value = "要删除的产品主键集合", required = true, dataType = "int", example = "1",paramType = "path", allowMultiple = true)})
+    public String delete(@PathVariable Integer[] ids) {
+        this.wdProductManager.delete(ids);
+        return "";
+    }
+
+    @GetMapping("/all")
+    @ApiOperation(value = "获取所有可生产产品")
+    public List<WdProductDO> getAll(){
+        return this.wdProductManager.getAll();
+    }
+
+
+}

+ 89 - 0
src/main/java/com/wdkl/pdm/controller/WdThemometerProducedController.java

@@ -0,0 +1,89 @@
+package com.wdkl.pdm.controller;
+
+import com.wdkl.pdm.database.Page;
+import com.wdkl.pdm.dos.WdThemometerProducedDO;
+import com.wdkl.pdm.mvc.GridParameter;
+import com.wdkl.pdm.mvc.GridParameterParser;
+import com.wdkl.pdm.mvc.JsonResponse;
+import com.wdkl.pdm.service.WdThemometerProducedManager;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiImplicitParam;
+import io.swagger.annotations.ApiImplicitParams;
+import io.swagger.annotations.ApiOperation;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.validation.annotation.Validated;
+import org.springframework.web.bind.annotation.*;
+import springfox.documentation.annotations.ApiIgnore;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.validation.Valid;
+import javax.validation.constraints.NotNull;
+import java.util.List;
+
+/**
+ * @author wuyunfeng
+ * 2023-01-04 18:58
+ * ${description}
+ */
+@RequestMapping(value = "/pdm/thermometerproduced")
+@RestController
+@Api(value = "体温枪生产记录",description = "体温枪生产记录",tags = "体温枪生产记录")
+@Validated
+public class WdThemometerProducedController {
+
+
+    @Autowired
+    private WdThemometerProducedManager wdThemometerProducedManager;
+
+    @ApiOperation(value = "查询体温枪生产记录列表")
+    @ApiImplicitParams({
+            @ApiImplicitParam(name = "page_no", value = "页码", required = true, dataType = "int", example ="1", paramType = "query"),
+            @ApiImplicitParam(name = "page_size", value = "每页显示数量", required = true, dataType = "int", example ="20", paramType = "query")
+    })
+    @PostMapping("/page")
+    public Page list(@ApiIgnore @NotNull(message = "页码不能为空") Integer pageNo,
+                     @ApiIgnore @NotNull(message = "页容量") Integer pageSize,
+                     HttpServletRequest request) {
+        GridParameter gp = GridParameterParser.parse(WdThemometerProducedDO.class, request.getParameterMap());
+
+        return this.wdThemometerProducedManager.list(gp);
+    }
+
+
+    @ApiOperation(value = "添加体温枪生产记录", response = WdThemometerProducedDO.class)
+    @PostMapping
+    public WdThemometerProducedDO add(@Valid WdThemometerProducedDO wdProductDO) {
+        this.wdThemometerProducedManager.add(wdProductDO);
+        return wdProductDO;
+    }
+
+    @PutMapping(value = "/{id}")
+    @ApiOperation(value = "修改体温枪生产记录", response = WdThemometerProducedDO.class)
+    @ApiImplicitParams({
+            @ApiImplicitParam(name = "id", value = "主键", required = true, dataType = "int", example = "1" ,paramType = "path")})
+    public WdThemometerProducedDO edit(@Valid WdThemometerProducedDO wdProductDO, @PathVariable Integer id) {
+        this.wdThemometerProducedManager.edit(wdProductDO, id);
+        return wdProductDO;
+    }
+
+    @DeleteMapping(value = "/{ids}")
+    @ApiOperation(value = "删除体温枪生产记录")
+    @ApiImplicitParams({
+            @ApiImplicitParam(name = "ids", value = "要删除的体温枪生产记录主键集合", required = true, dataType = "int", example = "1",paramType = "path", allowMultiple = true)})
+    public String delete(@PathVariable Integer[] ids) {
+        this.wdThemometerProducedManager.delete(ids);
+        return "";
+    }
+
+
+    @PostMapping("/upload")
+    @ApiOperation(value = "上传已生产体温枪生产记录", notes = "客户端上传已经生产的体温枪生产记录",
+            response = JsonResponse.class)
+    @ApiImplicitParams({
+            @ApiImplicitParam(name = "list", value = "生产记录", allowMultiple = true, required = true, dataType = "WdThemometerProducedDO", dataTypeClass = WdThemometerProducedDO.class)
+    })
+    public JsonResponse uploadProcedProduct(@RequestBody List<WdThemometerProducedDO> list) {
+        return this.wdThemometerProducedManager.uploadProduct(list);
+    }
+
+}

+ 82 - 0
src/main/java/com/wdkl/pdm/controller/WdThermometerCategoryController.java

@@ -0,0 +1,82 @@
+package com.wdkl.pdm.controller;
+
+import com.wdkl.pdm.database.Page;
+import com.wdkl.pdm.dos.WdThermometerCategoryDO;
+import com.wdkl.pdm.mvc.GridParameter;
+import com.wdkl.pdm.mvc.GridParameterParser;
+import com.wdkl.pdm.service.WdThermometerCategoryManager;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiImplicitParam;
+import io.swagger.annotations.ApiImplicitParams;
+import io.swagger.annotations.ApiOperation;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.validation.annotation.Validated;
+import org.springframework.web.bind.annotation.*;
+import springfox.documentation.annotations.ApiIgnore;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.validation.Valid;
+import javax.validation.constraints.NotNull;
+import java.util.List;
+
+/**
+ * @author wuyunfeng
+ * 2023-01-04 18:50
+ * ${description}
+ */
+@RequestMapping(value = "/pdm/thermometercategory")
+@RestController
+@Api(value = "体温枪分类",description = "体温枪分类",tags = "体温枪分类")
+@Validated
+public class WdThermometerCategoryController {
+    
+    @Autowired
+    private WdThermometerCategoryManager wdThermometerCategoryManager;
+
+    @ApiOperation(value = "查询体温枪分类列表")
+    @ApiImplicitParams({
+            @ApiImplicitParam(name = "page_no", value = "页码", required = true, dataType = "int", example ="1", paramType = "query"),
+            @ApiImplicitParam(name = "page_size", value = "每页显示数量", required = true, dataType = "int", example ="20", paramType = "query")
+    })
+    @PostMapping("/page")
+    public Page list(@ApiIgnore @NotNull(message = "页码不能为空") Integer pageNo,
+                     @ApiIgnore @NotNull(message = "页容量") Integer pageSize,
+                     HttpServletRequest request) {
+        GridParameter gp = GridParameterParser.parse(WdThermometerCategoryDO.class, request.getParameterMap());
+
+        return this.wdThermometerCategoryManager.list(gp);
+    }
+
+
+    @ApiOperation(value = "添加体温枪分类", response = WdThermometerCategoryDO.class)
+    @PostMapping
+    public WdThermometerCategoryDO add(@Valid WdThermometerCategoryDO wdProductDO) {
+        this.wdThermometerCategoryManager.add(wdProductDO);
+        return wdProductDO;
+    }
+
+    @PutMapping(value = "/{id}")
+    @ApiOperation(value = "修改体温枪分类", response = WdThermometerCategoryDO.class)
+    @ApiImplicitParams({
+            @ApiImplicitParam(name = "id", value = "主键", required = true, dataType = "int", example = "1" ,paramType = "path")})
+    public WdThermometerCategoryDO edit(@Valid WdThermometerCategoryDO wdProductDO, @PathVariable Integer id) {
+        this.wdThermometerCategoryManager.edit(wdProductDO, id);
+        return wdProductDO;
+    }
+
+    @DeleteMapping(value = "/{ids}")
+    @ApiOperation(value = "删除体温枪分类")
+    @ApiImplicitParams({
+            @ApiImplicitParam(name = "ids", value = "要删除的体温枪分类主键集合", required = true, dataType = "int", example = "1",paramType = "path", allowMultiple = true)})
+    public String delete(@PathVariable Integer[] ids) {
+        this.wdThermometerCategoryManager.delete(ids);
+        return "";
+    }
+
+    @GetMapping("/all")
+    @ApiOperation(value = "获取所有体温枪分类",responseContainer = "List",response = WdThermometerCategoryDO.class)
+    public List<WdThermometerCategoryDO> getAll(){
+        return this.wdThermometerCategoryManager.getAll();
+    }
+
+}

+ 82 - 0
src/main/java/com/wdkl/pdm/controller/WdThermometerSchedualController.java

@@ -0,0 +1,82 @@
+package com.wdkl.pdm.controller;
+
+import com.wdkl.pdm.database.Page;
+import com.wdkl.pdm.dos.WdThermometerSchedualDO;
+import com.wdkl.pdm.mvc.GridParameter;
+import com.wdkl.pdm.mvc.GridParameterParser;
+import com.wdkl.pdm.service.WdThermometerSchedualManager;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiImplicitParam;
+import io.swagger.annotations.ApiImplicitParams;
+import io.swagger.annotations.ApiOperation;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.validation.annotation.Validated;
+import org.springframework.web.bind.annotation.*;
+import springfox.documentation.annotations.ApiIgnore;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.validation.Valid;
+import javax.validation.constraints.NotNull;
+import java.util.List;
+
+/**
+ * @author wuyunfeng
+ * 2023-01-05 09:17
+ * ${description}
+ */
+@RequestMapping(value = "/pdm/thermometerschedual")
+@RestController
+@Api(value = "体温枪生产班次",description = "体温枪生产班次",tags = "体温枪生产班次")
+@Validated
+public class WdThermometerSchedualController {
+
+    @Autowired
+    private WdThermometerSchedualManager wdThermometerSchedualManager;
+
+    @ApiOperation(value = "查询体温枪生产班次列表")
+    @ApiImplicitParams({
+            @ApiImplicitParam(name = "page_no", value = "页码", required = true, dataType = "int", example ="1", paramType = "query"),
+            @ApiImplicitParam(name = "page_size", value = "每页显示数量", required = true, dataType = "int", example ="20", paramType = "query")
+    })
+    @PostMapping("/page")
+    public Page list(@ApiIgnore @NotNull(message = "页码不能为空") Integer pageNo,
+                     @ApiIgnore @NotNull(message = "页容量") Integer pageSize,
+                     HttpServletRequest request) {
+        GridParameter gp = GridParameterParser.parse(WdThermometerSchedualDO.class, request.getParameterMap());
+
+        return this.wdThermometerSchedualManager.list(gp);
+    }
+
+
+    @ApiOperation(value = "添加体温枪生产班次", response = WdThermometerSchedualDO.class)
+    @PostMapping
+    public WdThermometerSchedualDO add(@Valid WdThermometerSchedualDO wdThermometerSchedualDO) {
+        this.wdThermometerSchedualManager.add(wdThermometerSchedualDO);
+        return wdThermometerSchedualDO;
+    }
+
+    @PutMapping(value = "/{id}")
+    @ApiOperation(value = "修改体温枪生产班次", response = WdThermometerSchedualDO.class)
+    @ApiImplicitParams({
+            @ApiImplicitParam(name = "id", value = "主键", required = true, dataType = "int", example = "1" ,paramType = "path")})
+    public WdThermometerSchedualDO edit(@Valid WdThermometerSchedualDO wdThermometerSchedualDO, @PathVariable Integer id) {
+        this.wdThermometerSchedualManager.edit(wdThermometerSchedualDO, id);
+        return wdThermometerSchedualDO;
+    }
+
+    @DeleteMapping(value = "/{ids}")
+    @ApiOperation(value = "删除体温枪生产班次")
+    @ApiImplicitParams({
+            @ApiImplicitParam(name = "ids", value = "要删除的体温枪生产班次主键集合", required = true, dataType = "int", example = "1",paramType = "path", allowMultiple = true)})
+    public String delete(@PathVariable Integer[] ids) {
+        this.wdThermometerSchedualManager.delete(ids);
+        return "";
+    }
+
+    @GetMapping("/all")
+    @ApiOperation(value = "获取所有体温枪生产班次",responseContainer = "List",response = WdThermometerSchedualDO.class)
+    public List<WdThermometerSchedualDO> getAll(){
+        return this.wdThermometerSchedualManager.getAll();
+    }
+
+}

+ 73 - 0
src/main/java/com/wdkl/pdm/controller/WdUserController.java

@@ -0,0 +1,73 @@
+package com.wdkl.pdm.controller;
+
+import com.wdkl.pdm.database.Page;
+import com.wdkl.pdm.dos.WdUsersDO;
+import com.wdkl.pdm.mvc.GridParameter;
+import com.wdkl.pdm.mvc.GridParameterParser;
+import com.wdkl.pdm.service.WdUserManager;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiImplicitParam;
+import io.swagger.annotations.ApiImplicitParams;
+import io.swagger.annotations.ApiOperation;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.validation.annotation.Validated;
+import org.springframework.web.bind.annotation.*;
+import springfox.documentation.annotations.ApiIgnore;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.validation.Valid;
+import javax.validation.constraints.NotNull;
+
+/**
+ * @author wuyunfeng
+ * 2022-04-07 16:42
+ */
+@RequestMapping(value = "/pdm/user")
+@RestController
+@Api(value = "用户管理",description = "用户管理",tags = "用户管理")
+@Validated
+public class WdUserController {
+
+    @Autowired
+    private WdUserManager wdUserManager;
+
+    @ApiOperation(value = "查询用户列表", response = WdUsersDO.class)
+    @ApiImplicitParams({
+            @ApiImplicitParam(name = "page_no", value = "页码", required = true, dataType = "int", example ="1", paramType = "query"),
+            @ApiImplicitParam(name = "page_size", value = "每页显示数量", required = true, dataType = "int", example ="20", paramType = "query")
+    })
+    @PostMapping("/page")
+    public Page list(@ApiIgnore @NotNull(message = "页码不能为空") Integer pageNo,
+                     @ApiIgnore @NotNull(message = "页容量") Integer pageSize,
+                     HttpServletRequest request) {
+        GridParameter gp = GridParameterParser.parse(WdUsersDO.class, request.getParameterMap());
+
+        return this.wdUserManager.list(gp);
+    }
+
+
+    @ApiOperation(value = "添加用户", response = WdUsersDO.class)
+    @PostMapping
+    public WdUsersDO add(@Valid WdUsersDO wdUsersDO) {
+        this.wdUserManager.add(wdUsersDO);
+        return wdUsersDO;
+    }
+
+    @PutMapping(value = "/{id}")
+    @ApiOperation(value = "修改用户", response = WdUsersDO.class)
+    @ApiImplicitParams({
+            @ApiImplicitParam(name = "id", value = "主键", required = true, dataType = "int", example = "1" ,paramType = "path")})
+    public WdUsersDO edit(@Valid WdUsersDO wdUsersDO, @PathVariable Integer id) {
+        this.wdUserManager.edit(wdUsersDO, id);
+        return wdUsersDO;
+    }
+
+    @DeleteMapping(value = "/{ids}")
+    @ApiOperation(value = "删除用户")
+    @ApiImplicitParams({
+            @ApiImplicitParam(name = "ids", value = "要删除的用户主键集合", required = true, dataType = "int", example = "1",paramType = "path", allowMultiple = true)})
+    public String delete(@PathVariable Integer[] ids) {
+        this.wdUserManager.delete(ids);
+        return "";
+    }
+}

+ 46 - 0
src/main/java/com/wdkl/pdm/database/CRUDBaseManager.java

@@ -0,0 +1,46 @@
+package com.wdkl.pdm.database;
+
+
+import com.wdkl.pdm.mvc.GridParameter;
+
+/**
+ * 描述
+ *
+ * @author allen
+ */
+public interface CRUDBaseManager<T> {
+    /**
+     * 分页对象
+     * @param gp
+     * @return
+     */
+    Page list(GridParameter gp);
+
+    /**
+     * 编辑对象
+     * @param t
+     * @param id
+     * @return
+     */
+    T edit(T t, Integer id);
+
+    /**
+     * 新增对象
+     * @param t
+     * @return
+     */
+    T add(T t);
+
+    /**
+     * 删除
+     * @param ids
+     */
+    void delete(Integer[] ids);
+
+    /**
+     * 获取单个对象
+     * @param id
+     * @return
+     */
+    T getModel(Integer id);
+}

+ 34 - 0
src/main/java/com/wdkl/pdm/database/ColumnMeta.java

@@ -0,0 +1,34 @@
+package com.wdkl.pdm.database;
+
+/**
+ * 列数据
+ * @author Allen
+ */
+public class ColumnMeta {
+
+    /**
+     * 字段名
+     */
+    private Object[] names;
+
+    /**
+     * 字段值
+     */
+    private Object[] values;
+
+    public Object[] getNames() {
+        return names;
+    }
+
+    public void setNames(Object[] names) {
+        this.names = names;
+    }
+
+    public Object[] getValues() {
+        return values;
+    }
+
+    public void setValues(Object[] values) {
+        this.values = values;
+    }
+}

+ 43 - 0
src/main/java/com/wdkl/pdm/database/DBRuntimeException.java

@@ -0,0 +1,43 @@
+package com.wdkl.pdm.database;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+
+/**
+ * 数据库操作运行期异常
+ * @author Allen
+ */
+public class DBRuntimeException extends RuntimeException {
+
+ 
+	private static final long serialVersionUID = -368646349014580765L;
+	
+	private static final Log loger = LogFactory
+			.getLog(DBRuntimeException.class);
+
+	
+	public DBRuntimeException(String message){
+		super(message);
+	}
+	public DBRuntimeException(Exception e, String sql) {
+		
+		super("数据库运行期异常");
+		e.printStackTrace();
+		if(loger.isErrorEnabled()){
+			loger.error("数据库运行期异常,相关sql语句为"+ sql);
+		}
+	}
+	
+	
+	public DBRuntimeException(String message, String sql) {
+		
+		super(message);
+		if(loger.isErrorEnabled()){
+			loger.error(message+",相关sql语句为"+ sql);
+		 
+		}
+		
+	}
+	
+	
+}

+ 288 - 0
src/main/java/com/wdkl/pdm/database/DaoSupport.java

@@ -0,0 +1,288 @@
+package com.wdkl.pdm.database;
+
+import com.wdkl.pdm.mvc.GridParameter;
+import org.springframework.jdbc.core.RowMapper;
+
+import java.util.List;
+import java.util.Map;
+
+/**
+ * 数据库操作支撑接口
+ * @author Allen
+ */
+public interface DaoSupport {
+
+	/**
+	 * 执行sql语句
+	 * @param sql	sql语句
+	 * @param args	参数组
+	 */
+	int execute(String sql, Object... args) ;
+	
+	/**
+	 * 查询单一结果集<br/>
+	 * 并将结果转为<code>int</code>型返回
+	 * @param sql 查询的sql语句,确定结果为一行一列,且为数字型
+	 * @param args 对应sql语句中的参数值
+	 * @return
+	 */
+	Integer queryForInt(String sql, Object... args);
+	
+	/**
+	 * 查询单一结果集<br/>
+	 * 并将结果转为<code>long</code>型返回
+	 * @param sql 查询的sql语句,确保结果为一行一列,且为数字型
+	 * @param args 对应sql语句中的参数值
+	 * @return
+	 */
+	Long queryForLong(String sql, Object... args);
+	
+	
+	/**
+	 * 查询单一结果集<br/>
+	 * 并将结果转为<code>float</code>型返回
+	 * @param sql 查询的sql语句,确保结果为一行一列,且为数字型
+	 * @param args 对应sql语句中的参数值
+	 * @return
+	 */
+	Float queryForFloat(String sql, Object... args);
+	
+	
+	/**
+	 * 查询单一结果集<br/>
+	 * 并将结果转为<code>dobule</code>型返回
+	 * @param sql 查询的sql语句,确保结果为一行一列,且为数字型
+	 * @param args 对应sql语句中的参数值
+	 * @return
+	 */
+	Double queryForDouble(String sql, Object... args);
+	
+	
+	
+	
+	/**
+	 * 查询String 结果
+	 * @param sql 查询语句
+	 * @param args 参数 
+	 * @return String型的结果
+	 */
+	String queryForString(String sql, Object... args);
+	
+	/**
+	 * 查询单一结果集<br/>
+	 * 并将结果转为<code>Map</code>对象返回
+	 * @param sql 查询的sql语句
+	 * @param args 对应sql语句中的参数值
+	 * @return 以结果集中的列为key,值为value的<code>Map</code>
+	 */
+	@SuppressWarnings("unchecked")
+    Map queryForMap(String sql, Object... args) ;
+	
+	/**
+	 * 查询多行结果集<br/>
+	 * 并将结果转为<code>List<Map></code>
+	 * @param sql 查询的sql语句
+	 * @param args 对应sql语句中的参数值
+	 * @return  列表中元素为<code>Map</code>的<code>List</code>,<br/>Map结构:以结果集中的列为key,值为value,
+	 */
+	@SuppressWarnings("unchecked")
+    List queryForList(String sql, Object... args);
+	
+	
+	
+	/**
+	 * 查询多行结果集<br/>
+	 * 并将结果转为<code>List<T></code>
+	 * @param sql 查询的sql语句
+	 * @param clazz <code><T></code>的Class对象
+	 * @param args 对应sql语句中的参数值
+	 * @return  列表中元素为<code>T</code>的<code>List</code>
+	 */
+	<T> List<T> queryForList(String sql, Class<T> clazz, Object... args);
+
+
+	/**
+	 * 使用rowmapper查询多行结果集<br/>
+	 * 并将结果转为<code>List<T></code>
+	 * @param sql 查询的sql语句
+	 * @param rowMapper mapper
+	 * @param args  查询参数
+	 * @param <T>   列表中元素类型
+	 * @return
+	 */
+	<T> List<T> queryForList(String sql, RowMapper<T> rowMapper, Object... args);
+
+
+	/**
+	 * 分页查询多行结果集<br/>
+	 * @param sql 查询的sql语句
+	 * @param pageNo 查询的起始页
+	 * @param pageSize  每页数量
+	 * @param args  对应sql语句中的参数值
+	 * @return 列表中元素为<code>Map</code>的<code>List</code>,<br/>Map结构:以结果集中的列为key,值为value,
+	 */
+	@SuppressWarnings("unchecked")
+	<T> List<Map> queryForListPage(String sql, int pageNo, int pageSize, Object... args);
+	
+
+	/**
+	 * 分页查询
+	 * @param sql  查询的sql语句
+	 * @param pageNo 查询的起始页
+	 * @param pageSize  每页数量
+	 * @param args  对应sql语句中的参数值
+	 * @return 分页结果集对象
+	 */
+	Page queryForPage(String sql, int pageNo, int pageSize, Object... args) ;
+	
+	/**
+	 * 分页查询
+	 * @param sql  查询的sql语句
+	 * @param countSql 用于查询总记录数的sql语句
+	 * @param pageNo 查询的起始页
+	 * @param pageSize  每页数量
+	 * @param args  对应sql语句中的参数值
+	 * @return 分页结果集对象
+	 */
+	Page queryForPage(String sql, String countSql, int pageNo, int pageSize, Object... args);
+	
+	
+	/**
+	 * 分页查询
+	 * @param sql 查询的sql语句
+	 * @param pageNo 查询的起始页
+	 * @param pageSize 每页数量
+	 * @param clazz  <code><T></code>的Class对象
+	 * @param args 对应sql语句中的参数值
+	 * @return
+	 */
+	<T> Page queryForPage(String sql, int pageNo, int pageSize, Class<T> clazz, Object... args);
+
+	/**
+	 * 分页查询 Add By Allen. 20190325
+	 *
+	 * @param gp
+	 * @param clazz
+	 * @param <T>
+	 * @return
+	 */
+	<T> Page queryForPage(GridParameter gp, Class<T> clazz);
+
+	/**
+	 * 更新数据
+	 * @param table 表名
+	 * @param fields 字段-值Map
+	 * @param where 更新条件(字段-值Map)
+	 */
+	@SuppressWarnings("unchecked")
+	int update(String table, Map fields, Map<String, ?> where);
+
+	/**
+	 * 批量更新数据
+	 * @param sql 要执行的sql
+	 * @param batchArgs 相应的参数
+	 * @return
+	 */
+	int[] batchUpdate(String sql, List<Object[]> batchArgs);
+
+	/**
+	 * 批量更新数据
+	 * @param sql 要执行的sql数组
+	 * @return
+	 */
+	int[] batchUpdate(String... sql);
+
+
+	/**
+	 * 更新数据
+	 * @param table 表名
+	 * @param po 要更新的对象,保证对象的属性名和字段名对应
+	 * @param where 更新条件(字段-值Map)
+	 */
+	@SuppressWarnings("unchecked")
+	int update(String table, Object po, Map<String, ?> where);
+
+
+
+	/**
+	 * 新增数据
+	 * @param table  表名
+	 * @param fields 字段-值Map
+	 */
+	@SuppressWarnings("unchecked")
+	void insert(String table, Map fields);
+
+	/**
+	 * 新增数据
+	 * @param table 表名
+	 * @param po 要新增的对象,保证对象的属性名和字段名对应
+	 */
+	void insert(String table, Object po);
+
+	/**
+	 * 读取最后插入的主键id
+	 * @param table	表名
+	 * @return
+	 */
+	int getLastId(String table);
+
+
+	/**
+	 * 执行带分页的sql语句
+	 * @param sql	sql语句
+	 * @param page	页数
+	 * @param pageSize	条数
+	 * @return
+	 */
+	String buildPageSql(String sql, int page, int pageSize);
+
+	/**
+	 * 新增数据
+	 * @param t  DO对象
+	 * @param <T>
+	 */
+	<T> void insert(T t);
+
+    /**
+     * 新增数据
+     *
+     * @param t   DO对象
+     * @param <T>
+     */
+    <T> int insertRecord(T t);
+
+	/**
+	 * 修改数据
+	 * @param model	DO对象
+	 * @param id	主键ID
+	 * @param <T>
+	 */
+	<T> void update(T model, Integer id);
+
+	/**
+	 * 删除数据
+	 * @param clazz	DO对象的class
+	 * @param id	主键ID
+	 * @param <T>
+	 */
+	<T> void delete(Class<T> clazz, Integer id);
+
+	/**
+	 * 查询一行数据
+	 * @param clazz	DO对象的class
+	 * @param id	主键ID
+	 * @param <T>
+	 * @return
+	 */
+	<T> T queryForObject(Class<T> clazz, Integer id);
+
+
+	/**
+	 * 查询一个对象
+	 * @param sql 查询 sql
+	 * @param args  sql中的查询 参数
+	 * @param clazz 对象的类型
+	 * @return 数据转后的对象
+	 */
+	<T> T queryForObject(String sql, Class<T> clazz, Object... args);
+}

+ 45 - 0
src/main/java/com/wdkl/pdm/database/DataMeta.java

@@ -0,0 +1,45 @@
+package com.wdkl.pdm.database;
+
+import java.util.Arrays;
+
+/**
+ * 元数据
+ * @author Allen
+ */
+public class DataMeta {
+
+    /**
+     * sql 语句
+     */
+    private String sql;
+
+    /**
+     * sql 语句中需要的参数
+     */
+    private Object[] paramter;
+
+
+    public String getSql() {
+        return sql;
+    }
+
+    public void setSql(String sql) {
+        this.sql = sql;
+    }
+
+    public Object[] getParamter() {
+        return paramter;
+    }
+
+    public void setParamter(Object[] paramter) {
+        this.paramter = paramter;
+    }
+
+    @Override
+    public String toString() {
+        return "DataMeta{" +
+                "sql='" + sql + '\'' +
+                ", paramter=" + Arrays.toString(paramter) +
+                '}';
+    }
+}

+ 21 - 0
src/main/java/com/wdkl/pdm/database/DoubleMapper.java

@@ -0,0 +1,21 @@
+package com.wdkl.pdm.database;
+
+import org.springframework.jdbc.core.RowMapper;
+
+import java.sql.ResultSet;
+import java.sql.SQLException;
+
+/**
+ * 浮点型mapper
+ * @author Allen
+ */
+public class DoubleMapper implements RowMapper<Double> {
+
+	
+	@Override
+    public Double mapRow(ResultSet rs, int rowNum) throws SQLException {
+		Double dobule = new Double(rs.getDouble(1));
+		return dobule;
+	}
+
+}

+ 29 - 0
src/main/java/com/wdkl/pdm/database/DynamicField.java

@@ -0,0 +1,29 @@
+package com.wdkl.pdm.database;
+
+
+import com.wdkl.pdm.database.annotation.NotDbField;
+
+import java.util.HashMap;
+import java.util.Map;
+
+
+/**
+ * 动态字段
+ * @author Allen
+ */
+public class DynamicField {
+	
+	private Map<String, Object> fields;
+	public DynamicField(){
+		fields = new HashMap<String, Object>();
+	}
+	
+	public void addField(String name, Object value){
+		fields.put(name, value);
+	}
+	
+	@NotDbField
+	public Map<String, Object> getFields(){
+		return fields;
+	}
+}

+ 17 - 0
src/main/java/com/wdkl/pdm/database/ISqlFileExecutor.java

@@ -0,0 +1,17 @@
+package com.wdkl.pdm.database;
+
+
+/**
+ * sql文件执行器
+ * @author Allen
+ */
+public interface ISqlFileExecutor {
+	
+	/**
+	 * 批量执行sql语句
+	 * @param sql 可以以两种形式传递sql:<br>
+	 * <li>1.路径方式:file:com/enation/eop/eop_empty.sql</li>
+	 * <li>2.sql内容:直接传递文件内容</li>
+	 */
+    void execute(String sql);
+}

+ 20 - 0
src/main/java/com/wdkl/pdm/database/IntegerMapper.java

@@ -0,0 +1,20 @@
+package com.wdkl.pdm.database;
+
+import org.springframework.jdbc.core.RowMapper;
+
+import java.sql.ResultSet;
+import java.sql.SQLException;
+
+/**
+ * 整型mapper
+ * @author Allen
+ */
+public class IntegerMapper implements RowMapper<Integer> {
+	
+	@Override
+    public Integer mapRow(ResultSet rs, int rowNum) throws SQLException {
+		Integer v = rs.getInt(1);
+		return v;
+	}
+
+}

+ 24 - 0
src/main/java/com/wdkl/pdm/database/ObjectNotFoundException.java

@@ -0,0 +1,24 @@
+package com.wdkl.pdm.database;
+
+/**
+ * 对像未找到异常<br>
+ * 多用于根据某id查询一条记录,但此记录不存在
+ * @author Allen
+ */
+public class ObjectNotFoundException extends DBRuntimeException {
+
+	public ObjectNotFoundException(String message) {
+		super(message);
+	}
+		
+	public ObjectNotFoundException(Exception e, String sql) {
+		super(e, sql);
+	 
+	}
+
+	/**
+	 * 
+	 */
+	private static final long serialVersionUID = -3403302876974180460L;
+
+}

+ 138 - 0
src/main/java/com/wdkl/pdm/database/Page.java

@@ -0,0 +1,138 @@
+package com.wdkl.pdm.database;
+
+import com.fasterxml.jackson.databind.PropertyNamingStrategy;
+import com.fasterxml.jackson.databind.annotation.JsonNaming;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+
+import java.io.Serializable;
+import java.util.List;
+
+/**
+ * 分页对象. 包含当前页数据及分页信息如总记录数.
+ *
+ * @param <T> 数据类型
+ * @author Allen
+ */
+@ApiModel(value = "数据分页对象")
+@JsonNaming(value = PropertyNamingStrategy.SnakeCaseStrategy.class)
+public class Page<T> implements Serializable {
+
+	/**
+	 * 数据列表
+	 */
+	@ApiModelProperty(value = "列表数据")
+	private List<T> data;
+
+	/**
+	 * 当前页码
+	 */
+	@ApiModelProperty(value = "当前页码")
+	private Integer pageNo;
+
+
+	/**
+	 * 分页大小
+	 */
+	@ApiModelProperty(value = "分页大小")
+	private Integer pageSize;
+
+	/**
+	 * 总计录数
+	 */
+	@ApiModelProperty(value = "总计录数")
+	private Long dataTotal;
+
+
+	/**
+	 * 构造方法
+	 *
+	 * @param data      数据列表
+	 * @param pageNo    当前页码
+	 * @param pageSize  页大小
+	 * @param dataTotal 总计录数
+	 */
+	public Page(Integer pageNo, Long dataTotal, Integer pageSize, List<T> data) {
+		this.data = data;
+		this.pageNo = pageNo;
+		this.pageSize = pageSize;
+		this.dataTotal = dataTotal;
+	}
+
+	public Page() {
+	}
+
+	public List<T> getData() {
+		return data;
+	}
+
+	public void setData(List<T> data) {
+		this.data = data;
+	}
+
+	public Integer getPageNo() {
+		return pageNo;
+	}
+
+	public void setPageNo(Integer pageNo) {
+		this.pageNo = pageNo;
+	}
+
+	public Integer getPageSize() {
+		return pageSize;
+	}
+
+	public void setPageSize(Integer pageSize) {
+		this.pageSize = pageSize;
+	}
+
+	public Long getDataTotal() {
+		return dataTotal;
+	}
+
+	public void setDataTotal(Long dataTotal) {
+		this.dataTotal = dataTotal;
+	}
+
+	@Override
+	public String toString() {
+		return "Page{" +
+				"data=" + data +
+				", pageNo=" + pageNo +
+				", pageSize=" + pageSize +
+				", dataTotal=" + dataTotal +
+				'}';
+	}
+
+	@Override
+	public boolean equals(Object o) {
+		if (this == o) {
+			return true;
+		}
+		if (o == null || getClass() != o.getClass()) {
+			return false;
+		}
+
+		Page<?> page = (Page<?>) o;
+
+		if (data != null ? !data.equals(page.data) : page.data != null) {
+			return false;
+		}
+		if (pageNo != null ? !pageNo.equals(page.pageNo) : page.pageNo != null) {
+			return false;
+		}
+		if (pageSize != null ? !pageSize.equals(page.pageSize) : page.pageSize != null) {
+			return false;
+		}
+		return dataTotal != null ? dataTotal.equals(page.dataTotal) : page.dataTotal == null;
+	}
+
+	@Override
+	public int hashCode() {
+		int result = data != null ? data.hashCode() : 0;
+		result = 31 * result + (pageNo != null ? pageNo.hashCode() : 0);
+		result = 31 * result + (pageSize != null ? pageSize.hashCode() : 0);
+		result = 31 * result + (dataTotal != null ? dataTotal.hashCode() : 0);
+		return result;
+	}
+}

+ 40 - 0
src/main/java/com/wdkl/pdm/database/SqlMetaBuilder.java

@@ -0,0 +1,40 @@
+package com.wdkl.pdm.database;
+
+/**
+ * 元数据构建器
+ * 构建模型构建执行sql的构建器
+ * @author Allen
+ */
+public interface SqlMetaBuilder {
+
+    /**
+     * 通过一个模型,获取新增数据的元数据信息
+     * @param <T> model的类型
+     * @param model 模型
+     * @return insert的元数据
+     */
+    <T> DataMeta insert(T model);
+
+    /**
+     * 通过一个模型,获取修改数据的元数据信息
+     * @param <T>  model的类型
+     * @param model 模型
+     * @param id 主键值
+     * @return update的元数据
+     */
+    <T> DataMeta update(T model, Integer id);
+
+    /**
+     * 通过Class,获取查询一行数据的sql
+     * @param clazz 模型的类型
+     * @return 查询一个模型的sql,其中已经拼接好根据主键查询的的where条件
+     */
+    String queryForModel(Class clazz);
+
+    /**
+     * 通过Class,获取删除一行数据的sql
+     * @param clazz 模型的类型
+     * @return 删除的sql语句,其中已经拼接好根据主键删除的where条件
+     */
+    String delete(Class clazz);
+}

+ 21 - 0
src/main/java/com/wdkl/pdm/database/StringMapper.java

@@ -0,0 +1,21 @@
+package com.wdkl.pdm.database;
+
+import org.springframework.jdbc.core.RowMapper;
+
+import java.sql.ResultSet;
+import java.sql.SQLException;
+
+/**
+ * 字符串型mapper
+ * @author Allen
+ */
+public class StringMapper implements RowMapper<String> {
+
+	
+	@Override
+    public String mapRow(ResultSet rs, int rowNum) throws SQLException {
+		String str = rs.getString(1);
+		return str;
+	}
+
+}

+ 21 - 0
src/main/java/com/wdkl/pdm/database/annotation/Column.java

@@ -0,0 +1,21 @@
+package com.wdkl.pdm.database.annotation;
+
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+
+/**
+ * 标识为数据库的字段
+ * @author Allen
+ */
+@Target(ElementType.FIELD)
+@Retention(RetentionPolicy.RUNTIME)
+public @interface Column {
+
+	String name() default "";
+
+	boolean allowNullUpdate() default  false;
+
+
+}

+ 17 - 0
src/main/java/com/wdkl/pdm/database/annotation/Id.java

@@ -0,0 +1,17 @@
+package com.wdkl.pdm.database.annotation;
+
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+
+/**
+ * 标识为此表的主键ID
+ * @author Allen
+ */
+@Target(ElementType.FIELD)
+@Retention(RetentionPolicy.RUNTIME)
+public @interface Id {
+
+    String name() default "";
+}

+ 17 - 0
src/main/java/com/wdkl/pdm/database/annotation/NotDbField.java

@@ -0,0 +1,17 @@
+package com.wdkl.pdm.database.annotation;
+
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+
+/**
+ * 标识不是数据库读写的字段
+ * @author Allen
+ * 2010-1-22下午04:08:58
+ */
+@Retention(RetentionPolicy.RUNTIME)
+@Target(ElementType.METHOD)
+public @interface NotDbField {
+
+}

+ 17 - 0
src/main/java/com/wdkl/pdm/database/annotation/PrimaryKeyField.java

@@ -0,0 +1,17 @@
+package com.wdkl.pdm.database.annotation;
+
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+
+/**
+ * 标识不是数据库读写的字段
+ * @author Allen
+ * 2010-1-22下午04:08:58
+ */
+@Retention(RetentionPolicy.RUNTIME)
+@Target(ElementType.METHOD)
+public @interface PrimaryKeyField {
+
+}

+ 21 - 0
src/main/java/com/wdkl/pdm/database/annotation/Table.java

@@ -0,0 +1,21 @@
+package com.wdkl.pdm.database.annotation;
+
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+
+/**
+ * 标识为数据库的表名
+ * @author Allen
+ */
+@Target(ElementType.TYPE)
+@Retention(RetentionPolicy.RUNTIME)
+public @interface Table {
+
+	/**
+	 * 数据库的表名
+	 * @return
+	 */
+	String name();
+}

+ 62 - 0
src/main/java/com/wdkl/pdm/database/impl/CRUDBaseManagerImpl.java

@@ -0,0 +1,62 @@
+package com.wdkl.pdm.database.impl;
+
+import com.wdkl.pdm.database.CRUDBaseManager;
+import com.wdkl.pdm.database.DaoSupport;
+import com.wdkl.pdm.database.Page;
+import com.wdkl.pdm.exception.ServiceException;
+import com.wdkl.pdm.mvc.GridParameter;
+import com.wdkl.pdm.util.BeanUtil;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.annotation.Qualifier;
+import org.springframework.transaction.annotation.Propagation;
+import org.springframework.transaction.annotation.Transactional;
+
+import java.lang.reflect.ParameterizedType;
+
+public class CRUDBaseManagerImpl<T> implements CRUDBaseManager<T> {
+
+    @Autowired
+    @Qualifier("systemDaoSupport")
+    public DaoSupport daoSupport;
+
+    private Class<T> getGenericClass(){
+        Class<T> entityClass = (Class<T>)((ParameterizedType) getClass().getGenericSuperclass()).getActualTypeArguments()[0];
+        return entityClass;
+    }
+
+    @Override
+    public Page list(GridParameter gp) {
+        return daoSupport.queryForPage(gp,getGenericClass());
+    }
+
+    @Override
+    public T edit(T t, Integer id) {
+        T dbModel = daoSupport.queryForObject(getGenericClass(), id);
+        if (dbModel == null) {
+            throw new ServiceException("没有找到数据");
+        }
+
+        BeanUtil.copyProperties(t, dbModel);
+        daoSupport.update(dbModel, id);
+        return dbModel;
+    }
+
+    @Override
+    public T add(T t) {
+        daoSupport.insert(t);
+        return t;
+    }
+
+    @Override
+    @Transactional(value = "systemTransactionManager", propagation = Propagation.REQUIRED, rollbackFor = Exception.class)
+    public void delete(Integer[] ids) {
+        for (Integer id : ids) {
+            daoSupport.delete(getGenericClass(), id);
+        }
+    }
+
+    @Override
+    public T getModel(Integer id) {
+        return daoSupport.queryForObject(getGenericClass(), id);
+    }
+}

+ 603 - 0
src/main/java/com/wdkl/pdm/database/impl/DaoSupportImpl.java

@@ -0,0 +1,603 @@
+package com.wdkl.pdm.database.impl;
+
+import com.google.common.base.Strings;
+import com.wdkl.pdm.database.*;
+import com.wdkl.pdm.mvc.GridParameter;
+import com.wdkl.pdm.util.ReflectionUtil;
+import com.wdkl.pdm.util.StringUtil;
+import org.apache.commons.lang.ArrayUtils;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.dao.EmptyResultDataAccessException;
+import org.springframework.jdbc.core.BeanPropertyRowMapper;
+import org.springframework.jdbc.core.JdbcTemplate;
+import org.springframework.jdbc.core.RowMapper;
+import org.springframework.util.Assert;
+
+import java.sql.SQLException;
+import java.util.List;
+import java.util.Map;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+
+
+/**
+ * jdbc数据库操作支撑实现类
+ * @author Allen create in 2018/3/21
+ * @version v2.0
+ * @since v7.0.0
+ */
+public class DaoSupportImpl implements DaoSupport {
+	private String dbType =  "mysql";
+
+    private JdbcTemplate jdbcTemplate;
+
+	@Autowired
+	private SqlMetaBuilder sqlMetaBuilder;
+
+    /**
+     * 日志记录
+     */
+	private final Logger logger = LoggerFactory.getLogger(this.getClass());
+
+    /**
+     * order by 语句正则
+     */
+    private  static final Pattern ORDER_PATTERN = Pattern.compile("order\\s*by[\\w|\\W|\\s|\\S]*", Pattern.CASE_INSENSITIVE);
+
+    /**
+     * 删除select正则
+     */
+    private  static final Pattern REMOVE_SELECT_PATTERN  = Pattern.compile("\\(.*\\)", Pattern.CASE_INSENSITIVE);
+
+	public DaoSupportImpl(){
+	}
+
+    /**
+     * 实例化jdbcTemplate
+     */
+	public DaoSupportImpl(JdbcTemplate jdbcTemplate){
+		this.jdbcTemplate= jdbcTemplate;
+		try {
+			String databaseProductName = this.jdbcTemplate.getDataSource().getConnection().getMetaData().getDatabaseProductName();
+			logger.info("数据库类型:"+databaseProductName);
+			if(databaseProductName.equals("Microsoft SQL Server")){
+				this.dbType = "sqlserver";
+			}else if(databaseProductName.equals("MySQL")){
+				this.dbType = "mysql";
+			}else{
+				this.dbType ="oracle";
+			}
+		} catch (SQLException e) {
+			e.printStackTrace();
+		}
+
+
+
+
+	}
+
+
+	@Override
+	public int execute(String sql, Object... args) {
+		try {
+			int rowNum = this.jdbcTemplate.update(sql, args);
+
+			return rowNum;
+		} catch (Exception e) {
+			throw new DBRuntimeException(e, sql);
+		}
+	}
+
+
+	@Override
+	public int getLastId(String table) {
+		String sql;
+		switch (dbType){
+			case "sqlserver":
+				sql = "SELECT SCOPE_IDENTITY() as id";
+				break;
+			case "oracle":
+				sql = "SELECT SEQNAME.CURRVAL as id FROM DUAL";
+				break;
+			case "postgresql":
+				sql = "SELECT lastval() as id";
+				break;
+			case "mysql":
+			default:
+				sql = "SELECT last_insert_id() as id";
+				break;
+		}
+		return queryForInt(sql);
+	}
+
+	@Override
+	public void insert(String table, Map fields) {
+		String sql = "";
+
+		try {
+
+			Assert.hasText(table, "表名不能为空");
+			Assert.notEmpty(fields, "字段不能为空");
+			table = quoteCol(table);
+
+			Object[] cols = fields.keySet().toArray();
+			Object[] values = new Object[cols.length];
+
+			for (int i = 0; i < cols.length; i++) {
+				if (fields.get(cols[i]) == null) {
+					values[i] = null;
+				} else {
+					values[i] = fields.get(cols[i]).toString();
+				}
+				cols[i] = quoteCol(cols[i].toString());
+			}
+
+			sql = "INSERT INTO " + table + " (" + StringUtil.implode(", ", cols);
+
+			sql = sql + ") VALUES (" + StringUtil.implodeValue(", ", values);
+
+			sql = sql + ")";
+
+			jdbcTemplate.update(sql, values);
+		} catch (Exception e) {
+			this.logger.error(e.getMessage(), e);
+			throw new DBRuntimeException(e, sql);
+		}
+	}
+
+	@Override
+	public void insert(String table, Object po) {
+		insert(table, ReflectionUtil.po2Map(po));
+	}
+
+	@Override
+	public Integer queryForInt(String sql, Object... args) {
+		try {
+			Integer value = jdbcTemplate.queryForObject(sql, Integer.class, args);
+			return  value==null?0:value;
+		}catch(EmptyResultDataAccessException e){
+			return 0;
+		} catch (RuntimeException e) {
+			this.logger.error(e.getMessage(), e);
+			throw e;
+		}
+	}
+
+	@Override
+	public Float queryForFloat(String sql, Object... args) {
+		try {
+
+			Float value = jdbcTemplate.queryForObject(sql, Float.class, args);
+			return  value==null?0F:value;
+
+		} catch(EmptyResultDataAccessException e){
+			return 0F;
+		} catch (RuntimeException e) {
+			this.logger.error(e.getMessage(), e);
+			throw e;
+		}
+	}
+
+	@Override
+	public Long queryForLong(String sql, Object... args) {
+		try {
+			Long value = jdbcTemplate.queryForObject(sql, Long.class, args);
+			return  value==null?0L:value;
+		} catch(EmptyResultDataAccessException e){
+			return 0L;
+		} catch (RuntimeException e) {
+			this.logger.error(e.getMessage(), e);
+			throw e;
+		}
+
+	}
+
+	@Override
+	public Double queryForDouble(String sql, Object... args) {
+		try {
+
+			Double value = jdbcTemplate.queryForObject(sql, Double.class, args);
+			return  value==null?0D:value;
+
+		} catch(EmptyResultDataAccessException e){
+			return 0D;
+		} catch (RuntimeException e) {
+			this.logger.error(e.getMessage(), e);
+			throw e;
+		}
+	}
+
+	@Override
+	public String queryForString(String sql, Object... args) {
+		
+		String s = "";
+		try {
+			s = this.jdbcTemplate.queryForObject(sql, String.class,args);
+		}catch (EmptyResultDataAccessException e){
+			return "";
+		}catch (RuntimeException e) {
+			if(logger.isDebugEnabled()){
+				logger.debug("查询sql:["+sql+"]出错",e);
+			}
+
+		}
+		return s;
+	}
+
+	@Override
+	@SuppressWarnings("unchecked")
+	public List queryForList(String sql, Object... args) {
+		return this.jdbcTemplate.queryForList(sql, args);
+	}
+
+
+	@Override
+	public <T> List<T> queryForList(String sql, Class<T> clazz, Object... args) {
+
+		return this.jdbcTemplate.query(sql, new BeanPropertyRowMapper<T>(clazz), args);
+
+	}
+
+	@Override
+	public <T> List<T> queryForList(String sql, RowMapper<T> rowMapper, Object... args) {
+		return jdbcTemplate.query(sql,rowMapper,args);
+	}
+
+	@Override
+	public List queryForListPage(String sql, int pageNo, int pageSize, Object... args) {
+
+		try {
+			Assert.hasText(sql, "SQL语句不能为空");
+			Assert.isTrue(pageNo >= 1, "pageNo 必须大于等于1");
+			String listSql = this.buildPageSql(sql, pageNo, pageSize);
+			return queryForList(listSql, args);
+		} catch (Exception ex) {
+			throw new DBRuntimeException(ex, sql);
+		}
+
+	}
+
+	@Override
+	public Map queryForMap(String sql, Object... args) {
+		try {
+			Map map = this.jdbcTemplate.queryForMap(sql, args);
+
+				return map;
+		} catch (Exception ex) {
+			ex.printStackTrace();
+			throw new ObjectNotFoundException(ex, sql);
+		}
+	}
+
+	@Override
+	public Page queryForPage(String sql, int pageNo, int pageSize, Object... args) {
+		String countSql = "SELECT COUNT(*) " + removeSelect(removeOrders(sql));
+		return this.queryForPage(sql, countSql, pageNo, pageSize, args);
+	}
+
+	@Override
+	public Page queryForPage(String sql, String countSql, int pageNo, int pageSize, Object... args) {
+		Assert.hasText(sql, "SQL语句不能为空");
+		Assert.isTrue(pageNo >= 1, "pageNo 必须大于等于1");
+		String listSql = buildPageSql(sql, pageNo, pageSize);
+
+		List list = queryForList(listSql, args);
+		Long totalCount = queryForLong(countSql, args);
+		return new Page(pageNo, totalCount, pageSize, list);
+
+	}
+	@Override
+	public <T> Page queryForPage(String sql, int pageNo, int pageSize, Class<T> clazz, Object... args) {
+
+		Assert.hasText(sql, "SQL语句不能为空");
+		Assert.isTrue(pageNo >= 1, "pageNo 必须大于等于1");
+		String listSql = buildPageSql(sql, pageNo, pageSize);
+		String countSql = "SELECT COUNT(*) " + removeSelect(removeOrders(sql));
+		List<T> list = this.queryForList(listSql, clazz, args);
+		Long totalCount = queryForLong(countSql, args);
+		return new Page(pageNo, totalCount, pageSize, list);
+
+	}
+
+	@Override
+	public <T> Page queryForPage(GridParameter gp, Class<T> clazz) {
+		Assert.isTrue(gp.getPageNo() >= 1, "pageNo 必须大于等于1");
+		Assert.isTrue(gp.getPageSize() >= 1, "每页显示条数不能小于1");
+
+
+
+
+		StringBuilder sb = new StringBuilder();
+		if (!Strings.isNullOrEmpty(gp.getDir()) && !Strings.isNullOrEmpty(gp.getSort())) {
+			sb.append(" ORDER BY ").append(gp.getSort()).append(" ").append(gp.getDir()).append(" ");
+		}
+		String listSql = buildPageSql(gp.getSqlSelect() + gp.getSqlWhere() + sb.toString(), gp.getPageNo(), gp.getPageSize());
+		String countSql = "SELECT COUNT(*) " + removeSelect(removeOrders(gp.getSqlSelect() + gp.getSqlWhere()));
+		if (gp.getTerm().size() == 0) {
+			List<T> list = this.queryForList(listSql, clazz);
+			Long totalCount = queryForLong(countSql);
+			return new Page(gp.getPageNo(), totalCount, gp.getPageSize(), list);
+		} else {
+			List<T> list = this.queryForList(listSql, clazz, gp.getTerm().toArray());
+			Long totalCount = queryForLong(countSql, gp.getTerm().toArray());
+			return new Page(gp.getPageNo(), totalCount, gp.getPageSize(), list);
+		}
+	}
+
+	@Override
+	public int update(String table, Map fields, Map<String,?> where) {
+
+		Assert.hasText(table, "表名不能为空");
+		Assert.notEmpty(fields, "字段不能为空");
+		Assert.notEmpty(where, "where条件不能为空");
+
+		String whereSql = this.createWhereSql(where);
+
+		// 字段名
+		Object[] cols = fields.keySet().toArray();
+		String fieldSql = "";
+
+		for(int i=0;i<cols.length;i++){
+
+			fieldSql+= cols[i]+"=?";
+			 if(i!=cols.length-1){
+				 fieldSql+=",";
+			 }
+		}
+
+		// 字段值
+		Object[] values  = ArrayUtils.addAll(fields.values().toArray(),where.values().toArray());
+
+		String sql = "UPDATE " + table + " SET " +fieldSql  + " WHERE " + whereSql;
+
+		return this.jdbcTemplate.update(sql, values);
+
+	}
+
+	@Override
+	public int[] batchUpdate(String sql, List<Object[]> batchArgs) {
+		return jdbcTemplate.batchUpdate(sql, batchArgs);
+	}
+
+	@Override
+	public int[] batchUpdate(String... sql) {
+		return jdbcTemplate.batchUpdate(sql);
+	}
+
+	@Override
+	public int update(String table, Object po, Map<String,?> where) {
+
+		return update(table, ReflectionUtil.po2Map(po), where);
+	}
+
+
+	@Override
+	public String buildPageSql(String sql, int page, int pageSize) {
+
+		String sqlStr = null;
+
+		//防止魔法值
+		String mysqlStr = "mysql";
+		String sqlserverStr = "sqlserver";
+        String oracleStr = "oracle";
+
+		if (mysqlStr.equals(dbType)) {
+			sqlStr = sql + " LIMIT " + (page - 1) * pageSize + "," + pageSize;
+		} else if (oracleStr.equals(dbType)) {
+			StringBuffer localSql = new StringBuffer("SELECT * FROM (SELECT t1.*,rownum sn1 FROM (");
+			localSql.append(sql);
+			localSql.append(") t1) t2 WHERE t2.sn1 BETWEEN ");
+			localSql.append((page - 1) * pageSize + 1);
+			localSql.append(" AND ");
+			localSql.append(page * pageSize);
+			sqlStr = localSql.toString();
+		} else if (sqlserverStr.equals(dbType)) {
+			StringBuffer localSql = new StringBuffer();
+			// 找到order by 子句
+			String order = SqlPaser.findOrderStr(sql);
+
+			// 剔除order by 子句
+			if (order != null) {
+				sql = removeOrders(sql);
+			}
+			else {
+				// SQLServer分页必需有order by
+				// 子句,如果默认语句不包含order by,
+				// 自动以id降序,如果没有id字段会报错
+				order = "order by id desc";
+
+			}
+
+			// 拼装分页sql
+			localSql.append("select * from (");
+			localSql.append(SqlPaser.insertSelectField("ROW_NUMBER() Over(" + order + ") as rowNum", sql));
+			localSql.append(") tb where rowNum between ");
+			localSql.append((page - 1) * pageSize + 1);
+			localSql.append(" AND ");
+			localSql.append(page * pageSize);
+
+			return localSql.toString();
+
+		}
+
+		return sqlStr.toString();
+
+	}
+
+	/**
+	 * 格式化列名 只适用于Mysql
+	 *
+	 * @param col
+	 * @return
+	 */
+	private String quoteCol(String col) {
+		if (col == null || "".equals(col)) {
+			return "";
+		} else {
+			// if("2".equals(EopSetting.DBTYPE))//Oracle
+			// return "\"" + col + "\"";
+			// else if("1".equals(EopSetting.DBTYPE))//mysql
+			// return "`" + col + "`";
+			// else //mssql
+			// return "[" + col + "]";
+			return col;
+		}
+	}
+
+	/**
+	 * 格式化值 只适用于Mysql
+	 *
+	 * @param value
+	 * @return
+	 */
+	private String quoteValue(String value) {
+		if (value == null || "".equals(value)) {
+			return "''";
+		} else {
+			return "'" + value.replaceAll("'", "''") + "'";
+		}
+	}
+
+	private String getStr(int num, String str) {
+		StringBuffer sb = new StringBuffer("");
+		for (int i = 0; i < num; i++) {
+			sb.append(str);
+		}
+		return sb.toString();
+	}
+
+
+
+
+
+    @Override
+	public <T> void insert(T t){
+		DataMeta dataMeta  = this.sqlMetaBuilder.insert(t);
+		String sql = dataMeta.getSql();
+		Object[] param = dataMeta.getParamter();
+		this.jdbcTemplate.update(sql,param);
+	}
+
+    @Override
+    public <T> int insertRecord(T t) {
+        int i = 0;
+        DataMeta dataMeta = this.sqlMetaBuilder.insert(t);
+        String sql = dataMeta.getSql();
+        Object[] param = dataMeta.getParamter();
+        i = this.jdbcTemplate.update(sql, param);
+        return i;
+    }
+
+
+
+    @Override
+	public <T> void update(T model, Integer id) {
+		DataMeta dataMeta  = this.sqlMetaBuilder.update(model,id);
+		String sql = dataMeta.getSql();
+		Object[] param = dataMeta.getParamter();
+		this.jdbcTemplate.update(sql,param);
+	}
+
+
+	@Override
+	public <T> void delete(Class<T> clazz, Integer id) {
+		String sql = this.sqlMetaBuilder.delete(clazz);
+		Integer[] ids = {id};
+		this.jdbcTemplate.update(sql,ids);
+	}
+
+
+	@Override
+	public <T> T  queryForObject(Class<T> clazz, Integer id) {
+
+		String sql = this.sqlMetaBuilder.queryForModel(clazz);
+		Integer[] ids = {id};
+		List<T> objList = this.queryForList(sql, clazz, ids);
+		if (objList.isEmpty()) {
+			return null;
+		}
+		return objList.get(0);
+	}
+
+
+	@Override
+	public <T> T queryForObject(String sql, Class<T> clazz, Object... args) {
+		List<T> objList = this.queryForList(sql, clazz, args);
+		if (objList.isEmpty()) {
+			return null;
+		}
+		return objList.get(0);
+	}
+
+
+    /**
+     * 去除hql的order by 子句,用于pagedQuery.
+     *
+     */
+    private String removeOrders(String hql) {
+        Assert.hasText(hql,"hql must hast text");
+
+        Matcher m = ORDER_PATTERN.matcher(hql);
+        StringBuffer sb = new StringBuffer();
+        while (m.find()) {
+            m.appendReplacement(sb, "");
+        }
+        m.appendTail(sb);
+        return sb.toString();
+    }
+
+    /**
+     * 去除sql的select 子句,未考虑union的情况,用于pagedQuery.
+     */
+    private String removeSelect(String sql) {
+
+        String groupBySql="group by";
+        sql = sql.toLowerCase();
+        if (sql.indexOf(groupBySql) != -1) {
+            return " from (" + sql + ") temp_table";
+        }
+
+        // FIXME 当查询中含有函数,比如SUM(),替换SQL出错
+        Matcher m = REMOVE_SELECT_PATTERN.matcher(sql);
+        StringBuffer sb = new StringBuffer();
+        while (m.find()) {
+            int c = m.end() - m.start();
+            m.appendReplacement(sb, getStr(c, "~"));
+        }
+        m.appendTail(sb);
+
+        String replacedSql = sb.toString();
+
+        int index = replacedSql.indexOf("from");
+
+        // 如果不存在
+        if (index == -1) {
+            index = replacedSql.indexOf("FROM");
+        }
+        return sql.substring(index);
+    }
+
+    /**
+     * 根据一个Map的条件,生成where 语句
+     * @param where  key为条件,value为条件值
+     * @return where 语句
+     */
+    private String createWhereSql(Map<String,?> where){
+
+        String whereSql = "";
+        if (where != null) {
+            Object[] whereCols = where.keySet().toArray();
+            for (int i = 0; i < whereCols.length; i++) {
+                StringBuffer str = new StringBuffer();
+                str.append(whereCols[i].toString());
+                str.append("=?");
+                whereCols[i] = str.toString();
+            }
+            whereSql += StringUtil.implode(" AND ", whereCols);
+        }
+
+        return whereSql;
+    }
+}

+ 36 - 0
src/main/java/com/wdkl/pdm/database/impl/FilterColumnMapRowMapper.java

@@ -0,0 +1,36 @@
+package com.wdkl.pdm.database.impl;
+
+import org.springframework.jdbc.core.ColumnMapRowMapper;
+import org.springframework.jdbc.support.JdbcUtils;
+
+import java.sql.ResultSet;
+import java.sql.ResultSetMetaData;
+import java.sql.SQLException;
+import java.util.Map;
+
+/**
+ * map mapper
+ * @author Allen
+ */
+public class FilterColumnMapRowMapper extends ColumnMapRowMapper {
+	private IRowMapperColumnFilter filter;
+	public FilterColumnMapRowMapper(IRowMapperColumnFilter filter){
+		this.filter = filter;
+	}
+	
+	@Override
+	public Map<String, Object> mapRow(ResultSet rs, int rowNum) throws SQLException {
+		ResultSetMetaData rsmd = rs.getMetaData();
+		int columnCount = rsmd.getColumnCount();
+		Map mapOfColValues = createColumnMap(columnCount);
+		for (int i = 1; i <= columnCount; i++) {
+			String key = getColumnKey(JdbcUtils.lookupColumnName(rsmd, i));
+			key  = key.toLowerCase();
+			Object obj = getColumnValue(rs, i);
+			mapOfColValues.put(key, obj);
+			//对此行结果集进行过滤
+			this.filter.filter(mapOfColValues, rs);
+		}
+		return mapOfColValues;
+	}
+}

+ 25 - 0
src/main/java/com/wdkl/pdm/database/impl/IRowMapperColumnFilter.java

@@ -0,0 +1,25 @@
+package com.wdkl.pdm.database.impl;
+
+import java.sql.ResultSet;
+import java.sql.SQLException;
+import java.util.Map;
+
+/**
+ * 数据库结果集过滤器
+ * 可对RowMapper的结果某或多列进行过滤 
+ * @author Allen
+ *
+ */
+public interface IRowMapperColumnFilter {
+	
+	
+	/**
+	 * 对结果集的行进行过滤
+	 * @param colValues 结果集一行的map
+	 * @param rs 结果集
+	 * @throws SQLException 可能的sql异常
+	 */
+    void filter(Map colValues, ResultSet rs) throws SQLException;
+	
+	
+}

+ 19 - 0
src/main/java/com/wdkl/pdm/database/impl/LowerCaseJdbcTemplate.java

@@ -0,0 +1,19 @@
+package com.wdkl.pdm.database.impl;
+
+import org.springframework.jdbc.core.JdbcTemplate;
+import org.springframework.jdbc.core.RowMapper;
+
+
+/**
+ * 覆写jdbctemlate ,使用LowerCaseColumnMapRowMapper
+ * @author Allen
+ */
+public class LowerCaseJdbcTemplate extends JdbcTemplate {
+	@Override
+	protected RowMapper getColumnMapRowMapper() {
+
+		return new MySqlColumnMapRowMapper();
+
+	}
+
+}

+ 36 - 0
src/main/java/com/wdkl/pdm/database/impl/MySqlColumnMapRowMapper.java

@@ -0,0 +1,36 @@
+package com.wdkl.pdm.database.impl;
+
+import org.springframework.jdbc.core.ColumnMapRowMapper;
+import org.springframework.jdbc.support.JdbcUtils;
+
+import java.sql.ResultSet;
+import java.sql.ResultSetMetaData;
+import java.sql.SQLException;
+import java.util.Map;
+
+/**
+ * map mapper
+ * @author Allen
+ */
+public class MySqlColumnMapRowMapper extends ColumnMapRowMapper {
+	@Override
+	public Map<String, Object> mapRow(ResultSet rs, int rowNum) throws SQLException {
+		ResultSetMetaData rsmd = rs.getMetaData();
+		int columnCount = rsmd.getColumnCount();
+		Map mapOfColValues = createColumnMap(columnCount);
+		for (int i = 1; i <= columnCount; i++) {
+			String key = getColumnKey(JdbcUtils.lookupColumnName(rsmd, i));
+			key = key.toLowerCase();
+			Object obj = null;
+			String typename= rsmd.getColumnTypeName(i).toUpperCase();
+			if("DECIMAL".equals(typename)){
+				obj = rs.getDouble(i);
+			}else{
+				obj = getColumnValue(rs, i);
+			}
+			 
+			mapOfColValues.put(key, obj);
+		}
+		return mapOfColValues;
+	}
+}

+ 90 - 0
src/main/java/com/wdkl/pdm/database/impl/MySqlMetaBuilderImpl.java

@@ -0,0 +1,90 @@
+package com.wdkl.pdm.database.impl;
+
+import com.wdkl.pdm.database.ColumnMeta;
+import com.wdkl.pdm.database.DataMeta;
+import com.wdkl.pdm.database.SqlMetaBuilder;
+import com.wdkl.pdm.database.annotation.Table;
+import com.wdkl.pdm.util.ReflectionUtil;
+import org.apache.commons.lang.StringUtils;
+import org.springframework.stereotype.Service;
+
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * 基于Mysql的基本增删改查操作实现类
+ * @author Allen
+ */
+@Service
+public class MySqlMetaBuilderImpl implements SqlMetaBuilder {
+
+    @Override
+    public <T> DataMeta insert(T model) {
+        ColumnMeta columnMeta = ReflectionUtil.getColumnMeta(model);
+        Object[] columnName = columnMeta.getNames();
+        Object[] columnValue = columnMeta.getValues();
+
+        StringBuffer questionMarkStr = new StringBuffer();
+        for (int i =0;i < columnValue.length; i++ ){
+            questionMarkStr.append("?");
+            if ( (i+1) != columnValue.length) {
+                questionMarkStr.append(",");
+            }
+        }
+
+        Table table = model.getClass().getAnnotation(Table.class);
+        String columnNameStr = StringUtils.join(columnName,",");
+
+        String addSql = "INSERT INTO "+table.name()+" ("+columnNameStr+") VALUES ("+questionMarkStr.toString()+")";
+
+        DataMeta dataMeta = new DataMeta();
+        dataMeta.setSql(addSql);
+        dataMeta.setParamter(columnValue);
+        return dataMeta;
+    }
+
+    @Override
+    public <T> DataMeta update(T model, Integer id) {
+        ColumnMeta columnMeta = ReflectionUtil.getColumnMeta(model);
+        Object[] columnName = columnMeta.getNames();
+        Object[] columnValue = columnMeta.getValues();
+
+        String columnId = ReflectionUtil.getPrimaryKey(model.getClass());
+        Table table = model.getClass().getAnnotation(Table.class);
+
+        List valueList = new ArrayList();
+        StringBuffer setStr = new StringBuffer();
+        for ( int i =0; i < columnName.length; i++ ){
+            setStr.append(columnName[i]+"=?");
+            valueList.add(columnValue[i]);
+            if ( (i+1) != columnName.length) {
+                setStr.append(",");
+            }
+        }
+        String editSql = "UPDATE "+table.name()+" SET "+setStr.toString()+" WHERE "+columnId+"=?";
+        valueList.add(id);
+
+        DataMeta dataMeta = new DataMeta();
+        dataMeta.setSql(editSql);
+        dataMeta.setParamter(valueList.toArray());
+        return dataMeta;
+    }
+
+
+    @Override
+    public String queryForModel(Class clazz) {
+        Table table =  (Table) clazz.getAnnotation(Table.class);
+        String columnId = ReflectionUtil.getPrimaryKey(clazz);
+        String queryOneSql = "SELECT * FROM "+table.name()+" WHERE "+columnId+"=?";
+        return queryOneSql;
+    }
+
+    @Override
+    public String delete(Class clazz) {
+        Table table =  (Table) clazz.getAnnotation(Table.class);
+        String columnId = ReflectionUtil.getPrimaryKey(clazz);
+        String deleteSql = "DELETE FROM "+table.name()+" WHERE "+columnId+"=?";
+        return deleteSql;
+    }
+
+}

+ 51 - 0
src/main/java/com/wdkl/pdm/database/impl/OracleColumnMapRowMapper.java

@@ -0,0 +1,51 @@
+package com.wdkl.pdm.database.impl;
+
+import org.springframework.jdbc.core.ColumnMapRowMapper;
+import org.springframework.jdbc.support.JdbcUtils;
+
+import java.sql.ResultSet;
+import java.sql.ResultSetMetaData;
+import java.sql.SQLException;
+import java.util.Map;
+
+/**
+ * 小写key的columnrowmapper
+ *  本类覆写了spring 的ColumnMapRowMapper,将字段名全部小写
+ * @author Allen
+ */
+public class OracleColumnMapRowMapper extends ColumnMapRowMapper {
+
+	@Override
+	public Map<String, Object> mapRow(ResultSet rs, int rowNum) throws SQLException {
+		ResultSetMetaData rsmd = rs.getMetaData();
+		int columnCount = rsmd.getColumnCount();
+		Map mapOfColValues = createColumnMap(columnCount);
+		for (int i = 1; i <= columnCount; i++) {
+			String key = getColumnKey(JdbcUtils.lookupColumnName(rsmd, i));
+			key = key.toLowerCase();
+			Object obj = null;
+			String typename= rsmd.getColumnTypeName(i);
+			if("NUMBER".equals(typename)){
+				int scale = rsmd.getScale(i);
+				int precision = rsmd.getPrecision(i);
+				if(scale == 0){
+					if(precision<=10) {
+						obj = rs.getInt(i);
+					}
+					else {
+						obj = rs.getLong(i);
+					}
+				}else if(scale>0){
+					obj = rs.getDouble(i);
+				}else {
+					obj = rs.getLong(i);
+				}
+			}else{
+				obj = getColumnValue(rs, i);
+			}
+ 
+			mapOfColValues.put(key, obj);
+		}
+		return mapOfColValues;
+	}
+}

+ 42 - 0
src/main/java/com/wdkl/pdm/database/impl/SqlPaser.java

@@ -0,0 +1,42 @@
+package com.wdkl.pdm.database.impl;
+
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+
+/**
+ * sql解析器
+ * @author Allen
+ *
+ */
+public class SqlPaser {
+	
+	
+	public static String insertSelectField(String field, String sql){
+		sql = "select " + field+","+sql.substring(6, sql.length());
+		return sql;
+	}
+	
+	
+	/**
+	 * 从一个sql语句中找到order by 子句
+	 * @param sql
+	 * @return
+	 */
+	public static String findOrderStr(String sql ){
+
+		String pattern = "(order\\s*by[\\w|\\W|\\s|\\S]*)";
+		Pattern p = Pattern.compile(pattern, 2 | Pattern.DOTALL);
+		Matcher m = p.matcher(sql);
+
+		if (m.find()) {
+			return m.group();
+		 
+		} 
+		return null;
+	}
+	
+	
+	public static void main(String[] args){
+		String sql ="select * from abc where 12=12 order by id asc ";
+	}
+}

+ 131 - 0
src/main/java/com/wdkl/pdm/dos/WdChipDO.java

@@ -0,0 +1,131 @@
+package com.wdkl.pdm.dos;
+
+
+import com.fasterxml.jackson.databind.PropertyNamingStrategy;
+import com.fasterxml.jackson.databind.annotation.JsonNaming;
+import com.wdkl.pdm.database.annotation.Column;
+import com.wdkl.pdm.database.annotation.Id;
+import com.wdkl.pdm.database.annotation.PrimaryKeyField;
+import com.wdkl.pdm.database.annotation.Table;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+
+import java.io.Serializable;
+
+@Table(name = "wd_chip")
+@ApiModel
+@JsonNaming(value = PropertyNamingStrategy.SnakeCaseStrategy.class)
+public class WdChipDO implements Serializable {
+
+    /**
+     * null
+     */
+    @Column(name = "id")
+    @ApiModelProperty(value = "null", required = false)
+    @Id(name = "id")
+    private Integer id;
+    /**
+     * 芯片名称
+     */
+    @Column(name = "chip_name")
+    @ApiModelProperty(value = "芯片名称", required = false)
+    private String chipName;
+    /**
+     * 烧录工具,1:集成,2:外部
+     */
+    @Column(name = "burn_tool")
+    @ApiModelProperty(value = "烧录工具,1:集成,2:外部", required = false)
+    private Integer burnTool;
+    /**
+     * 烧录工具启动路径
+     */
+    @Column(name = "burn_tool_path")
+    @ApiModelProperty(value = "烧录工具启动路径", required = false)
+    private String burnToolPath;
+
+    /**
+     * 芯片枚举值,由开发人员设定
+     */
+    @Column(name = "chip_enum_value")
+    @ApiModelProperty(value = "芯片枚举值", required = false)
+    private Integer chipEnumValue;
+
+
+    /**
+     * null
+     */
+    @Column(name = "union_id")
+    @ApiModelProperty(value = "null", required = false)
+    private String unionId;
+
+
+    /**
+     * null
+     */
+    @Column(name = "use_for")
+    @ApiModelProperty(value = "null", required = false)
+    private Integer useFor;
+
+
+
+
+    @PrimaryKeyField
+    public Integer getId() {
+        return id;
+    }
+
+    public void setId(Integer id) {
+        this.id = id;
+    }
+
+
+    public String getChipName() {
+        return chipName;
+    }
+
+    public void setChipName(String chipName) {
+        this.chipName = chipName;
+    }
+
+
+    public Integer getBurnTool() {
+        return burnTool;
+    }
+
+    public void setBurnTool(Integer burnTool) {
+        this.burnTool = burnTool;
+    }
+
+
+    public String getBurnToolPath() {
+        return burnToolPath;
+    }
+
+    public void setBurnToolPath(String burnToolPath) {
+        this.burnToolPath = burnToolPath;
+    }
+
+    public Integer getChipEnumValue() {
+        return chipEnumValue;
+    }
+
+    public void setChipEnumValue(Integer chipEnumValue) {
+        this.chipEnumValue = chipEnumValue;
+    }
+
+    public String getUnionId() {
+        return unionId;
+    }
+
+    public void setUnionId(String unionId) {
+        this.unionId = unionId;
+    }
+
+    public Integer getUseFor() {
+        return useFor;
+    }
+
+    public void setUseFor(Integer useFor) {
+        this.useFor = useFor;
+    }
+}

+ 124 - 0
src/main/java/com/wdkl/pdm/dos/WdCustomPrintDO.java

@@ -0,0 +1,124 @@
+package com.wdkl.pdm.dos;
+
+
+import com.fasterxml.jackson.databind.PropertyNamingStrategy;
+import com.fasterxml.jackson.databind.annotation.JsonNaming;
+import com.wdkl.pdm.database.annotation.Column;
+import com.wdkl.pdm.database.annotation.Id;
+import com.wdkl.pdm.database.annotation.PrimaryKeyField;
+import com.wdkl.pdm.database.annotation.Table;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+
+import java.io.Serializable;
+
+@Table(name = "wd_custom_print")
+@ApiModel
+@JsonNaming(value = PropertyNamingStrategy.SnakeCaseStrategy.class)
+public class WdCustomPrintDO implements Serializable {
+
+    /**
+     * null
+     */
+    @Column(name = "id")
+    @ApiModelProperty(value = "null", required = false)
+    @Id(name = "id")
+    private Integer id;
+    /**
+     * null
+     */
+    @Column(name = "union_id")
+    @ApiModelProperty(value = "null", required = false)
+    private String unionId;
+    /**
+     * 自定义打印名称
+     */
+    @Column(name = "custom_print_name")
+    @ApiModelProperty(value = "自定义打印名称", required = false)
+    private String customPrintName;
+    /**
+     * 打印模板union_id
+     */
+    @Column(name = "print_solution_union_id")
+    @ApiModelProperty(value = "打印模板union_id", required = false)
+    private String printSolutionUnionId;
+    /**
+     * 备注
+     */
+    @Column(name = "remark")
+    @ApiModelProperty(value = "备注", required = false)
+    private String remark;
+
+
+    @Column(name = "print_item_union_ids")
+    @ApiModelProperty(value = "打印项分组unionid列表", required = false)
+    private String printItemUnionIds;
+
+    /**
+     * 排序
+     */
+    @Column(name = "index_no")
+    @ApiModelProperty(value = "排序", required = false)
+    private Integer indexNo;
+
+    @PrimaryKeyField
+    public Integer getId() {
+        return id;
+    }
+
+    public void setId(Integer id) {
+        this.id = id;
+    }
+
+
+    public String getUnionId() {
+        return unionId;
+    }
+
+    public void setUnionId(String unionId) {
+        this.unionId = unionId;
+    }
+
+
+    public String getCustomPrintName() {
+        return customPrintName;
+    }
+
+    public void setCustomPrintName(String customPrintName) {
+        this.customPrintName = customPrintName;
+    }
+
+
+    public String getPrintSolutionUnionId() {
+        return printSolutionUnionId;
+    }
+
+    public void setPrintSolutionUnionId(String printSolutionUnionId) {
+        this.printSolutionUnionId = printSolutionUnionId;
+    }
+
+
+    public String getRemark() {
+        return remark;
+    }
+
+    public void setRemark(String remark) {
+        this.remark = remark;
+    }
+
+    public String getPrintItemUnionIds() {
+        return printItemUnionIds;
+    }
+
+    public void setPrintItemUnionIds(String printItemUnionIds) {
+        this.printItemUnionIds = printItemUnionIds;
+    }
+
+    public Integer getIndexNo() {
+        return indexNo;
+    }
+
+    public void setIndexNo(Integer indexNo) {
+        this.indexNo = indexNo;
+    }
+}

+ 83 - 0
src/main/java/com/wdkl/pdm/dos/WdLabelLanguageDO.java

@@ -0,0 +1,83 @@
+package com.wdkl.pdm.dos;
+
+
+import com.fasterxml.jackson.databind.PropertyNamingStrategy;
+import com.fasterxml.jackson.databind.annotation.JsonNaming;
+import com.wdkl.pdm.database.annotation.Column;
+import com.wdkl.pdm.database.annotation.Id;
+import com.wdkl.pdm.database.annotation.PrimaryKeyField;
+import com.wdkl.pdm.database.annotation.Table;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+
+import java.io.Serializable;
+
+@Table(name = "wd_label_language")
+@ApiModel
+@JsonNaming(value = PropertyNamingStrategy.SnakeCaseStrategy.class)
+public class WdLabelLanguageDO implements Serializable {
+
+    /**
+     * null
+     */
+    @Column(name = "id")
+    @ApiModelProperty(value = "null", required = false)
+    @Id(name = "id")
+    private Integer id;
+    /**
+     * null
+     */
+    @Column(name = "union_id")
+    @ApiModelProperty(value = "null", required = false)
+    private String unionId;
+    /**
+     * 语言名称
+     */
+    @Column(name = "language_name")
+    @ApiModelProperty(value = "语言名称", required = false)
+    private String languageName;
+    /**
+     * 排序
+     */
+    @Column(name = "index_no")
+    @ApiModelProperty(value = "排序", required = false)
+    private Integer indexNo;
+
+
+    @PrimaryKeyField
+    public Integer getId() {
+        return id;
+    }
+
+    public void setId(Integer id) {
+        this.id = id;
+    }
+
+
+    public String getUnionId() {
+        return unionId;
+    }
+
+    public void setUnionId(String unionId) {
+        this.unionId = unionId;
+    }
+
+
+    public String getLanguageName() {
+        return languageName;
+    }
+
+    public void setLanguageName(String languageName) {
+        this.languageName = languageName;
+    }
+
+
+    public Integer getIndexNo() {
+        return indexNo;
+    }
+
+    public void setIndexNo(Integer indexNo) {
+        this.indexNo = indexNo;
+    }
+
+}

+ 113 - 0
src/main/java/com/wdkl/pdm/dos/WdMacDispatchRecordDO.java

@@ -0,0 +1,113 @@
+package com.wdkl.pdm.dos;
+
+
+import com.fasterxml.jackson.databind.PropertyNamingStrategy;
+import com.fasterxml.jackson.databind.annotation.JsonNaming;
+import com.wdkl.pdm.database.annotation.Column;
+import com.wdkl.pdm.database.annotation.Id;
+import com.wdkl.pdm.database.annotation.PrimaryKeyField;
+import com.wdkl.pdm.database.annotation.Table;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+
+import java.io.Serializable;
+
+@Table(name = "wd_mac_dispatch_record")
+@ApiModel
+@JsonNaming(value = PropertyNamingStrategy.SnakeCaseStrategy.class)
+public class WdMacDispatchRecordDO implements Serializable {
+
+    /**
+     * null
+     */
+    @Column(name = "id")
+    @ApiModelProperty(value = "null", required = false)
+    @Id(name = "id")
+    private Integer id;
+    /**
+     * null
+     */
+    @Column(name = "union_id")
+    @ApiModelProperty(value = "null", required = false)
+    private String unionId;
+    /**
+     * 起始MAC
+     */
+    @Column(name = "start_mac")
+    @ApiModelProperty(value = "起始MAC", required = false)
+    private String startMac;
+    /**
+     * 结束MAC
+     */
+    @Column(name = "end_mac")
+    @ApiModelProperty(value = "结束MAC", required = false)
+    private String endMac;
+    /**
+     * 分配数量
+     */
+    @Column(name = "dispatch_qty")
+    @ApiModelProperty(value = "分配数量", required = false)
+    private Integer dispatchQty;
+    /**
+     * 分配时间
+     */
+    @Column(name = "create_time")
+    @ApiModelProperty(value = "分配时间", required = false)
+    private Long createTime;
+
+
+    @PrimaryKeyField
+    public Integer getId() {
+        return id;
+    }
+
+    public void setId(Integer id) {
+        this.id = id;
+    }
+
+
+    public String getUnionId() {
+        return unionId;
+    }
+
+    public void setUnionId(String unionId) {
+        this.unionId = unionId;
+    }
+
+
+    public String getStartMac() {
+        return startMac;
+    }
+
+    public void setStartMac(String startMac) {
+        this.startMac = startMac;
+    }
+
+
+    public String getEndMac() {
+        return endMac;
+    }
+
+    public void setEndMac(String endMac) {
+        this.endMac = endMac;
+    }
+
+
+    public Integer getDispatchQty() {
+        return dispatchQty;
+    }
+
+    public void setDispatchQty(Integer dispatchQty) {
+        this.dispatchQty = dispatchQty;
+    }
+
+
+    public Long getCreateTime() {
+        return createTime;
+    }
+
+    public void setCreateTime(Long createTime) {
+        this.createTime = createTime;
+    }
+
+}

+ 113 - 0
src/main/java/com/wdkl/pdm/dos/WdPrintItemDO.java

@@ -0,0 +1,113 @@
+package com.wdkl.pdm.dos;
+
+
+import com.fasterxml.jackson.databind.PropertyNamingStrategy;
+import com.fasterxml.jackson.databind.annotation.JsonNaming;
+import com.wdkl.pdm.database.annotation.Column;
+import com.wdkl.pdm.database.annotation.Id;
+import com.wdkl.pdm.database.annotation.PrimaryKeyField;
+import com.wdkl.pdm.database.annotation.Table;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+
+import java.io.Serializable;
+
+/**
+ * 自定义打印项,打印项与模版参数关联,聚合成一个打印文档,填充到打印模版中
+ */
+
+@Table(name = "wd_print_item")
+@ApiModel
+@JsonNaming(value = PropertyNamingStrategy.SnakeCaseStrategy.class)
+public class WdPrintItemDO implements Serializable {
+
+    /**
+     * null
+     */
+    @Column(name = "id")
+    @ApiModelProperty(value = "null", required = false)
+    @Id(name = "id")
+    private Integer id;
+    /**
+     * null
+     */
+    @Column(name = "union_id")
+    @ApiModelProperty(value = "null", required = false)
+    private String unionId;
+    /**
+     * 打印项名称
+     */
+    @Column(name = "item_name")
+    @ApiModelProperty(value = "打印项名称", required = false)
+    private String itemName;
+    /**
+     * 对应参数名
+     */
+    @Column(name = "param_union_id")
+    @ApiModelProperty(value = "对应参数名", required = false)
+    private String paramUnionId;
+    /**
+     * 打印内容
+     */
+    @Column(name = "print_text")
+    @ApiModelProperty(value = "打印内容", required = false)
+    private String printText;
+
+    @Column(name = "index_no")
+    @ApiModelProperty(value = "null", required = false)
+    private Integer indexNo;
+
+
+    @PrimaryKeyField
+    public Integer getId() {
+        return id;
+    }
+
+    public void setId(Integer id) {
+        this.id = id;
+    }
+
+    public String getUnionId() {
+        return unionId;
+    }
+
+    public void setUnionId(String unionId) {
+        this.unionId = unionId;
+    }
+
+
+    public String getItemName() {
+        return itemName;
+    }
+
+    public void setItemName(String itemName) {
+        this.itemName = itemName;
+    }
+
+
+    public String getParamUnionId() {
+        return paramUnionId;
+    }
+
+    public void setParamUnionId(String paramUnionId) {
+        this.paramUnionId = paramUnionId;
+    }
+
+
+    public String getPrintText() {
+        return printText;
+    }
+
+    public void setPrintText(String printText) {
+        this.printText = printText;
+    }
+
+
+    public Integer getIndexNo() {
+        return indexNo;
+    }
+
+    public void setIndexNo(Integer indexNo) {
+        this.indexNo = indexNo;
+    }
+}

+ 113 - 0
src/main/java/com/wdkl/pdm/dos/WdPrintSolutionDO.java

@@ -0,0 +1,113 @@
+package com.wdkl.pdm.dos;
+
+
+import com.fasterxml.jackson.databind.PropertyNamingStrategy;
+import com.fasterxml.jackson.databind.annotation.JsonNaming;
+import com.wdkl.pdm.database.annotation.Column;
+import com.wdkl.pdm.database.annotation.Id;
+import com.wdkl.pdm.database.annotation.PrimaryKeyField;
+import com.wdkl.pdm.database.annotation.Table;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+
+import java.io.Serializable;
+
+@Table(name = "wd_print_solution")
+@ApiModel
+@JsonNaming(value = PropertyNamingStrategy.SnakeCaseStrategy.class)
+public class WdPrintSolutionDO implements Serializable {
+
+    /**
+     * null
+     */
+    @Column(name = "id")
+    @ApiModelProperty(value = "null", required = false)
+    @Id(name = "id")
+    private Integer id;
+    /**
+     * null
+     */
+    @Column(name = "union_id")
+    @ApiModelProperty(value = "null", required = false)
+    private String unionId;
+    /**
+     * 打印方案名称
+     */
+    @Column(name = "solution_name")
+    @ApiModelProperty(value = "打印方案名称", required = false)
+    private String solutionName;
+    /**
+     * 模版url
+     */
+    @Column(name = "template_url")
+    @ApiModelProperty(value = "模版url", required = false)
+    private String templateUrl;
+    /**
+     * 开发逻辑设定值
+     */
+    @Column(name = "dev_value")
+    @ApiModelProperty(value = "开发逻辑设定值", required = false)
+    private Integer devValue;
+
+    /**
+     * 模版参数组UnionID
+     */
+    @Column(name = "template_param_group_union_id")
+    @ApiModelProperty(value = "模版参数组UnionID", required = false)
+    private String templateParamGroupUnionId;
+
+
+    @PrimaryKeyField
+    public Integer getId() {
+        return id;
+    }
+
+    public void setId(Integer id) {
+        this.id = id;
+    }
+
+
+    public String getUnionId() {
+        return unionId;
+    }
+
+    public void setUnionId(String unionId) {
+        this.unionId = unionId;
+    }
+
+
+    public String getSolutionName() {
+        return solutionName;
+    }
+
+    public void setSolutionName(String solutionName) {
+        this.solutionName = solutionName;
+    }
+
+
+    public String getTemplateUrl() {
+        return templateUrl;
+    }
+
+    public void setTemplateUrl(String templateUrl) {
+        this.templateUrl = templateUrl;
+    }
+
+
+    public Integer getDevValue() {
+        return devValue;
+    }
+
+    public void setDevValue(Integer devValue) {
+        this.devValue = devValue;
+    }
+
+
+    public String getTemplateParamGroupUnionId() {
+        return templateParamGroupUnionId;
+    }
+
+    public void setTemplateParamGroupUnionId(String templateParamGroupUnionId) {
+        this.templateParamGroupUnionId = templateParamGroupUnionId;
+    }
+}

+ 89 - 0
src/main/java/com/wdkl/pdm/dos/WdPrintTemplateParamDO.java

@@ -0,0 +1,89 @@
+package com.wdkl.pdm.dos;
+
+
+import com.fasterxml.jackson.databind.PropertyNamingStrategy;
+import com.fasterxml.jackson.databind.annotation.JsonNaming;
+import com.wdkl.pdm.database.annotation.Column;
+import com.wdkl.pdm.database.annotation.Id;
+import com.wdkl.pdm.database.annotation.PrimaryKeyField;
+import com.wdkl.pdm.database.annotation.Table;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+
+import java.io.Serializable;
+
+/**
+ * 自定义打印模版的参数
+ */
+
+
+@Table(name = "wd_print_template_param")
+@ApiModel
+@JsonNaming(value = PropertyNamingStrategy.SnakeCaseStrategy.class)
+public class WdPrintTemplateParamDO implements Serializable {
+
+    /**
+     * null
+     */
+    @Column(name = "id")
+    @ApiModelProperty(value = "null", required = true)
+    @Id(name = "id")
+    private Integer id;
+    /**
+     * null
+     */
+    @Column(name = "union_id")
+    @ApiModelProperty(value = "null", required = false)
+    private String unionId;
+    /**
+     * 模板参数变量名称
+     */
+    @Column(name = "template_param_name")
+    @ApiModelProperty(value = "模板变量名称", required = false)
+    private String templateParamName;
+
+    /**
+     * 备注
+     */
+    @Column(name = "remark")
+    @ApiModelProperty(value = "备注", required = false)
+    private String remark;
+
+
+    @PrimaryKeyField
+    public Integer getId() {
+        return id;
+    }
+
+    public void setId(Integer id) {
+        this.id = id;
+    }
+
+
+    public String getUnionId() {
+        return unionId;
+    }
+
+    public void setUnionId(String unionId) {
+        this.unionId = unionId;
+    }
+
+
+    public String getTemplateParamName() {
+        return templateParamName;
+    }
+
+    public void setTemplateParamName(String templateParamName) {
+        this.templateParamName = templateParamName;
+    }
+
+
+    public String getRemark() {
+        return remark;
+    }
+
+    public void setRemark(String remark) {
+        this.remark = remark;
+    }
+
+}

+ 101 - 0
src/main/java/com/wdkl/pdm/dos/WdPrintTemplateParamGroupDO.java

@@ -0,0 +1,101 @@
+package com.wdkl.pdm.dos;
+
+
+import com.fasterxml.jackson.databind.PropertyNamingStrategy;
+import com.fasterxml.jackson.databind.annotation.JsonNaming;
+import com.wdkl.pdm.database.annotation.Column;
+import com.wdkl.pdm.database.annotation.Id;
+import com.wdkl.pdm.database.annotation.PrimaryKeyField;
+import com.wdkl.pdm.database.annotation.Table;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+
+import java.io.Serializable;
+
+/**
+ * 打印参数分组,一个分组对应一个模版的参数列表
+ */
+
+@Table(name = "wd_print_template_param_group")
+@ApiModel
+@JsonNaming(value = PropertyNamingStrategy.SnakeCaseStrategy.class)
+public class WdPrintTemplateParamGroupDO implements Serializable {
+
+    /**
+     * null
+     */
+    @Column(name = "id")
+    @ApiModelProperty(value = "null", required = false)
+    @Id(name = "id")
+    private Integer id;
+
+    /**
+     * null
+     */
+    @Column(name = "union_id")
+    @ApiModelProperty(value = "null", required = false)
+    private String unionId;
+    /**
+     * null
+     */
+    @Column(name = "group_name")
+    @ApiModelProperty(value = "null", required = false)
+    private String groupName;
+    /**
+     * 参数union_id列表,逗号分隔
+     */
+    @Column(name = "param_union_ids")
+    @ApiModelProperty(value = "参数union_id列表,逗号分隔", required = false)
+    private String paramUnionIds;
+    /**
+     * 备注
+     */
+    @Column(name = "remark")
+    @ApiModelProperty(value = "备注", required = false)
+    private String remark;
+
+
+    @PrimaryKeyField
+    public Integer getId() {
+        return id;
+    }
+
+    public void setId(Integer id) {
+        this.id = id;
+    }
+
+
+    public String getGroupName() {
+        return groupName;
+    }
+
+    public void setGroupName(String groupName) {
+        this.groupName = groupName;
+    }
+
+
+    public String getParamUnionIds() {
+        return paramUnionIds;
+    }
+
+    public void setParamUnionIds(String paramUnionIds) {
+        this.paramUnionIds = paramUnionIds;
+    }
+
+
+    public String getRemark() {
+        return remark;
+    }
+
+    public void setRemark(String remark) {
+        this.remark = remark;
+    }
+
+    public String getUnionId() {
+        return unionId;
+    }
+
+    public void setUnionId(String unionId) {
+        this.unionId = unionId;
+    }
+}

+ 249 - 0
src/main/java/com/wdkl/pdm/dos/WdProduceFileDO.java

@@ -0,0 +1,249 @@
+package com.wdkl.pdm.dos;
+
+
+import com.fasterxml.jackson.databind.PropertyNamingStrategy;
+import com.fasterxml.jackson.databind.annotation.JsonNaming;
+import com.wdkl.pdm.database.annotation.Column;
+import com.wdkl.pdm.database.annotation.Id;
+import com.wdkl.pdm.database.annotation.PrimaryKeyField;
+import com.wdkl.pdm.database.annotation.Table;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+
+import java.io.Serializable;
+
+@Table(name = "wd_produce_file")
+@ApiModel
+@JsonNaming(value = PropertyNamingStrategy.SnakeCaseStrategy.class)
+public class WdProduceFileDO implements Serializable {
+
+    /**
+     * null
+     */
+    @Column(name = "id")
+    @ApiModelProperty(value = "null", required = false)
+    @Id(name = "id")
+    private Integer id;
+    /**
+     * null
+     */
+    @Column(name = "union_id")
+    @ApiModelProperty(value = "null", required = false)
+    private String unionId;
+    /**
+     * 文件名称
+     */
+    @Column(name = "file_name")
+    @ApiModelProperty(value = "文件名称", required = false)
+    private String fileName;
+    /**
+     * 文件大小
+     */
+    @Column(name = "file_size")
+    @ApiModelProperty(value = "文件大小", required = false)
+    private Long fileSize;
+    /**
+     * 文件路径
+     */
+    @Column(name = "file_path")
+    @ApiModelProperty(value = "文件路径", required = false)
+    private String filePath;
+    /**
+     * 文件用途1:mcu,2:ROM
+     */
+    @Column(name = "file_use")
+    @ApiModelProperty(value = "文件用途1:mcu,2:ROM", required = false)
+    private Integer fileUse;
+    /**
+     * 上传时间
+     */
+    @Column(name = "create_time")
+    @ApiModelProperty(value = "上传时间", required = false)
+    private Long createTime;
+    /**
+     * 是否为最新版本
+     */
+    @Column(name = "bool_latest")
+    @ApiModelProperty(value = "是否为最新版本", required = false)
+    private Boolean boolLatest;
+    /**
+     * 本地路径
+     */
+    @Column(name = "local_path")
+    @ApiModelProperty(value = "本地路径", required = false)
+    private String localPath;
+    /**
+     * 原始文件名
+     */
+    @Column(name = "file_raw_name")
+    @ApiModelProperty(value = "原始文件名", required = false)
+    private String fileRawName;
+
+    /**
+     * 文件版本号
+     */
+    @Column(name = "version")
+    @ApiModelProperty(value = "文件版本号", required = false)
+    private String version;
+
+    /**
+     * 文件类型,1文本文件,2二进制文件,3其他文件
+     */
+    @Column(name = "file_type")
+    @ApiModelProperty(value = "文件类型", required = false)
+    private Integer fileType;
+
+
+    /**
+     * mac地址存储点(文本文件代表行号,二进制文件代表地址偏移量)
+     */
+    @Column(name = "address_pos_row")
+    @ApiModelProperty(value = "mac地址存储点(文本文件代表行号,二进制文件代表地址偏移量)", required = false)
+    private Integer addressPosRow;
+
+    /**
+     * mac地址文本文件地址列号,表示地址的行和第几个字符开始
+     */
+    @Column(name = "address_pos_col")
+    @ApiModelProperty(value = "mac地址文本文件地址列号,表示地址的行和第几个字符开始", required = false)
+    private Integer addressPosCol;
+
+    /**
+     * 文件说明,描述文件用途,功能,版本等信息
+     */
+    @Column(name = "file_remark")
+    @ApiModelProperty(value = "文件说明", required = false)
+    private String fileRemark;
+
+
+    @PrimaryKeyField
+    public Integer getId() {
+        return id;
+    }
+
+    public void setId(Integer id) {
+        this.id = id;
+    }
+
+
+    public String getUnionId() {
+        return unionId;
+    }
+
+    public void setUnionId(String unionId) {
+        this.unionId = unionId;
+    }
+
+
+    public String getFileName() {
+        return fileName;
+    }
+
+    public void setFileName(String fileName) {
+        this.fileName = fileName;
+    }
+
+
+    public Long getFileSize() {
+        return fileSize;
+    }
+
+    public void setFileSize(Long fileSize) {
+        this.fileSize = fileSize;
+    }
+
+
+    public String getFilePath() {
+        return filePath;
+    }
+
+    public void setFilePath(String filePath) {
+        this.filePath = filePath;
+    }
+
+
+    public Integer getFileUse() {
+        return fileUse;
+    }
+
+    public void setFileUse(Integer fileUse) {
+        this.fileUse = fileUse;
+    }
+
+
+    public Long getCreateTime() {
+        return createTime;
+    }
+
+    public void setCreateTime(Long createTime) {
+        this.createTime = createTime;
+    }
+
+
+    public Boolean getBoolLatest() {
+        return boolLatest;
+    }
+
+    public void setBoolLatest(Boolean boolLatest) {
+        this.boolLatest = boolLatest;
+    }
+
+    public String getLocalPath() {
+        return localPath;
+    }
+
+    public void setLocalPath(String localPath) {
+        this.localPath = localPath;
+    }
+
+
+    public String getFileRawName() {
+        return fileRawName;
+    }
+
+    public void setFileRawName(String fileRawName) {
+        this.fileRawName = fileRawName;
+    }
+
+
+    public String getVersion() {
+        return version;
+    }
+
+    public void setVersion(String version) {
+        this.version = version;
+    }
+
+    public Integer getFileType() {
+        return fileType;
+    }
+
+    public void setFileType(Integer fileType) {
+        this.fileType = fileType;
+    }
+
+    public Integer getAddressPosRow() {
+        return addressPosRow;
+    }
+
+    public void setAddressPosRow(Integer addressPosRow) {
+        this.addressPosRow = addressPosRow;
+    }
+
+    public Integer getAddressPosCol() {
+        return addressPosCol;
+    }
+
+    public void setAddressPosCol(Integer addressPosCol) {
+        this.addressPosCol = addressPosCol;
+    }
+
+
+    public String getFileRemark() {
+        return fileRemark;
+    }
+
+    public void setFileRemark(String fileRemark) {
+        this.fileRemark = fileRemark;
+    }
+}

+ 127 - 0
src/main/java/com/wdkl/pdm/dos/WdProduceVersionDO.java

@@ -0,0 +1,127 @@
+package com.wdkl.pdm.dos;
+
+
+import com.fasterxml.jackson.databind.PropertyNamingStrategy;
+import com.fasterxml.jackson.databind.annotation.JsonNaming;
+import com.wdkl.pdm.database.annotation.Column;
+import com.wdkl.pdm.database.annotation.Id;
+import com.wdkl.pdm.database.annotation.PrimaryKeyField;
+import com.wdkl.pdm.database.annotation.Table;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+
+import java.io.Serializable;
+
+@Table(name = "wd_produce_version")
+@ApiModel
+@JsonNaming(value = PropertyNamingStrategy.SnakeCaseStrategy.class)
+public class WdProduceVersionDO implements Serializable {
+
+    /**
+     * null
+     */
+    @Column(name = "id")
+    @ApiModelProperty(value = "null", required = false)
+    @Id(name = "id")
+    private Integer id;
+    /**
+     * 版本号
+     */
+    @Column(name = "version_code")
+    @ApiModelProperty(value = "版本号", required = false)
+    private String versionCode;
+    /**
+     * 新版本文件地址
+     */
+    @Column(name = "update_file_path")
+    @ApiModelProperty(value = "新版本文件地址", required = false)
+    private String updateFilePath;
+    /**
+     * 更新时间
+     */
+    @Column(name = "create_time")
+    @ApiModelProperty(value = "更新时间", required = false)
+    private Long createTime;
+    /**
+     * 更新说明
+     */
+    @Column(name = "remark")
+    @ApiModelProperty(value = "更新说明", required = false)
+    private String remark;
+    /**
+     * 激活版本
+     */
+    @Column(name = "bool_active")
+    @ApiModelProperty(value = "激活版本", required = false)
+    private Boolean boolActive;
+
+    /**
+     * 文件服务器地址
+     */
+    @Column(name = "local_path")
+    @ApiModelProperty(value = "文件服务器地址", required = false)
+    private String localPath;
+
+
+    @PrimaryKeyField
+    public Integer getId() {
+        return id;
+    }
+
+    public void setId(Integer id) {
+        this.id = id;
+    }
+
+
+    public String getVersionCode() {
+        return versionCode;
+    }
+
+    public void setVersionCode(String versionCode) {
+        this.versionCode = versionCode;
+    }
+
+
+    public String getUpdateFilePath() {
+        return updateFilePath;
+    }
+
+    public void setUpdateFilePath(String updateFilePath) {
+        this.updateFilePath = updateFilePath;
+    }
+
+
+    public Long getCreateTime() {
+        return createTime;
+    }
+
+    public void setCreateTime(Long createTime) {
+        this.createTime = createTime;
+    }
+
+
+    public String getRemark() {
+        return remark;
+    }
+
+    public void setRemark(String remark) {
+        this.remark = remark;
+    }
+
+
+    public Boolean getBoolActive() {
+        return boolActive;
+    }
+
+    public void setBoolActive(Boolean boolActive) {
+        this.boolActive = boolActive;
+    }
+
+    public String getLocalPath() {
+        return localPath;
+    }
+
+    public void setLocalPath(String localPath) {
+        this.localPath = localPath;
+    }
+}

+ 96 - 0
src/main/java/com/wdkl/pdm/dos/WdProducedProductDO.java

@@ -0,0 +1,96 @@
+package com.wdkl.pdm.dos;
+
+
+import com.fasterxml.jackson.databind.PropertyNamingStrategy;
+import com.fasterxml.jackson.databind.annotation.JsonNaming;
+import com.wdkl.pdm.database.annotation.Column;
+import com.wdkl.pdm.database.annotation.Id;
+import com.wdkl.pdm.database.annotation.PrimaryKeyField;
+import com.wdkl.pdm.database.annotation.Table;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+
+import java.io.Serializable;
+
+@Table(name = "wd_produced_product")
+@ApiModel
+@JsonNaming(value = PropertyNamingStrategy.SnakeCaseStrategy.class)
+public class WdProducedProductDO implements Serializable {
+
+    /**
+     * null
+     */
+    @Column(name = "id")
+    @ApiModelProperty(value = "null", required = false)
+    @Id(name = "id")
+    private Integer id;
+    /**
+     * null
+     */
+    @Column(name = "union_id")
+    @ApiModelProperty(value = "null", required = false)
+    private String unionId;
+    /**
+     * 产品unionId
+     */
+    @Column(name = "product_union_id")
+    @ApiModelProperty(value = "产品unionId", required = false)
+    private String productUnionId;
+    /**
+     * mac地址
+     */
+    @Column(name = "mac")
+    @ApiModelProperty(value = "mac地址", required = false)
+    private String mac;
+
+    /**
+     * mac地址
+     */
+    @Column(name = "produce_date")
+    @ApiModelProperty(value = "生产日期", required = false)
+    private Long produceDate;
+
+    @PrimaryKeyField
+    public Integer getId() {
+        return id;
+    }
+
+    public void setId(Integer id) {
+        this.id = id;
+    }
+
+
+    public String getUnionId() {
+        return unionId;
+    }
+
+    public void setUnionId(String unionId) {
+        this.unionId = unionId;
+    }
+
+
+    public String getProductUnionId() {
+        return productUnionId;
+    }
+
+    public void setProductUnionId(String productUnionId) {
+        this.productUnionId = productUnionId;
+    }
+
+
+    public String getMac() {
+        return mac;
+    }
+
+    public void setMac(String mac) {
+        this.mac = mac;
+    }
+
+    public Long getProduceDate() {
+        return produceDate;
+    }
+
+    public void setProduceDate(Long produceDate) {
+        this.produceDate = produceDate;
+    }
+}

+ 114 - 0
src/main/java/com/wdkl/pdm/dos/WdProductCategoryDO.java

@@ -0,0 +1,114 @@
+package com.wdkl.pdm.dos;
+
+
+import com.fasterxml.jackson.databind.PropertyNamingStrategy;
+import com.fasterxml.jackson.databind.annotation.JsonNaming;
+import com.wdkl.pdm.database.annotation.Column;
+import com.wdkl.pdm.database.annotation.Id;
+import com.wdkl.pdm.database.annotation.PrimaryKeyField;
+import com.wdkl.pdm.database.annotation.Table;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+
+import java.io.Serializable;
+
+@Table(name = "wd_product_category")
+@ApiModel
+@JsonNaming(value = PropertyNamingStrategy.SnakeCaseStrategy.class)
+public class WdProductCategoryDO implements Serializable {
+
+    /**
+     * null
+     */
+    @Column(name = "id")
+    @ApiModelProperty(value = "null", required = false)
+    @Id(name = "id")
+    private Integer id;
+    /**
+     * null
+     */
+    @Column(name = "union_id")
+    @ApiModelProperty(value = "null", required = false)
+    private String unionId;
+    /**
+     * 分类名称
+     */
+    @Column(name = "category_name")
+    @ApiModelProperty(value = "分类名称", required = false)
+    private String categoryName;
+
+
+    /**
+     * 分类型号编码
+     */
+    @Column(name = "category_code")
+    @ApiModelProperty(value = "分类型号编码", required = false)
+    private String categoryCode;
+
+
+    /**
+     * V3类型值
+     */
+    @Column(name = "category_value")
+    @ApiModelProperty(value = "V3类型值", required = false)
+    private String categoryValue;
+
+    /**
+     * 分类名称
+     */
+    @Column(name = "sort")
+    @ApiModelProperty(value = "排序", required = false)
+    private Integer sort;
+
+
+    @PrimaryKeyField
+    public Integer getId() {
+        return id;
+    }
+
+    public void setId(Integer id) {
+        this.id = id;
+    }
+
+
+    public String getUnionId() {
+        return unionId;
+    }
+
+    public void setUnionId(String unionId) {
+        this.unionId = unionId;
+    }
+
+
+    public String getCategoryName() {
+        return categoryName;
+    }
+
+    public void setCategoryName(String categoryName) {
+        this.categoryName = categoryName;
+    }
+
+    public Integer getSort() {
+        return sort;
+    }
+
+    public void setSort(Integer sort) {
+        this.sort = sort;
+    }
+
+    public String getCategoryCode() {
+        return categoryCode;
+    }
+
+    public void setCategoryCode(String categoryCode) {
+        this.categoryCode = categoryCode;
+    }
+
+    public String getCategoryValue() {
+        return categoryValue;
+    }
+
+    public void setCategoryValue(String categoryValue) {
+        this.categoryValue = categoryValue;
+    }
+}

+ 113 - 0
src/main/java/com/wdkl/pdm/dos/WdProductCategoryLabelPrefixDO.java

@@ -0,0 +1,113 @@
+package com.wdkl.pdm.dos;
+
+
+import com.fasterxml.jackson.databind.PropertyNamingStrategy;
+import com.fasterxml.jackson.databind.annotation.JsonNaming;
+import com.wdkl.pdm.database.annotation.Column;
+import com.wdkl.pdm.database.annotation.Id;
+import com.wdkl.pdm.database.annotation.PrimaryKeyField;
+import com.wdkl.pdm.database.annotation.Table;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+
+import java.io.Serializable;
+
+@Table(name = "wd_product_category_label_prefix")
+@ApiModel
+@JsonNaming(value = PropertyNamingStrategy.SnakeCaseStrategy.class)
+public class WdProductCategoryLabelPrefixDO implements Serializable {
+
+    /**
+     * null
+     */
+    @Column(name = "id")
+    @ApiModelProperty(value = "null", required = false)
+    @Id(name = "id")
+    private Integer id;
+    /**
+     * null
+     */
+    @Column(name = "union_id")
+    @ApiModelProperty(value = "null", required = false)
+    private String unionId;
+    /**
+     * 产品分类union_id
+     */
+    @Column(name = "product_category_union_id")
+    @ApiModelProperty(value = "产品分类union_id", required = false)
+    private String productCategoryUnionId;
+    /**
+     * 语言union_id
+     */
+    @Column(name = "language_union_id")
+    @ApiModelProperty(value = "语言union_id", required = false)
+    private String languageUnionId;
+    /**
+     * 编码标签前缀
+     */
+    @Column(name = "prefix_value")
+    @ApiModelProperty(value = "编码标签前缀", required = false)
+    private String prefixValue;
+    /**
+     * 排序
+     */
+    @Column(name = "index_no")
+    @ApiModelProperty(value = "排序", required = false)
+    private Integer indexNo;
+
+
+    @PrimaryKeyField
+    public Integer getId() {
+        return id;
+    }
+
+    public void setId(Integer id) {
+        this.id = id;
+    }
+
+
+    public String getUnionId() {
+        return unionId;
+    }
+
+    public void setUnionId(String unionId) {
+        this.unionId = unionId;
+    }
+
+
+    public String getProductCategoryUnionId() {
+        return productCategoryUnionId;
+    }
+
+    public void setProductCategoryUnionId(String productCategoryUnionId) {
+        this.productCategoryUnionId = productCategoryUnionId;
+    }
+
+
+    public String getLanguageUnionId() {
+        return languageUnionId;
+    }
+
+    public void setLanguageUnionId(String languageUnionId) {
+        this.languageUnionId = languageUnionId;
+    }
+
+
+    public String getPrefixValue() {
+        return prefixValue;
+    }
+
+    public void setPrefixValue(String prefixValue) {
+        this.prefixValue = prefixValue;
+    }
+
+
+    public Integer getIndexNo() {
+        return indexNo;
+    }
+
+    public void setIndexNo(Integer indexNo) {
+        this.indexNo = indexNo;
+    }
+
+}

+ 319 - 0
src/main/java/com/wdkl/pdm/dos/WdProductDO.java

@@ -0,0 +1,319 @@
+package com.wdkl.pdm.dos;
+
+
+import com.fasterxml.jackson.databind.PropertyNamingStrategy;
+import com.fasterxml.jackson.databind.annotation.JsonNaming;
+import com.wdkl.pdm.database.annotation.Column;
+import com.wdkl.pdm.database.annotation.Id;
+import com.wdkl.pdm.database.annotation.PrimaryKeyField;
+import com.wdkl.pdm.database.annotation.Table;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+
+import java.io.Serializable;
+
+@Table(name = "wd_product")
+@ApiModel
+@JsonNaming(value = PropertyNamingStrategy.SnakeCaseStrategy.class)
+public class WdProductDO implements Serializable {
+
+    /**
+     * null
+     */
+    @Column(name = "id")
+    @ApiModelProperty(value = "null", required = false)
+    @Id(name = "id")
+    private Integer id;
+    /**
+     * null
+     */
+    @Column(name = "union_id")
+    @ApiModelProperty(value = "null", required = false)
+    private String unionId;
+    /**
+     * 产品名称
+     */
+    @Column(name = "pd_name")
+    @ApiModelProperty(value = "产品名称", required = false)
+    private String pdName;
+    /**
+     * 是否需要写MCU
+     */
+    @Column(name = "bool_mcu")
+    @ApiModelProperty(value = "是否需要写MCU", required = false)
+    private Boolean boolMcu;
+    /**
+     * 需要修改MCU地址
+     */
+    @Column(name = "need_mcu_mac")
+    @ApiModelProperty(value = "需要修改MCU地址", required = false)
+    private Boolean needMcuMac;
+    /**
+     * 是否需要刷ROM
+     */
+    @Column(name = "bool_rom")
+    @ApiModelProperty(value = "是否需要刷ROM", required = false)
+    private Boolean boolRom;
+    /**
+     * 是否是485设备
+     */
+    @Column(name = "bool_r485")
+    @ApiModelProperty(value = "是否是485设备", required = false)
+    private Boolean boolR485;
+    /**
+     * 是否安装APP
+     */
+    @Column(name = "bool_app_install")
+    @ApiModelProperty(value = "是否安装APP", required = false)
+    private Boolean boolAppInstall;
+
+
+    /**
+     * 是否读取设备序列号
+     */
+    @Column(name = "bool_read_device_serialno")
+    @ApiModelProperty(value = "是否读取设备序列号", required = false)
+    private Boolean boolReadDeviceSerialno;
+
+    /**
+     * 是否为第三(外购)设备
+     */
+    @Column(name = "bool_third_party")
+    @ApiModelProperty(value = "是否为第三(外购)设备", required = false)
+    private Boolean boolThirdParty;
+
+
+
+
+    /**
+     * mcu芯片unionid
+     */
+    @Column(name = "mcu_chip_union_id")
+    @ApiModelProperty(value = "mcu芯片unionid", required = false)
+    private String mcuChipUnionId;
+    /**
+     * 创建时间
+     */
+    @Column(name = "create_time")
+    @ApiModelProperty(value = "创建时间", required = false)
+    private Long createTime;
+    /**
+     * 是否需要打印二维码
+     */
+    @Column(name = "need_print_qcode")
+    @ApiModelProperty(value = "是否需要打印二维码", required = false)
+    private Boolean needPrintQcode;
+    /**
+     * 二维码打印数量
+     */
+    @Column(name = "qcode_qty")
+    @ApiModelProperty(value = "二维码打印数量", required = false)
+    private Integer qcodeQty;
+    /**
+     * 产品分类
+     */
+    @Column(name = "pd_type")
+    @ApiModelProperty(value = "产品分类", required = false)
+    private String pdType;
+    /**
+     * mcu文件unionId
+     */
+    @Column(name = "mcu_file_union_id")
+    @ApiModelProperty(value = "mcu文件unionId", required = false)
+    private String mcuFileUnionId;
+    /**
+     * rom文件unionId
+     */
+    @Column(name = "rom_file_union_id")
+    @ApiModelProperty(value = "rom文件unionId", required = false)
+    private String romFileUnionId;
+    /**
+     * rom芯片unionId
+     */
+    @Column(name = "rom_chip_union_id")
+    @ApiModelProperty(value = "rom芯片unionId", required = false)
+    private String romChipUnionId;
+
+    /**
+     * 打印方案unionId
+     */
+    @Column(name = "print_solution_union_id")
+    @ApiModelProperty(value = "打印方案unionId", required = false)
+    private String printSolutionUnionId;
+
+    /**
+     * 需安装的apk文件unionId,以,分割
+     */
+    @Column(name = "app_file_union_ids")
+    @ApiModelProperty(value = "需安装的apk文件unionId集合", required = false)
+    private String appFileUnionIds;
+
+
+    @PrimaryKeyField
+    public Integer getId() {
+        return id;
+    }
+
+    public void setId(Integer id) {
+        this.id = id;
+    }
+
+
+    public String getUnionId() {
+        return unionId;
+    }
+
+    public void setUnionId(String unionId) {
+        this.unionId = unionId;
+    }
+
+
+    public String getPdName() {
+        return pdName;
+    }
+
+    public void setPdName(String pdName) {
+        this.pdName = pdName;
+    }
+
+
+    public Boolean getBoolMcu() {
+        return boolMcu;
+    }
+
+    public void setBoolMcu(Boolean boolMcu) {
+        this.boolMcu = boolMcu;
+    }
+
+    public Boolean getNeedMcuMac() {
+        return needMcuMac;
+    }
+
+    public void setNeedMcuMac(Boolean needMcuMac) {
+        this.needMcuMac = needMcuMac;
+    }
+
+    public Boolean getBoolRom() {
+        return boolRom;
+    }
+
+    public void setBoolRom(Boolean boolRom) {
+        this.boolRom = boolRom;
+    }
+
+    public Boolean getBoolR485() {
+        return boolR485;
+    }
+
+    public void setBoolR485(Boolean boolR485) {
+        this.boolR485 = boolR485;
+    }
+
+    public String getMcuChipUnionId() {
+        return mcuChipUnionId;
+    }
+
+    public void setMcuChipUnionId(String mcuChipUnionId) {
+        this.mcuChipUnionId = mcuChipUnionId;
+    }
+
+    public Long getCreateTime() {
+        return createTime;
+    }
+
+    public void setCreateTime(Long createTime) {
+        this.createTime = createTime;
+    }
+
+    public Boolean getNeedPrintQcode() {
+        return needPrintQcode;
+    }
+
+    public void setNeedPrintQcode(Boolean needPrintQcode) {
+        this.needPrintQcode = needPrintQcode;
+    }
+
+    public Integer getQcodeQty() {
+        return qcodeQty;
+    }
+
+    public void setQcodeQty(Integer qcodeQty) {
+        this.qcodeQty = qcodeQty;
+    }
+
+
+    public String getPdType() {
+        return pdType;
+    }
+
+    public void setPdType(String pdType) {
+        this.pdType = pdType;
+    }
+
+    public String getMcuFileUnionId() {
+        return mcuFileUnionId;
+    }
+
+    public void setMcuFileUnionId(String mcuFileUnionId) {
+        this.mcuFileUnionId = mcuFileUnionId;
+    }
+
+
+    public String getRomFileUnionId() {
+        return romFileUnionId;
+    }
+
+    public void setRomFileUnionId(String romFileUnionId) {
+        this.romFileUnionId = romFileUnionId;
+    }
+
+
+    public String getRomChipUnionId() {
+        return romChipUnionId;
+    }
+
+    public void setRomChipUnionId(String romChipUnionId) {
+        this.romChipUnionId = romChipUnionId;
+    }
+
+
+    public String getPrintSolutionUnionId() {
+        return printSolutionUnionId;
+    }
+
+    public void setPrintSolutionUnionId(String printSolutionUnionId) {
+        this.printSolutionUnionId = printSolutionUnionId;
+    }
+
+    public Boolean getBoolAppInstall() {
+        return boolAppInstall;
+    }
+
+    public void setBoolAppInstall(Boolean boolAppInstall) {
+        this.boolAppInstall = boolAppInstall;
+    }
+
+    public String getAppFileUnionIds() {
+        return appFileUnionIds;
+    }
+
+    public void setAppFileUnionIds(String appFileUnionIds) {
+        this.appFileUnionIds = appFileUnionIds;
+    }
+
+    public Boolean getBoolReadDeviceSerialno() {
+        return boolReadDeviceSerialno;
+    }
+
+    public void setBoolReadDeviceSerialno(Boolean boolReadDeviceSerialno) {
+        this.boolReadDeviceSerialno = boolReadDeviceSerialno;
+    }
+
+    public Boolean getBoolThirdParty() {
+        return boolThirdParty;
+    }
+
+    public void setBoolThirdParty(Boolean boolThirdParty) {
+        this.boolThirdParty = boolThirdParty;
+    }
+}

+ 199 - 0
src/main/java/com/wdkl/pdm/dos/WdThemometerProducedDO.java

@@ -0,0 +1,199 @@
+package com.wdkl.pdm.dos;
+
+
+import com.fasterxml.jackson.databind.PropertyNamingStrategy;
+import com.fasterxml.jackson.databind.annotation.JsonNaming;
+import com.wdkl.pdm.database.annotation.Column;
+import com.wdkl.pdm.database.annotation.Id;
+import com.wdkl.pdm.database.annotation.PrimaryKeyField;
+import com.wdkl.pdm.database.annotation.Table;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+
+import java.io.Serializable;
+
+@Table(name = "wd_themometer_produced")
+@ApiModel
+@JsonNaming(value = PropertyNamingStrategy.SnakeCaseStrategy.class)
+public class WdThemometerProducedDO implements Serializable {
+
+    /**
+     * null
+     */
+    @Column(name = "id")
+    @ApiModelProperty(value = "null", required = false)
+    @Id(name = "id")
+    private Integer id;
+    /**
+     * null
+     */
+    @Column(name = "union_id")
+    @ApiModelProperty(value = "null", required = false)
+    private String unionId;
+    /**
+     * 体温枪型号
+     */
+    @Column(name = "model")
+    @ApiModelProperty(value = "体温枪型号", required = false)
+    private String model;
+    /**
+     * 体温枪名称
+     */
+    @Column(name = "name")
+    @ApiModelProperty(value = "体温枪名称", required = false)
+    private String name;
+    /**
+     * 序列号,出厂编号
+     */
+    @Column(name = "serial_no")
+    @ApiModelProperty(value = "序列号,出厂编号", required = false)
+    private String serialNo;
+    /**
+     * 防伪码
+     */
+    @Column(name = "security_code")
+    @ApiModelProperty(value = "防伪码", required = false)
+    private String securityCode;
+    /**
+     * 生产批号
+     */
+    @Column(name = "batch_number")
+    @ApiModelProperty(value = "生产批号", required = false)
+    private String batchNumber;
+    /**
+     * 生产日期
+     */
+    @Column(name = "produce_date")
+    @ApiModelProperty(value = "生产日期", required = false)
+    private Long produceDate;
+    /**
+     * 生产班次
+     */
+    @Column(name = "schedual_code")
+    @ApiModelProperty(value = "生产班次", required = false)
+    private String schedualCode;
+    /**
+     * 上传日期
+     */
+    @Column(name = "upload_date")
+    @ApiModelProperty(value = "上传日期", required = false)
+    private Long uploadDate;
+    /**
+     * 批次内生产序号
+     */
+    @Column(name = "number")
+    @ApiModelProperty(value = "批次内生产序号", required = false)
+    private String number;
+
+    /**
+     * 使用年限
+     */
+    @Column(name = "expiration")
+    @ApiModelProperty(value = "使用年限", required = false)
+    private String expiration;
+
+    @PrimaryKeyField
+    public Integer getId() {
+        return id;
+    }
+
+    public void setId(Integer id) {
+        this.id = id;
+    }
+
+
+    public String getUnionId() {
+        return unionId;
+    }
+
+    public void setUnionId(String unionId) {
+        this.unionId = unionId;
+    }
+
+
+    public String getModel() {
+        return model;
+    }
+
+    public void setModel(String model) {
+        this.model = model;
+    }
+
+
+    public String getName() {
+        return name;
+    }
+
+    public void setName(String name) {
+        this.name = name;
+    }
+
+
+    public String getSerialNo() {
+        return serialNo;
+    }
+
+    public void setSerialNo(String serialNo) {
+        this.serialNo = serialNo;
+    }
+
+
+    public String getSecurityCode() {
+        return securityCode;
+    }
+
+    public void setSecurityCode(String securityCode) {
+        this.securityCode = securityCode;
+    }
+
+
+    public String getBatchNumber() {
+        return batchNumber;
+    }
+
+    public void setBatchNumber(String batchNumber) {
+        this.batchNumber = batchNumber;
+    }
+
+
+    public Long getProduceDate() {
+        return produceDate;
+    }
+
+    public void setProduceDate(Long produceDate) {
+        this.produceDate = produceDate;
+    }
+
+    public Long getUploadDate() {
+        return uploadDate;
+    }
+
+    public void setUploadDate(Long uploadDate) {
+        this.uploadDate = uploadDate;
+    }
+
+    public String getNumber() {
+        return number;
+    }
+
+    public void setNumber(String number) {
+        this.number = number;
+    }
+
+    public String getSchedualCode() {
+        return schedualCode;
+    }
+
+    public void setSchedualCode(String schedualCode) {
+        this.schedualCode = schedualCode;
+    }
+
+
+    public String getExpiration() {
+        return expiration;
+    }
+
+    public void setExpiration(String expiration) {
+        this.expiration = expiration;
+    }
+}

+ 127 - 0
src/main/java/com/wdkl/pdm/dos/WdThermometerCategoryDO.java

@@ -0,0 +1,127 @@
+package com.wdkl.pdm.dos;
+
+
+import com.fasterxml.jackson.databind.PropertyNamingStrategy;
+import com.fasterxml.jackson.databind.annotation.JsonNaming;
+import com.wdkl.pdm.database.annotation.Column;
+import com.wdkl.pdm.database.annotation.Id;
+import com.wdkl.pdm.database.annotation.PrimaryKeyField;
+import com.wdkl.pdm.database.annotation.Table;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+
+import java.io.Serializable;
+
+@Table(name = "wd_thermometer_category")
+@ApiModel
+@JsonNaming(value = PropertyNamingStrategy.SnakeCaseStrategy.class)
+public class WdThermometerCategoryDO implements Serializable {
+
+    /**
+     * null
+     */
+    @Column(name = "id")
+    @ApiModelProperty(value = "null", required = false)
+    @Id(name = "id")
+    private Integer id;
+    /**
+     * 体温枪名称
+     */
+    @Column(name = "name")
+    @ApiModelProperty(value = "体温枪名称", required = false)
+    private String name;
+    /**
+     * 体温枪型号
+     */
+    @Column(name = "model")
+    @ApiModelProperty(value = "体温枪型号", required = false)
+    private String model;
+    /**
+     * 代号
+     */
+    @Column(name = "code")
+    @ApiModelProperty(value = "代号", required = false)
+    private String code;
+    /**
+     * 统一标识
+     */
+    @Column(name = "union_id")
+    @ApiModelProperty(value = "统一标识", required = false)
+    private String unionId;
+    /**
+     * 批次号前缀
+     */
+    @Column(name = "batch_number_prefix")
+    @ApiModelProperty(value = "批次号前缀", required = false)
+    private String batchNumberPrefix;
+
+    /**
+     * 使用年限
+     */
+    @Column(name = "expiration")
+    @ApiModelProperty(value = "使用年限", required = false)
+    private String expiration;
+
+
+    @PrimaryKeyField
+    public Integer getId() {
+        return id;
+    }
+
+    public void setId(Integer id) {
+        this.id = id;
+    }
+
+
+    public String getName() {
+        return name;
+    }
+
+    public void setName(String name) {
+        this.name = name;
+    }
+
+
+    public String getModel() {
+        return model;
+    }
+
+    public void setModel(String model) {
+        this.model = model;
+    }
+
+
+    public String getCode() {
+        return code;
+    }
+
+    public void setCode(String code) {
+        this.code = code;
+    }
+
+
+    public String getUnionId() {
+        return unionId;
+    }
+
+    public void setUnionId(String unionId) {
+        this.unionId = unionId;
+    }
+
+
+    public String getBatchNumberPrefix() {
+        return batchNumberPrefix;
+    }
+
+    public void setBatchNumberPrefix(String batchNumberPrefix) {
+        this.batchNumberPrefix = batchNumberPrefix;
+    }
+
+    public String getExpiration() {
+        return expiration;
+    }
+
+    public void setExpiration(String expiration) {
+        this.expiration = expiration;
+    }
+}

+ 83 - 0
src/main/java/com/wdkl/pdm/dos/WdThermometerSchedualDO.java

@@ -0,0 +1,83 @@
+package com.wdkl.pdm.dos;
+
+
+import com.fasterxml.jackson.databind.PropertyNamingStrategy;
+import com.fasterxml.jackson.databind.annotation.JsonNaming;
+import com.wdkl.pdm.database.annotation.Column;
+import com.wdkl.pdm.database.annotation.Id;
+import com.wdkl.pdm.database.annotation.PrimaryKeyField;
+import com.wdkl.pdm.database.annotation.Table;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+
+import java.io.Serializable;
+
+@Table(name = "wd_thermometer_schedual")
+@ApiModel
+@JsonNaming(value = PropertyNamingStrategy.SnakeCaseStrategy.class)
+public class WdThermometerSchedualDO implements Serializable {
+
+    /**
+     * null
+     */
+    @Column(name = "id")
+    @ApiModelProperty(value = "null", required = false)
+    @Id(name = "id")
+    private Integer id;
+    /**
+     * null
+     */
+    @Column(name = "schedual_name")
+    @ApiModelProperty(value = "null", required = false)
+    private String schedualName;
+    /**
+     * null
+     */
+    @Column(name = "schedual_code")
+    @ApiModelProperty(value = "null", required = false)
+    private String schedualCode;
+    /**
+     * null
+     */
+    @Column(name = "union_id")
+    @ApiModelProperty(value = "null", required = false)
+    private String unionId;
+
+
+    @PrimaryKeyField
+    public Integer getId() {
+        return id;
+    }
+
+    public void setId(Integer id) {
+        this.id = id;
+    }
+
+
+    public String getSchedualName() {
+        return schedualName;
+    }
+
+    public void setSchedualName(String schedualName) {
+        this.schedualName = schedualName;
+    }
+
+
+    public String getSchedualCode() {
+        return schedualCode;
+    }
+
+    public void setSchedualCode(String schedualCode) {
+        this.schedualCode = schedualCode;
+    }
+
+
+    public String getUnionId() {
+        return unionId;
+    }
+
+    public void setUnionId(String unionId) {
+        this.unionId = unionId;
+    }
+
+}

+ 83 - 0
src/main/java/com/wdkl/pdm/dos/WdUsersDO.java

@@ -0,0 +1,83 @@
+package com.wdkl.pdm.dos;
+
+
+import com.fasterxml.jackson.databind.PropertyNamingStrategy;
+import com.fasterxml.jackson.databind.annotation.JsonNaming;
+import com.wdkl.pdm.database.annotation.Column;
+import com.wdkl.pdm.database.annotation.Id;
+import com.wdkl.pdm.database.annotation.PrimaryKeyField;
+import com.wdkl.pdm.database.annotation.Table;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+
+import java.io.Serializable;
+
+@Table(name = "wd_users")
+@ApiModel
+@JsonNaming(value = PropertyNamingStrategy.SnakeCaseStrategy.class)
+public class WdUsersDO implements Serializable {
+
+    /**
+     * null
+     */
+    @Column(name = "id")
+    @ApiModelProperty(value = "null", required = false)
+    @Id(name = "id")
+    private Integer id;
+    /**
+     * null
+     */
+    @Column(name = "user_name")
+    @ApiModelProperty(value = "null", required = false)
+    private String userName;
+    /**
+     * null
+     */
+    @Column(name = "password")
+    @ApiModelProperty(value = "null", required = false)
+    private String password;
+    /**
+     * null
+     */
+    @Column(name = "true_name")
+    @ApiModelProperty(value = "null", required = false)
+    private String trueName;
+
+
+    @PrimaryKeyField
+    public Integer getId() {
+        return id;
+    }
+
+    public void setId(Integer id) {
+        this.id = id;
+    }
+
+
+    public String getUserName() {
+        return userName;
+    }
+
+    public void setUserName(String userName) {
+        this.userName = userName;
+    }
+
+
+    public String getPassword() {
+        return password;
+    }
+
+    public void setPassword(String password) {
+        this.password = password;
+    }
+
+
+    public String getTrueName() {
+        return trueName;
+    }
+
+    public void setTrueName(String trueName) {
+        this.trueName = trueName;
+    }
+
+}

+ 76 - 0
src/main/java/com/wdkl/pdm/exception/ErrorMessage.java

@@ -0,0 +1,76 @@
+package com.wdkl.pdm.exception;
+
+
+import org.apache.commons.lang.builder.EqualsBuilder;
+import org.apache.commons.lang.builder.HashCodeBuilder;
+
+/**
+ * 错误消息
+ * Created by Allen
+ */
+public class ErrorMessage  {
+
+	private String code;
+	private String message;
+
+	public ErrorMessage() {
+	}
+
+	public ErrorMessage(String code, String message ) {
+
+		this.code = code;
+		this.message = message;
+
+	}
+
+
+	public String getCode() {
+		return code;
+	}
+
+	public void setCode(String code) {
+		this.code = code;
+	}
+
+	public String getMessage() {
+		return message;
+	}
+
+	public void setMessage(String message) {
+		this.message = message;
+	}
+
+	@Override
+	public boolean equals(Object o) {
+		if (this == o) {
+			return true;
+		}
+
+		if (o == null || getClass() != o.getClass()) {
+			return false;
+		}
+
+		ErrorMessage that = (ErrorMessage) o;
+
+		return new EqualsBuilder()
+				.append(code, that.code)
+				.append(message, that.message)
+				.isEquals();
+	}
+
+	@Override
+	public int hashCode() {
+		return new HashCodeBuilder(17, 37)
+				.append(code)
+				.append(message)
+				.toHashCode();
+	}
+
+	@Override
+	public String toString() {
+		return "ErrorMessage{" +
+				"code='" + code + '\'' +
+				", message='" + message + '\'' +
+				'}';
+	}
+}

+ 54 - 0
src/main/java/com/wdkl/pdm/exception/ErrorMessageWithData.java

@@ -0,0 +1,54 @@
+package com.wdkl.pdm.exception;
+
+import org.apache.commons.lang.builder.EqualsBuilder;
+import org.apache.commons.lang.builder.HashCodeBuilder;
+
+/**
+ * 带数据的错误消息
+ * Created by Allen
+ */
+public class ErrorMessageWithData  extends  ErrorMessage{
+
+    private Object data;
+
+
+    public ErrorMessageWithData(String code, String message, Object data) {
+        super(code, message);
+        this.data = data;
+    }
+
+    public Object getData() {
+        return data;
+    }
+
+
+    public ErrorMessageWithData() {
+        super();
+    }
+
+    @Override
+    public boolean equals(Object o) {
+        if (this == o){
+            return true;
+        }
+
+        if (o == null || getClass() != o.getClass()){
+            return false;
+        }
+
+        ErrorMessageWithData that = (ErrorMessageWithData) o;
+
+        return new EqualsBuilder()
+                .appendSuper(super.equals(o))
+                .append(data, that.data)
+                .isEquals();
+    }
+
+    @Override
+    public int hashCode() {
+        return new HashCodeBuilder(17, 37)
+                .appendSuper(super.hashCode())
+                .append(data)
+                .toHashCode();
+    }
+}

+ 102 - 0
src/main/java/com/wdkl/pdm/exception/JavashopExceptionHandler.java

@@ -0,0 +1,102 @@
+package com.wdkl.pdm.exception;
+
+import org.springframework.http.HttpStatus;
+import org.springframework.validation.BindException;
+import org.springframework.validation.ObjectError;
+import org.springframework.web.bind.MethodArgumentNotValidException;
+import org.springframework.web.bind.annotation.ControllerAdvice;
+import org.springframework.web.bind.annotation.ExceptionHandler;
+import org.springframework.web.bind.annotation.ResponseBody;
+import org.springframework.web.bind.annotation.ResponseStatus;
+
+import javax.servlet.http.HttpServletResponse;
+import javax.validation.ConstraintViolation;
+import javax.validation.ConstraintViolationException;
+
+/**
+ * Eop 参数校验处理类
+ *
+ */
+@ControllerAdvice
+public class JavashopExceptionHandler {
+    /**
+     * 处理单个参数校验
+     *
+     * @param e
+     * @return
+     */
+    @ExceptionHandler(ConstraintViolationException.class)
+    @ResponseBody
+    @ResponseStatus(HttpStatus.BAD_REQUEST)
+    public ErrorMessage handleValidationException(ConstraintViolationException e) {
+        for (ConstraintViolation<?> s : e.getConstraintViolations()) {
+            return new ErrorMessage(SystemErrorCodeV1.INVALID_REQUEST_PARAMETER, s.getMessage());
+        }
+        return new ErrorMessage(SystemErrorCodeV1.INVALID_REQUEST_PARAMETER, "未知参数错误");
+    }
+
+    /**
+     * 处理参数异常
+     *
+     * @param e
+     * @return
+     */
+    @ExceptionHandler(MethodArgumentNotValidException.class)
+    @ResponseBody
+    @ResponseStatus(HttpStatus.BAD_REQUEST)
+    public ErrorMessage handleValidationBodyException(MethodArgumentNotValidException e) {
+        for (ObjectError s : e.getBindingResult().getAllErrors()) {
+            return new ErrorMessage(SystemErrorCodeV1.INVALID_REQUEST_PARAMETER, s.getDefaultMessage());
+        }
+        return new ErrorMessage(SystemErrorCodeV1.INVALID_REQUEST_PARAMETER, "未知参数错误");
+    }
+
+    /**
+     * 处理实体类校验
+     *
+     * @param e
+     * @return
+     */
+    @ExceptionHandler(BindException.class)
+    @ResponseBody
+    @ResponseStatus(HttpStatus.BAD_REQUEST)
+    public ErrorMessage handleValidationBeanException(BindException e) {
+
+        for (ObjectError s : e.getAllErrors()) {
+            return new ErrorMessage(SystemErrorCodeV1.INVALID_REQUEST_PARAMETER, s.getDefaultMessage());
+        }
+        return new ErrorMessage(SystemErrorCodeV1.INVALID_REQUEST_PARAMETER, "未知参数错误");
+    }
+
+    /**
+     * 处理ServiceExcepiton:业务类抛出来的异常
+     *
+     * @param e
+     * @return
+     */
+    @ExceptionHandler(ServiceException.class)
+    @ResponseBody
+    public ErrorMessage handleServiceException(ServiceException e, HttpServletResponse response) {
+        response.setStatus(e.getStatusCode().value());
+        Object data = e.getData();
+        if (data == null) {
+            return new ErrorMessage(e.getCode(), e.getMessage());
+        } else {
+            return new ErrorMessageWithData(e.getCode(), e.getMessage(), data);
+        }
+
+    }
+
+    /**
+     * 处理参数传递异常
+     */
+    @ExceptionHandler(IllegalArgumentException.class)
+    @ResponseBody
+    public ErrorMessage handleUnProccessableServiceException(IllegalArgumentException e, HttpServletResponse response) {
+
+        response.setStatus(HttpStatus.INTERNAL_SERVER_ERROR.value());
+        return new ErrorMessage(SystemErrorCodeV1.INVALID_REQUEST_PARAMETER, e.getMessage());
+    }
+
+
+}

+ 20 - 0
src/main/java/com/wdkl/pdm/exception/NoPermissionException.java

@@ -0,0 +1,20 @@
+package com.wdkl.pdm.exception;
+
+import org.springframework.http.HttpStatus;
+
+/**
+ * 无权限异常,比如试图更新一个别人的账号的密码
+ *
+ * @author yanlin
+ */
+public class NoPermissionException extends ServiceException {
+
+    private static final long serialVersionUID = 8207742972948289957L;
+
+    public NoPermissionException(String message) {
+        super(SystemErrorCodeV1.NO_PERMISSION, message);
+        this.statusCode = HttpStatus.UNAUTHORIZED;
+    }
+
+
+}

+ 21 - 0
src/main/java/com/wdkl/pdm/exception/ResourceNotFoundException.java

@@ -0,0 +1,21 @@
+package com.wdkl.pdm.exception;
+
+import org.springframework.http.HttpStatus;
+
+/**
+ * 资源找不到异常
+ *
+ */
+public class ResourceNotFoundException extends ServiceException {
+
+
+    private static final long serialVersionUID = -6945068834935110333L;
+
+
+    public ResourceNotFoundException(String message) {
+
+        super(SystemErrorCodeV1.RESOURCE_NOT_FOUND, message);
+        this.statusCode = HttpStatus.NOT_FOUND;
+
+    }
+}

+ 57 - 0
src/main/java/com/wdkl/pdm/exception/ServiceException.java

@@ -0,0 +1,57 @@
+package com.wdkl.pdm.exception;
+
+import org.springframework.http.HttpStatus;
+
+/**
+ * 服务异常类,各业务异常需要继承此异常
+ * 业务类如有不能处理异常也要抛出此异常
+ *
+ * @author Allen
+ */
+public class ServiceException extends RuntimeException {
+
+    protected HttpStatus statusCode = HttpStatus.INTERNAL_SERVER_ERROR;
+
+    private String code;
+    /**
+     * 要返回前端的数据
+     */
+    private Object data;
+
+    public ServiceException(String message){
+        super(message);
+    }
+
+    public ServiceException(String code, String message) {
+        super(message);
+        this.code = code;
+
+    }
+
+    public ServiceException(String code, String message, Object data) {
+        super(message);
+        this.code = code;
+        this.data = data;
+    }
+
+    public HttpStatus getStatusCode() {
+        return statusCode;
+    }
+
+    public void setStatusCode(HttpStatus statusCode) {
+        this.statusCode = statusCode;
+    }
+
+    public String getCode() {
+        return code;
+    }
+
+
+    public Object getData() {
+        return data;
+    }
+
+    public void setData(Object data) {
+        this.data = data;
+    }
+}

+ 30 - 0
src/main/java/com/wdkl/pdm/exception/SystemErrorCodeV1.java

@@ -0,0 +1,30 @@
+package com.wdkl.pdm.exception;
+
+/**
+ * 系统级别异常码
+ *
+ * @author Allen
+ */
+public class SystemErrorCodeV1 {
+
+    /**
+     * 无权限异常
+     */
+    public final static String NO_PERMISSION = "002";
+    /**
+     * 资源未能找到
+     */
+    public final static String RESOURCE_NOT_FOUND = "003";
+    /**
+     * 错误的请求参数
+     */
+    public final static String INVALID_REQUEST_PARAMETER = "004";
+    /**
+     * 错误的配置参数
+     */
+    public final static String INVALID_CONFIG_PARAMETER = "005";
+    /**
+     * 错误的配置参数
+     */
+    public final static String INVALID_COTENT = "006";
+}

+ 17 - 0
src/main/java/com/wdkl/pdm/exception/ValidateConfig.java

@@ -0,0 +1,17 @@
+package com.wdkl.pdm.exception;
+
+import org.springframework.context.annotation.Bean;
+import org.springframework.context.annotation.Configuration;
+import org.springframework.validation.beanvalidation.MethodValidationPostProcessor;
+
+/**
+ * 初始化相关bean
+ * @author Allen
+ */
+@Configuration
+public class ValidateConfig {
+	@Bean
+	public MethodValidationPostProcessor methodValidationPostProcessor(){
+		return new MethodValidationPostProcessor();
+	}
+}

+ 14 - 0
src/main/java/com/wdkl/pdm/mvc/Filter.java

@@ -0,0 +1,14 @@
+package com.wdkl.pdm.mvc;
+
+/**
+ * 描述
+ *
+ * @author allen
+ * 2019-03-22 17:41
+ */
+public class Filter {
+    public String Field;
+    public String Value;
+    public String Type;
+    public String Comparison;
+}

+ 129 - 0
src/main/java/com/wdkl/pdm/mvc/GridParameter.java

@@ -0,0 +1,129 @@
+package com.wdkl.pdm.mvc;
+
+import java.util.List;
+
+/**
+ * 描述
+ *
+ * @author allen
+ * 2019-03-22 17:27
+ */
+public class GridParameter {
+
+    /**
+     * 开始行数
+     */
+    private int pageNo;
+
+    /**
+     * 页容量
+     */
+    private int pageSize;
+
+    /**
+     * 排序字段
+     */
+    private String sort;
+
+    /**
+     * 排序 DESC / ASC
+     */
+    private String dir;
+
+    /**
+     * select语句,主要拼接表名
+     */
+    private String sqlSelect;
+
+    /**
+     * sql条件
+     */
+    private String sqlWhere;
+
+    /**
+     * sql 固定条件
+     */
+    private String fixedCondition;
+
+    /**
+     * 条件
+     */
+    private List<String> term;
+
+    /**
+     * 查询字符串
+     */
+    private String filerStr;
+
+    public int getPageNo() {
+        return pageNo;
+    }
+
+    public void setPageNo(int pageNo) {
+        this.pageNo = pageNo;
+    }
+
+    public int getPageSize() {
+        return pageSize;
+    }
+
+    public void setPageSize(int pageSize) {
+        this.pageSize = pageSize;
+    }
+
+    public String getSort() {
+        return sort;
+    }
+
+    public void setSort(String sort) {
+        this.sort = sort;
+    }
+
+    public String getDir() {
+        return dir;
+    }
+
+    public void setDir(String dir) {
+        this.dir = dir;
+    }
+
+    public List<String> getTerm() {
+        return term;
+    }
+
+    public void setTerm(List<String> term) {
+        this.term = term;
+    }
+
+    public String getSqlSelect() {
+        return sqlSelect;
+    }
+
+    public void setSqlSelect(String sqlSelect) {
+        this.sqlSelect = sqlSelect;
+    }
+
+    public String getSqlWhere() {
+        return sqlWhere;
+    }
+
+    public void setSqlWhere(String sqlWhere) {
+        this.sqlWhere = sqlWhere;
+    }
+
+    public String getFixedCondition() {
+        return fixedCondition;
+    }
+
+    public void setFixedCondition(String fixedCondition) {
+        this.fixedCondition = fixedCondition;
+    }
+
+    public String getFilerStr() {
+        return filerStr;
+    }
+
+    public void setFilerStr(String filerStr) {
+        this.filerStr = filerStr;
+    }
+}

+ 323 - 0
src/main/java/com/wdkl/pdm/mvc/GridParameterParser.java

@@ -0,0 +1,323 @@
+package com.wdkl.pdm.mvc;
+
+
+import com.alibaba.fastjson.JSON;
+import com.alibaba.fastjson.JSONObject;
+import com.wdkl.pdm.database.annotation.Column;
+import com.wdkl.pdm.database.annotation.Table;
+import com.wdkl.pdm.util.ReflectionUtil;
+import com.wdkl.pdm.util.SqlUtil;
+import com.wdkl.pdm.util.StringUtil;
+import org.assertj.core.util.Strings;
+
+import java.lang.reflect.Field;
+import java.util.*;
+import java.util.stream.Collectors;
+
+/**
+ * 描述
+ *
+ * @author allen
+ * 2019-03-22 17:56
+ */
+public class GridParameterParser {
+    public static GridParameter parse(Class<?> clazz, Map<String, String[]> parameterMap) {
+        GridParameter gp = new GridParameter();
+
+        Map<String, String> formCollection = new HashMap<>();
+        if (null != parameterMap) {
+            for (Map.Entry<String, String[]> mapEntry : parameterMap.entrySet()) {
+                String value = "";
+                String[] values = mapEntry.getValue();
+                if (values.length > 0) {
+                    value = String.join(",", values);
+                    //todo:以下语句出错
+                    //value= StringEscapeUtils.escapeHtml4(value.trim());//将传入的html代码中的尖括号编码,防止xss攻击
+                }
+                formCollection.put(mapEntry.getKey(), value);
+            }
+        }
+
+        if (clazz.getAnnotation(Table.class) != null) {
+            gp.setSqlSelect("select * from " + clazz.getAnnotation(Table.class).name());
+        }
+
+        //start
+        int pageNo = 0;
+        if (formCollection.get("page_no") != null) {
+            pageNo = Integer.parseInt(formCollection.get("page_no"));
+        }
+        gp.setPageNo(pageNo);
+
+        //limit
+        int pageSize = 20;
+        if (formCollection.get("page_size") != null) {
+            pageSize = Integer.parseInt(formCollection.get("page_size"));
+        }
+        gp.setPageSize(pageSize);
+
+        //sort and dir
+        if (formCollection.get("sort") != null && formCollection.get("dir") != null) {
+            gp.setSort(formCollection.get("sort"));
+            gp.setDir(formCollection.get("dir"));
+        } else {
+            //获取主键字段
+            String columnId = ReflectionUtil.getPrimaryKey(clazz);
+
+            gp.setSort(columnId);
+            gp.setDir("ASC");
+        }
+        //其系统本身处理了无排序,以id倒序排序的机制
+
+        List<String> term = new ArrayList<>();
+
+        StringBuffer sb = new StringBuffer(" WHERE 1=1");
+
+        //fixedCondition
+        if (formCollection.get("fixedCondition") != null) {
+            String fixedCondition = formCollection.get("fixedCondition");
+            gp.setFixedCondition("where 1=1 and " + fixedCondition);
+            sb.append(" AND ").append(fixedCondition);
+        }else{
+            gp.setFixedCondition(" ");
+        }
+
+        //解析过滤条件
+        if (formCollection.get("filter") != null) {
+            String filterString = getFilterString(formCollection.get("filter"), clazz,term);
+
+            sb.append(filterString);
+        }
+
+        //动态条件
+        List<Filter> filterList = new ArrayList<Filter>();
+        formCollection.keySet().stream().filter(p -> p.toLowerCase().endsWith("[field]")).forEach(p -> {
+            //过滤对象组装
+            Filter filter = buildFilter(formCollection, p);
+            filterList.add(filter);
+        });
+
+        //拼接sql
+        for (Filter f : filterList) {
+            switch (f.Type) {
+                case "number":
+                case "date":
+                    switch (f.Comparison) {
+                        case "eq":
+                            sb.append(" AND ").append(f.Field).append("=?");
+                            break;
+                        case "gt":
+                            sb.append(" AND ").append(f.Field).append(">?");
+                            break;
+                        case "lt":
+                            sb.append(" AND ").append(f.Field).append("<?");
+                            break;
+                        case "gte":
+                            sb.append(" AND ").append(f.Field).append(">=?");
+                            break;
+                        case "lte":
+                            sb.append(" AND ").append(f.Field).append("<=?");
+                            break;
+                        case "null":
+                            //sb.append(" AND ").append(f.Field).append("=");
+                            break;
+                        case "neq":
+                            sb.append(" AND ").append(f.Field).append("<>?");
+                            break;
+                    }
+                    term.add(f.Value);
+                    break;
+                case "boolean":
+                    sb.append(" AND ").append(f.Field).append("=?");
+                    term.add(f.Value);
+                    break;
+                case "list":
+                    sb.append(" AND ").append(f.Field).append(" in{?}");
+                    term.add(f.Value.replace(",", "','"));
+                    break;
+                case "string":
+                default:
+                    if (f.Comparison.equals("false")) {
+                        sb.append(" AND ").append(f.Field).append(" NOT LIKE ?");
+                        term.add("%" + f.Value + "%");
+                    } else {
+                        sb.append(" AND ").append(f.Field).append(" LIKE ?");
+                        term.add("%" + f.Value + "%");
+                    }
+                    break;
+            }
+        }
+
+        //query
+        if (formCollection.get("query") != null) {
+            sb.append(" AND (0=1 ");
+            String query = formCollection.get("query").toString();
+
+            boolean hasFilterCondition = (filterList.size() > 0);
+            Field[] fields = clazz.getDeclaredFields();
+
+            //过滤掉非模糊查询条件
+            Set<String> fuzzySearchFields = Arrays.stream(fields).filter(p -> {
+                List<String> filterFields = filterList.stream().map(pp -> pp.Field).collect(Collectors.toList());
+                return !filterFields.contains(p.getName());
+            }).filter(p -> {
+                return p.getType().equals(String.class) && p.getAnnotation(Column.class) != null; //只查询字符串
+            }).map(p -> p.getAnnotation(Column.class).name()).collect(Collectors.toSet());    //返回字段的数据库列名
+
+            //            if (formCollection.get("alias") == null) { // 如果没有别名
+            //组装模糊查询
+            for (String filedName : fuzzySearchFields) {
+                sb.append(" OR ").append(filedName).append(" LIKE ?");
+                term.add("%" + query + "%");
+            }
+//            } else { // 有别名
+//                String alias = formCollection.get("alias");
+//                //组装模糊查询
+//                for (String filedName : fuzzySearchFields) {
+//                    sb.append(" OR ").append(alias).append(".").append(filedName).append(" LIKE ?");
+//                    term.add("%" + query + "%");
+//                }
+//            }
+
+
+            sb.append(")");
+        }
+        if (formCollection.get("filerStr") != null) {
+            gp.setFilerStr(formCollection.get("filerStr"));
+        }
+
+        gp.setSqlWhere(sb.toString());
+        gp.setTerm(term);
+
+        return gp;
+    }
+
+
+    /**
+     * 根据前端传递过来的过滤json字符串构建过滤条件
+     *
+     * @param filter
+     * @return
+     */
+    private static String getFilterString(String filter, Class clazz,List<String> term) {
+        StringBuilder sb = new StringBuilder(1024);
+        JSONObject object = JSON.parseObject(filter);
+        Set<String> keys = object.keySet();
+        // 获取类的所有字段
+        List<Field> fields= new ArrayList<>();
+         fields = ReflectionUtil.getParentField(clazz,fields);
+        for (String key : keys) {
+            // 拿到该key值对应的字段
+            Field field = fields.stream().filter(p->p.getAnnotation(Column.class)!=null&& p.getAnnotation(Column.class).name().equals(key)).findFirst().orElse(null);
+            sb.append(" AND ");
+            JSONObject object1 = object.getJSONObject(key);
+            if (object1.containsKey("condition1") && object1.containsKey("condition2")) { //一个字段含两个过滤条件
+                String condition1 = buildCondition(key, object1.getJSONObject("condition1"),field,term);
+                String condition2 = buildCondition(key, object1.getJSONObject("condition2"),field,term);
+                String operater = object1.getString("operator");
+                sb.append("(" + condition1 + " " + operater + " " + condition2 + ")");
+            } else { // 只包含一个过滤条件
+                sb.append("(" + buildCondition(key, object1,field,term) + ")");
+            }
+
+        }
+        return sb.toString();
+    }
+
+    private static String buildCondition(String key, JSONObject condition, Field field,List<String> term) {
+        String value = condition.getString("filter");
+
+
+        if (condition.getString("filterType").equals("number")) {
+            switch (condition.getString("type")) {
+                case "equals":
+                    return key + "=" + value;
+                case "notEqual":
+                    return key + "<>" + value;
+                case "lessThan":
+                    return key + "<" + value;
+                case "lessThanOrEqual":
+                    return key + "<=" + value;
+                case "greaterThan":
+                    return key + ">" + value;
+                case "greaterThanOrEqual":
+                    return key + ">=" + value;
+                case "inRange":
+                    return key + ">" + value + " AND " + key + "<" + condition.getString("filterTo");
+            }
+        } else if (condition.getString("filterType").equals("text")) {
+
+            switch (condition.getString("type")) {
+                case "contains":
+                    return key + " like '%" + value + "%'";
+                case "notContains":
+                    return key + " not like '%" + value + "%'";
+                case "equals":
+                    return key + "='" + value + "'";
+                case "notEqual":
+                    return key + "<>'" + value + "'";
+                case "startsWith":
+                    return key + " like '" + value + "%'";
+                case "endsWith":
+                    return key + " like '%" + value + "'";
+            }
+
+        } else if (condition.getString("filterType").equals("date")) {
+            String dateFrom = condition.getString("dateFrom");
+            String dateTo = condition.getString("dateTo");
+
+            switch (condition.getString("type")) {
+                case "inRange":
+                    return "FROM_UNIXTIME(" + key + ",'%Y-%m-%d 00:00:00') >'" + dateFrom + "' AND FROM_UNIXTIME(" + key + ",'%Y-%m-%d 00:00:00') <'" + dateTo + "'";
+                case "equals":
+                    return "FROM_UNIXTIME(" + key + ",'%Y-%m-%d 00:00:00') ='" + dateFrom + "'";
+                case "notEqual":
+                    return "FROM_UNIXTIME(" + key + ",'%Y-%m-%d 00:00:00') <>'" + dateFrom + "'";
+                case "lessThan":
+                    return "FROM_UNIXTIME(" + key + ",'%Y-%m-%d 00:00:00') <'" + dateFrom + "'";
+                case "greaterThan":
+                    return "FROM_UNIXTIME(" + key + ",'%Y-%m-%d 00:00:00') >'" + dateFrom + "'";
+            }
+        } else if (condition.getString("filterType").equals("list")) { //列表类型查找
+
+            switch (condition.getString("type")) {
+                case "in":
+                     String[] terms= value.split(",");
+                    String[] temp = new String[terms.length];
+                    for (int i = 0; i < terms.length; i++) {
+                        temp[i] = "?";
+                        term.add(terms[i]);
+                    }
+
+                    return key + " in ("+StringUtil.arrayToString(temp, ",")+")";
+                case "equals":
+                    term.add(value);
+                    return key + " = ? ";
+                case "contains":
+                    StringBuilder sbtemp= new StringBuilder();
+                    String[] vs = value.split(",");
+                    sbtemp.append(" (");
+                    for (String v : vs) {
+                        term.add(v);
+                        sbtemp.append(" FIND_IN_SET(?,"+key+") or ");
+                    }
+                    sbtemp.delete(sbtemp.length()-3,sbtemp.length());
+                    sbtemp.append(" )");
+
+                    return sbtemp.toString();
+            }
+        }
+        return "";
+    }
+
+
+    private static Filter buildFilter(Map formCollection, Object p) {
+        String filterPre = p.toString().substring(0, p.toString().length() - 7);
+        Filter filter = new Filter();
+        filter.Field = formCollection.get(p).toString();
+        filter.Value = formCollection.get(filterPre + "[data][value]").toString();
+        filter.Type = formCollection.get(filterPre + "[data][type]").toString();
+        filter.Comparison = formCollection.get(filterPre + "[data][comparison]").toString();
+        return filter;
+    }
+}

+ 56 - 0
src/main/java/com/wdkl/pdm/mvc/JsonResponse.java

@@ -0,0 +1,56 @@
+package com.wdkl.pdm.mvc;
+
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+
+import java.io.Serializable;
+
+/**
+ * 描述
+ *
+ * @author allen
+ * 2019-03-29 15:34
+ */
+@ApiModel("接口操作结果返回对象")
+public class JsonResponse implements Serializable {
+    //成功失败标识
+    @ApiModelProperty("操作结果成功与否标识")
+    public boolean success;
+    //一般用于失败时的错误提示
+    @ApiModelProperty("操作结果消息提示")
+    public String message;
+    //返回的对象
+    @ApiModelProperty("操作结果返回对象")
+    public Object data;
+
+    public JsonResponse() {
+    }
+
+    public static JsonResponse successResponse() {
+        JsonResponse response = new JsonResponse();
+        response.success = true;
+        return response;
+    }
+
+    public static JsonResponse successResponse(Object data) {
+        JsonResponse response = new JsonResponse();
+        response.success = true;
+        response.data = data;
+        return response;
+    }
+
+    public static JsonResponse successResponse(String message, Object data) {
+        JsonResponse response = new JsonResponse();
+        response.success = true;
+        response.message = message;
+        response.data = data;
+        return response;
+    }
+
+    public static JsonResponse errorResponse(String message) {
+        JsonResponse response = new JsonResponse();
+        response.success = false;
+        response.message = message;
+        return response;
+    }
+}

+ 62 - 0
src/main/java/com/wdkl/pdm/security/AccessDeniedFormatConfig.java

@@ -0,0 +1,62 @@
+package com.wdkl.pdm.security;
+
+import org.springframework.context.annotation.Bean;
+import org.springframework.context.annotation.Configuration;
+import org.springframework.security.access.AccessDeniedException;
+import org.springframework.security.core.AuthenticationException;
+import org.springframework.security.web.AuthenticationEntryPoint;
+import org.springframework.security.web.access.AccessDeniedHandler;
+
+import javax.servlet.ServletException;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import java.io.IOException;
+
+/**
+ * 验权失败的异常格式定义
+ * Created by Allen
+ */
+
+@Configuration
+public class AccessDeniedFormatConfig {
+
+
+
+    /**
+     * 定义认证失败的格式
+     * @return
+     */
+    @Bean
+   public AccessDeniedHandler accessDeniedHandler(){
+        return new AccessDeniedHandler(){
+
+            @Override
+            public void handle(HttpServletRequest httpServletRequest, HttpServletResponse httpServletResponse, AccessDeniedException e) throws IOException, ServletException {
+                httpServletResponse.setStatus(403);
+                httpServletResponse.setHeader("Content-Type", "application/json;charset=utf-8");
+                httpServletResponse.getWriter().print("{\"code\":\"403\",\"message\":\"登录状态已失效\"}");
+                httpServletResponse.getWriter().flush();
+            }
+        };
+    }
+
+    /**
+     * 定义认证失败的格式
+     * @return
+     */
+
+    @Bean
+    AuthenticationEntryPoint authenticationEntryPoint() {
+        return new AuthenticationEntryPoint() {
+            @Override
+            public void commence(HttpServletRequest request, HttpServletResponse httpServletResponse, AuthenticationException authException)
+                    throws IOException, ServletException {
+                httpServletResponse.setStatus(403);
+                httpServletResponse.setHeader("Content-Type", "application/json;charset=utf-8");
+                httpServletResponse.getWriter().print("{\"code\":\"403\",\"message\":\"登录状态已失效\"}");
+                httpServletResponse.getWriter().flush();
+            }
+        };
+    }
+
+}

+ 72 - 0
src/main/java/com/wdkl/pdm/security/PathFilter.java

@@ -0,0 +1,72 @@
+package com.wdkl.pdm.security;
+
+import org.springframework.util.LinkedCaseInsensitiveMap;
+import org.springframework.web.filter.OncePerRequestFilter;
+
+import javax.servlet.FilterChain;
+import javax.servlet.ServletException;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletRequestWrapper;
+import javax.servlet.http.HttpServletResponse;
+import java.io.IOException;
+import java.util.Collections;
+import java.util.Enumeration;
+import java.util.Map;
+
+/**
+ * @author wuyunfeng
+ * 2020-11-28 10:41
+ * 替换非法请求路径,当路径含//时 spring security 会报 The request was rejected because the URL was not normalized 异常,导致请求出现500错误
+ * 此处只处理双斜杠路径错误
+ * 使用此filter时,设置order -1000,把该过滤器放置到最前面执行
+ */
+public class PathFilter extends OncePerRequestFilter {
+
+    @Override
+    protected void doFilterInternal(HttpServletRequest request, HttpServletResponse response, FilterChain filterChain) throws ServletException, IOException {
+
+        String uri = request.getRequestURI();
+        String newUri = uri.replace("//", "/");
+        if (uri.contains("//")) {
+            logger.info("请求路径:" + uri + "\n已替换为:" + newUri);
+            final LinkedCaseInsensitiveMap<String[]> map = new LinkedCaseInsensitiveMap<>();
+            map.putAll(request.getParameterMap());
+
+            request = new HttpServletRequestWrapper(request) {
+                @Override
+                public String getRequestURI() {
+                    return newUri;
+                }
+
+                @Override
+                public String getParameter(String name) {
+
+                    String[] array = map.get(name);
+                    if (array != null && array.length > 0)
+                        return array[0];
+                    return null;
+                }
+
+                @Override
+                public Map getParameterMap() {
+                    return Collections.unmodifiableMap(map);
+                }
+
+                @Override
+                public Enumeration getParameterNames() {
+                    return Collections.enumeration(map.keySet());
+                }
+
+                @Override
+                public String[] getParameterValues(String name) {
+                    return map.get(name);
+                }
+
+            };
+        }
+        filterChain.doFilter(request, response);
+
+    }
+
+//
+}

+ 328 - 0
src/main/java/com/wdkl/pdm/security/RSAUtils.java

@@ -0,0 +1,328 @@
+package com.wdkl.pdm.security;
+
+/**
+ * <p>
+ * RSA公钥/私钥/签名工具包
+ * </p>
+ * <p>
+ * 罗纳德·李维斯特(Ron [R]ivest)、阿迪·萨莫尔(Adi [S]hamir)和伦纳德·阿德曼(Leonard [A]dleman)
+ * </p>
+ * <p>
+ * 字符串格式的密钥在未在特殊说明情况下都为BASE64编码格式<br/>
+ * 由于非对称加密速度极其缓慢,一般文件不使用它来加密而是使用对称加密,<br/>
+ * 非对称加密算法可以用来对对称加密的密钥加密,这样保证密钥的安全也就保证了数据的安全
+ * </p>
+ *
+ * @author allen
+ * 2019-07-08 15:01
+ */
+
+import javax.crypto.Cipher;
+import java.io.ByteArrayOutputStream;
+import java.security.*;
+import java.security.interfaces.RSAPrivateKey;
+import java.security.interfaces.RSAPublicKey;
+import java.security.spec.PKCS8EncodedKeySpec;
+import java.security.spec.X509EncodedKeySpec;
+import java.util.HashMap;
+import java.util.Map;
+
+public class RSAUtils {
+
+    /**
+     * 加密算法RSA
+     */
+    public static final String KEY_ALGORITHM = "RSA";
+
+    /**
+     * 签名算法
+     */
+    public static final String SIGNATURE_ALGORITHM = "MD5withRSA";
+
+    /**
+     * 获取公钥的key
+     */
+    private static final String PUBLIC_KEY = "RSAPublicKey";
+
+    /**
+     * 获取私钥的key
+     */
+    private static final String PRIVATE_KEY = "RSAPrivateKey";
+
+    /**
+     * RSA最大加密明文大小
+     */
+    private static final int MAX_ENCRYPT_BLOCK = 117;
+
+    /**
+     * RSA最大解密密文大小
+     */
+    private static final int MAX_DECRYPT_BLOCK = 128;
+
+    /**
+     * <p>
+     * 生成密钥对(公钥和私钥)
+     * </p>
+     *
+     * @return
+     * @throws Exception
+     */
+    public static Map<String, Object> genKeyPair() throws Exception {
+        KeyPairGenerator keyPairGen = KeyPairGenerator.getInstance(KEY_ALGORITHM);
+        keyPairGen.initialize(1024);
+        KeyPair keyPair = keyPairGen.generateKeyPair();
+        RSAPublicKey publicKey = (RSAPublicKey) keyPair.getPublic();
+        RSAPrivateKey privateKey = (RSAPrivateKey) keyPair.getPrivate();
+        Map<String, Object> keyMap = new HashMap<String, Object>(2);
+        keyMap.put(PUBLIC_KEY, publicKey);
+        keyMap.put(PRIVATE_KEY, privateKey);
+        return keyMap;
+    }
+
+    /**
+     * <p>
+     * 用私钥对信息生成数字签名
+     * </p>
+     *
+     * @param data 已加密数据
+     * @param privateKey 私钥(BASE64编码)
+     *
+     * @return
+     * @throws Exception
+     */
+    public static String sign(byte[] data, String privateKey) throws Exception {
+
+        byte[] keyBytes = SecretDESUtil.hexStr2ByteArr(privateKey);
+        PKCS8EncodedKeySpec pkcs8KeySpec = new PKCS8EncodedKeySpec(keyBytes);
+        KeyFactory keyFactory = KeyFactory.getInstance(KEY_ALGORITHM);
+        PrivateKey privateK = keyFactory.generatePrivate(pkcs8KeySpec);
+        Signature signature = Signature.getInstance(SIGNATURE_ALGORITHM);
+        signature.initSign(privateK);
+        signature.update(data);
+        return SecretDESUtil.byteArr2HexStr(signature.sign());
+    }
+
+    /**
+     * <p>
+     * 校验数字签名
+     * </p>
+     *
+     * @param signedDataBytes 已加密数据(SecretDESUtil.hexStr2ByteArr)
+     * @param publicKey 公钥(SecretDESUtil.hexStr2ByteArr)
+     * @param sign 数字签名
+     *
+     * @return
+     * @throws Exception
+     *
+     */
+    public static boolean verifySign(byte[] signedDataBytes, String publicKey, String sign) {
+        try {
+            byte[] keyBytes = SecretDESUtil.hexStr2ByteArr(publicKey);
+            X509EncodedKeySpec keySpec = new X509EncodedKeySpec(keyBytes);
+            KeyFactory keyFactory = KeyFactory.getInstance(KEY_ALGORITHM);
+            PublicKey publicK = keyFactory.generatePublic(keySpec);
+            Signature signature = Signature.getInstance(SIGNATURE_ALGORITHM);
+            signature.initVerify(publicK);
+            signature.update(signedDataBytes);
+            return signature.verify(SecretDESUtil.hexStr2ByteArr(sign));
+        } catch (Exception ex){
+            return false;
+        }
+    }
+
+    public static boolean verifySign(String publicKey, String sign, String signedString){
+        try {
+            return verifySign(SecretDESUtil.hexStr2ByteArr(signedString), publicKey, sign);
+        }catch (Exception ex){
+            return false;
+        }
+    }
+
+    /**
+     * <P>
+     * 私钥解密
+     * </p>
+     *
+     * @param encryptedData 已加密数据
+     * @param privateKey 私钥(BASE64编码)
+     * @return
+     * @throws Exception
+     */
+    public static byte[] decryptByPrivateKey(byte[] encryptedData, String privateKey)
+            throws Exception {
+        byte[] keyBytes = SecretDESUtil.hexStr2ByteArr(privateKey);
+        PKCS8EncodedKeySpec pkcs8KeySpec = new PKCS8EncodedKeySpec(keyBytes);
+        KeyFactory keyFactory = KeyFactory.getInstance(KEY_ALGORITHM);
+        Key privateK = keyFactory.generatePrivate(pkcs8KeySpec);
+        Cipher cipher = Cipher.getInstance(keyFactory.getAlgorithm());
+        cipher.init(Cipher.DECRYPT_MODE, privateK);
+        int inputLen = encryptedData.length;
+        ByteArrayOutputStream out = new ByteArrayOutputStream();
+        int offSet = 0;
+        byte[] cache;
+        int i = 0;
+        // 对数据分段解密
+        while (inputLen - offSet > 0) {
+            if (inputLen - offSet > MAX_DECRYPT_BLOCK) {
+                cache = cipher.doFinal(encryptedData, offSet, MAX_DECRYPT_BLOCK);
+            } else {
+                cache = cipher.doFinal(encryptedData, offSet, inputLen - offSet);
+            }
+            out.write(cache, 0, cache.length);
+            i++;
+            offSet = i * MAX_DECRYPT_BLOCK;
+        }
+        byte[] decryptedData = out.toByteArray();
+        out.close();
+        return decryptedData;
+    }
+
+    /**
+     * <p>
+     * 公钥解密
+     * </p>
+     *
+     * @param encryptedData 已加密数据
+     * @param publicKey 公钥(BASE64编码)
+     * @return
+     * @throws Exception
+     */
+    public static byte[] decryptByPublicKey(byte[] encryptedData, String publicKey)
+            throws Exception {
+        byte[] keyBytes = SecretDESUtil.hexStr2ByteArr(publicKey);
+        X509EncodedKeySpec x509KeySpec = new X509EncodedKeySpec(keyBytes);
+        KeyFactory keyFactory = KeyFactory.getInstance(KEY_ALGORITHM);
+        Key publicK = keyFactory.generatePublic(x509KeySpec);
+        Cipher cipher = Cipher.getInstance(keyFactory.getAlgorithm());
+        cipher.init(Cipher.DECRYPT_MODE, publicK);
+        int inputLen = encryptedData.length;
+        ByteArrayOutputStream out = new ByteArrayOutputStream();
+        int offSet = 0;
+        byte[] cache;
+        int i = 0;
+        // 对数据分段解密
+        while (inputLen - offSet > 0) {
+            if (inputLen - offSet > MAX_DECRYPT_BLOCK) {
+                cache = cipher.doFinal(encryptedData, offSet, MAX_DECRYPT_BLOCK);
+            } else {
+                cache = cipher.doFinal(encryptedData, offSet, inputLen - offSet);
+            }
+            out.write(cache, 0, cache.length);
+            i++;
+            offSet = i * MAX_DECRYPT_BLOCK;
+        }
+        byte[] decryptedData = out.toByteArray();
+        out.close();
+        return decryptedData;
+    }
+
+    /**
+     * <p>
+     * 公钥加密
+     * </p>
+     *
+     * @param data 源数据
+     * @param publicKey 公钥(BASE64编码)
+     * @return
+     * @throws Exception
+     */
+    public static byte[] encryptByPublicKey(byte[] data, String publicKey)
+            throws Exception {
+        byte[] keyBytes = SecretDESUtil.hexStr2ByteArr(publicKey);
+        X509EncodedKeySpec x509KeySpec = new X509EncodedKeySpec(keyBytes);
+        KeyFactory keyFactory = KeyFactory.getInstance(KEY_ALGORITHM);
+        Key publicK = keyFactory.generatePublic(x509KeySpec);
+        // 对数据加密
+        Cipher cipher = Cipher.getInstance(keyFactory.getAlgorithm());
+        cipher.init(Cipher.ENCRYPT_MODE, publicK);
+        int inputLen = data.length;
+        ByteArrayOutputStream out = new ByteArrayOutputStream();
+        int offSet = 0;
+        byte[] cache;
+        int i = 0;
+        // 对数据分段加密
+        while (inputLen - offSet > 0) {
+            if (inputLen - offSet > MAX_ENCRYPT_BLOCK) {
+                cache = cipher.doFinal(data, offSet, MAX_ENCRYPT_BLOCK);
+            } else {
+                cache = cipher.doFinal(data, offSet, inputLen - offSet);
+            }
+            out.write(cache, 0, cache.length);
+            i++;
+            offSet = i * MAX_ENCRYPT_BLOCK;
+        }
+        byte[] encryptedData = out.toByteArray();
+        out.close();
+        return encryptedData;
+    }
+
+    /**
+     * <p>
+     * 私钥加密
+     * </p>
+     *
+     * @param data 源数据
+     * @param privateKey 私钥(BASE64编码)
+     * @return
+     * @throws Exception
+     */
+    public static byte[] encryptByPrivateKey(byte[] data, String privateKey)
+            throws Exception {
+        byte[] keyBytes = SecretDESUtil.hexStr2ByteArr(privateKey);
+        PKCS8EncodedKeySpec pkcs8KeySpec = new PKCS8EncodedKeySpec(keyBytes);
+        KeyFactory keyFactory = KeyFactory.getInstance(KEY_ALGORITHM);
+        Key privateK = keyFactory.generatePrivate(pkcs8KeySpec);
+        Cipher cipher = Cipher.getInstance(keyFactory.getAlgorithm());
+        cipher.init(Cipher.ENCRYPT_MODE, privateK);
+        int inputLen = data.length;
+        ByteArrayOutputStream out = new ByteArrayOutputStream();
+        int offSet = 0;
+        byte[] cache;
+        int i = 0;
+        // 对数据分段加密
+        while (inputLen - offSet > 0) {
+            if (inputLen - offSet > MAX_ENCRYPT_BLOCK) {
+                cache = cipher.doFinal(data, offSet, MAX_ENCRYPT_BLOCK);
+            } else {
+                cache = cipher.doFinal(data, offSet, inputLen - offSet);
+            }
+            out.write(cache, 0, cache.length);
+            i++;
+            offSet = i * MAX_ENCRYPT_BLOCK;
+        }
+        byte[] encryptedData = out.toByteArray();
+        out.close();
+        return encryptedData;
+    }
+
+    /**
+     * <p>
+     * 获取私钥
+     * </p>
+     *
+     * @param keyMap 密钥对
+     * @return
+     * @throws Exception
+     */
+    public static String getPrivateKey(Map<String, Object> keyMap)
+            throws Exception {
+        Key key = (Key) keyMap.get(PRIVATE_KEY);
+        return SecretDESUtil.byteArr2HexStr(key.getEncoded());
+    }
+
+    /**
+     * <p>
+     * 获取公钥
+     * </p>
+     *
+     * @param keyMap 密钥对
+     * @return
+     * @throws Exception
+     */
+    public static String getPublicKey(Map<String, Object> keyMap)
+            throws Exception {
+        Key key = (Key) keyMap.get(PUBLIC_KEY);
+        return SecretDESUtil.byteArr2HexStr(key.getEncoded());
+    }
+
+}

+ 0 - 0
src/main/java/com/wdkl/pdm/security/SecretDESUtil.java


Einige Dateien werden nicht angezeigt, da zu viele Dateien in diesem Diff geändert wurden.