Kaynağa Gözat

项目初始化

lwhhszx 2 yıl önce
ebeveyn
işleme
9f5b73d741
31 değiştirilmiş dosya ile 3186 ekleme ve 129 silme
  1. 33 0
      .gitignore
  2. 8 1
      .idea/misc.xml
  3. 1 1
      .idea/modules.xml
  4. 67 127
      .idea/pom.xml
  5. BIN
      .mvn/wrapper/maven-wrapper.jar
  6. 2 0
      .mvn/wrapper/maven-wrapper.properties
  7. 316 0
      mvnw
  8. 188 0
      mvnw.cmd
  9. 156 0
      pom.xml
  10. 13 0
      src/main/java/com/example/demo/DemoApplication.java
  11. 54 0
      src/main/java/com/example/demo/base/Constants.java
  12. 92 0
      src/main/java/com/example/demo/controller/AssoTaskPersonelController.java
  13. 40 0
      src/main/java/com/example/demo/controller/QuartzController.java
  14. 107 0
      src/main/java/com/example/demo/domain/PatentCell.java
  15. 38 0
      src/main/java/com/example/demo/domain/QrtzTask.java
  16. 12 0
      src/main/java/com/example/demo/domain/UploadFileDTO.java
  17. 17 0
      src/main/java/com/example/demo/mapper/QrtzTaskMapper.java
  18. 11 0
      src/main/java/com/example/demo/model/dto/QuartzTaskDTO.java
  19. 27 0
      src/main/java/com/example/demo/model/dto/TaskParams.java
  20. 24 0
      src/main/java/com/example/demo/service/DongAoJob.java
  21. 101 0
      src/main/java/com/example/demo/service/JobService.java
  22. 56 0
      src/main/java/com/example/demo/service/OutInterfaceService.java
  23. 32 0
      src/main/java/com/example/demo/service/QrTaskService.java
  24. 362 0
      src/main/java/com/example/demo/service/UploadFromWebService.java
  25. 662 0
      src/main/java/com/example/demo/util/DateUtils.java
  26. 252 0
      src/main/java/com/example/demo/util/FileUtils.java
  27. 313 0
      src/main/java/com/example/demo/util/JsonUtils.java
  28. 102 0
      src/main/java/com/example/demo/util/Response.java
  29. 50 0
      src/main/java/com/example/demo/util/ResponseEnum.java
  30. 50 0
      src/main/resources/application.yml
  31. BIN
      src/main/resources/chromedriver.exe

+ 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/

+ 8 - 1
.idea/misc.xml

@@ -1,6 +1,13 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <project version="4">
-  <component name="ProjectRootManager">
+  <component name="MavenProjectsManager">
+    <option name="originalFiles">
+      <list>
+        <option value="$PROJECT_DIR$/pom.xml" />
+      </list>
+    </option>
+  </component>
+  <component name="ProjectRootManager" version="2" project-jdk-name="18" project-jdk-type="JavaSDK">
     <output url="file://$PROJECT_DIR$/out" />
   </component>
 </project>

+ 1 - 1
.idea/modules.xml

@@ -2,7 +2,7 @@
 <project version="4">
   <component name="ProjectModuleManager">
     <modules>
-      <module fileurl="file://$PROJECT_DIR$/.idea/QMS.iml" filepath="$PROJECT_DIR$/.idea/QMS.iml" />
+      <module fileurl="file://$PROJECT_DIR$/demo.iml" filepath="$PROJECT_DIR$/demo.iml" />
     </modules>
   </component>
 </project>

+ 67 - 127
.idea/pom.xml

@@ -1,21 +1,21 @@
-<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://maven.apache.org/POM/4.0.0"
-         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
-
+<?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.5.9</version>
+        <relativePath/> <!-- lookup parent from repository -->
     </parent>
-
-    <modelVersion>4.0.0</modelVersion>
-    <groupId>cn.cslg</groupId>
-    <artifactId>pas</artifactId>
+    <groupId>com.example</groupId>
+    <artifactId>demo</artifactId>
     <version>0.0.1-SNAPSHOT</version>
-    <packaging>jar</packaging>
-    <name>pas</name>
-    <description>常熟理工学院 专利分析系统</description>
-
+    <name>demo</name>
+    <description>Demo project for Spring Boot</description>
     <properties>
+        <java.version>17</java.version>
+            <springdoc.version>1.6.6</springdoc.version>
         <java.version>1.8</java.version>
         <jwt.version>0.9.0</jwt.version>
         <commons.io.version>2.5</commons.io.version>
@@ -30,84 +30,63 @@
         <sa-token.version>1.29.0</sa-token.version>
         <springdoc.version>1.6.6</springdoc.version>
     </properties>
-
     <dependencies>
         <dependency>
-            <groupId>org.springdoc</groupId>
-            <artifactId>springdoc-openapi-ui</artifactId>
-            <version>${springdoc.version}</version>
-        </dependency>
-        <dependency>
             <groupId>org.springframework.boot</groupId>
-            <artifactId>spring-boot-starter-aop</artifactId>
+            <artifactId>spring-boot-starter-web</artifactId>
         </dependency>
+
         <dependency>
-            <groupId>com.deepoove</groupId>
-            <artifactId>poi-tl</artifactId>
-            <version>${poi-tl.version}</version>
+            <groupId>org.seleniumhq.selenium</groupId>
+            <artifactId>selenium-java</artifactId>
+            <version>2.49.1</version>
         </dependency>
         <dependency>
-            <groupId>cn.dev33</groupId>
-            <artifactId>sa-token-spring-boot-starter</artifactId>
-            <version>${sa-token.version}</version>
+            <groupId>com.google.guava</groupId>
+            <artifactId>guava</artifactId>
+            <version>31.1-jre</version>
         </dependency>
         <dependency>
-            <groupId>cn.dev33</groupId>
-            <artifactId>sa-token-dao-redis-jackson</artifactId>
-            <version>${sa-token.version}</version>
+            <groupId>org.springdoc</groupId>
+            <artifactId>springdoc-openapi-ui</artifactId>
+            <version>${springdoc.version}</version>
         </dependency>
         <dependency>
-            <groupId>com.alibaba</groupId>
-            <artifactId>druid-spring-boot-starter</artifactId>
-            <version>${druid.version}</version>
+            <groupId>org.projectlombok</groupId>
+            <artifactId>lombok</artifactId>
+            <optional>true</optional>
         </dependency>
+
         <dependency>
-            <groupId>com.alibaba</groupId>
-            <artifactId>fastjson</artifactId>
-            <version>${fastjson.version}</version>
+            <groupId>commons-fileupload</groupId>
+            <artifactId>commons-fileupload</artifactId>
+            <version>1.3.3</version>
         </dependency>
         <dependency>
             <groupId>org.apache.commons</groupId>
-            <artifactId>commons-compress</artifactId>
-            <version>1.21</version>
-        </dependency>
-        <dependency>
-            <groupId>commons-io</groupId>
-            <artifactId>commons-io</artifactId>
-            <version>2.6</version>
-        </dependency>
-        <dependency>
-            <groupId>io.jsonwebtoken</groupId>
-            <artifactId>jjwt</artifactId>
-            <version>${jwt.version}</version>
-        </dependency>
-        <dependency>
-            <groupId>com.ejlchina</groupId>
-            <artifactId>okhttps</artifactId>
-            <version>${okhttps.version}</version>
-        </dependency>
-        <dependency>
-            <groupId>org.springframework.boot</groupId>
-            <artifactId>spring-boot-starter-thymeleaf</artifactId>
+            <artifactId>commons-pool2</artifactId>
         </dependency>
+
         <dependency>
             <groupId>cn.hutool</groupId>
             <artifactId>hutool-all</artifactId>
             <version>${hutool.version}</version>
         </dependency>
         <dependency>
-            <groupId>com.google.code.gson</groupId>
-            <artifactId>gson</artifactId>
-<!--            <version>${google.code.gson.version}</version>-->
+            <groupId>org.springframework.boot</groupId>
+            <artifactId>spring-boot-starter-websocket</artifactId>
         </dependency>
+
+
+
         <dependency>
-            <groupId>com.baomidou</groupId>
-            <artifactId>mybatis-plus-boot-starter</artifactId>
-            <version>${mybatisplus.version}</version>
+            <groupId>org.springframework.boot</groupId>
+            <artifactId>spring-boot-starter</artifactId>
         </dependency>
         <dependency>
             <groupId>org.springframework.boot</groupId>
-            <artifactId>spring-boot-starter-data-redis</artifactId>
+            <artifactId>spring-boot-starter-test</artifactId>
+            <scope>test</scope>
         </dependency>
         <dependency>
             <groupId>org.springframework.boot</groupId>
@@ -115,11 +94,7 @@
         </dependency>
         <dependency>
             <groupId>org.springframework.boot</groupId>
-            <artifactId>spring-boot-starter-websocket</artifactId>
-        </dependency>
-        <dependency>
-            <groupId>org.apache.commons</groupId>
-            <artifactId>commons-pool2</artifactId>
+            <artifactId>spring-boot-starter-quartz</artifactId>
         </dependency>
         <dependency>
             <groupId>mysql</groupId>
@@ -127,90 +102,55 @@
             <scope>runtime</scope>
         </dependency>
         <dependency>
-            <groupId>org.projectlombok</groupId>
-            <artifactId>lombok</artifactId>
-            <optional>true</optional>
+            <groupId>com.mchange</groupId>
+            <artifactId>c3p0</artifactId>
+            <version>0.9.5.2</version>
         </dependency>
+        <!--&lt;!&ndash; druid数据库连接池 &ndash;&gt;-->
         <dependency>
-            <groupId>junit</groupId>
-            <artifactId>junit</artifactId>
+            <groupId>com.alibaba</groupId>
+            <artifactId>druid-spring-boot-starter</artifactId>
+            <version>1.1.10</version>
         </dependency>
-<!--        <dependency>-->
-<!--            <groupId>org.openjdk.nashorn</groupId>-->
-<!--            <artifactId>nashorn-core</artifactId>-->
-<!--            <version>15.3</version>-->
-<!--        </dependency>-->
-<!--      jdk17后需要此依赖-->
 
         <dependency>
-            <groupId>org.apache.poi</groupId>
-            <artifactId>poi</artifactId>
-            <version>${poi.version}</version>
-        </dependency>
-        <dependency>
-            <groupId>org.apache.poi</groupId>
-            <artifactId>poi-ooxml</artifactId>
-            <version>${poi.version}</version>
+            <groupId>com.baomidou</groupId>
+            <artifactId>mybatis-plus-boot-starter</artifactId>
+            <version>${mybatisplus.version}</version>
         </dependency>
         <dependency>
-            <groupId>org.apache.poi</groupId>
-            <artifactId>poi-scratchpad</artifactId>
-            <version>${poi.version}</version>
+            <groupId>com.squareup.okhttp3</groupId>
+            <artifactId>okhttp</artifactId>
+            <version>3.9.1</version>
         </dependency>
         <dependency>
-            <groupId>commons-fileupload</groupId>
-            <artifactId>commons-fileupload</artifactId>
-            <version>1.3.3</version>
+            <groupId>com.google.code.gson</groupId>
+            <artifactId>gson</artifactId>
+            <version>${google.code.gson.version}</version>
         </dependency>
         <dependency>
-            <groupId>org.springframework.boot</groupId>
-            <artifactId>spring-boot-starter-test</artifactId>
-            <scope>test</scope>
+            <groupId>com.alibaba</groupId>
+            <artifactId>fastjson</artifactId>
+            <version>${fastjson.version}</version>
         </dependency>
     </dependencies>
 
     <build>
-        <finalName>PAS_PROD2.0</finalName>
         <plugins>
             <plugin>
                 <groupId>org.springframework.boot</groupId>
                 <artifactId>spring-boot-maven-plugin</artifactId>
+            </plugin>
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-compiler-plugin</artifactId>
                 <configuration>
-                    <includeSystemScope>true</includeSystemScope>
-                    <!-- 指定该Main Class为全局的唯一入口 -->
-                    <mainClass>cn.cslg.pas.Application</mainClass>
-                    <layout>ZIP</layout>
-                    <excludes>
-                        <exclude>
-                            <groupId>org.projectlombok</groupId>
-                            <artifactId>lombok</artifactId>
-                        </exclude>
-                    </excludes>
+                    <source>16</source>
+                    <target>16</target>
                 </configuration>
-                <executions>
-                    <execution>
-                        <goals>
-                            <goal>repackage</goal><!--可以把依赖的包都打包到生成的Jar包中-->
-                        </goals>
-                    </execution>
-                </executions>
             </plugin>
         </plugins>
     </build>
 
-    <!--阿里云镜像源(因需要提交到GithubActions,会引起依赖下载过慢的问题)-->
-    <repositories>
-        <repository>
-            <id>nexus-aliyun</id>
-            <name>nexus-aliyun</name>
-            <url>http://maven.aliyun.com/nexus/content/groups/public/</url>
-            <releases>
-                <enabled>true</enabled>
-            </releases>
-            <snapshots>
-                <enabled>false</enabled>
-            </snapshots>
-        </repository>
-    </repositories>
 
-</project>
+</project>

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.6/apache-maven-3.8.6-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%

+ 156 - 0
pom.xml

@@ -0,0 +1,156 @@
+<?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.5.9</version>
+        <relativePath/> <!-- lookup parent from repository -->
+    </parent>
+    <groupId>com.example</groupId>
+    <artifactId>demo</artifactId>
+    <version>0.0.1-SNAPSHOT</version>
+    <name>demo</name>
+    <description>Demo project for Spring Boot</description>
+    <properties>
+        <java.version>17</java.version>
+            <springdoc.version>1.6.6</springdoc.version>
+        <java.version>1.8</java.version>
+        <jwt.version>0.9.0</jwt.version>
+        <commons.io.version>2.5</commons.io.version>
+        <mybatisplus.version>3.4.3.4</mybatisplus.version>
+        <google.code.gson.version>2.7</google.code.gson.version>
+        <hutool.version>5.6.5</hutool.version>
+        <okhttps.version>3.1.1</okhttps.version>
+        <poi.version>4.1.2</poi.version>
+        <poi-tl.version>1.10.3</poi-tl.version>
+        <druid.version>1.1.10</druid.version>
+        <fastjson.version>2.0.12</fastjson.version>
+        <sa-token.version>1.29.0</sa-token.version>
+        <springdoc.version>1.6.6</springdoc.version>
+    </properties>
+    <dependencies>
+        <dependency>
+            <groupId>org.springframework.boot</groupId>
+            <artifactId>spring-boot-starter-web</artifactId>
+        </dependency>
+
+        <dependency>
+            <groupId>org.seleniumhq.selenium</groupId>
+            <artifactId>selenium-java</artifactId>
+            <version>2.49.1</version>
+        </dependency>
+        <dependency>
+            <groupId>com.google.guava</groupId>
+            <artifactId>guava</artifactId>
+            <version>31.1-jre</version>
+        </dependency>
+        <dependency>
+            <groupId>org.springdoc</groupId>
+            <artifactId>springdoc-openapi-ui</artifactId>
+            <version>${springdoc.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.projectlombok</groupId>
+            <artifactId>lombok</artifactId>
+            <optional>true</optional>
+        </dependency>
+
+        <dependency>
+            <groupId>commons-fileupload</groupId>
+            <artifactId>commons-fileupload</artifactId>
+            <version>1.3.3</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.commons</groupId>
+            <artifactId>commons-pool2</artifactId>
+        </dependency>
+
+        <dependency>
+            <groupId>cn.hutool</groupId>
+            <artifactId>hutool-all</artifactId>
+            <version>${hutool.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.springframework.boot</groupId>
+            <artifactId>spring-boot-starter-websocket</artifactId>
+        </dependency>
+
+
+
+        <dependency>
+            <groupId>org.springframework.boot</groupId>
+            <artifactId>spring-boot-starter</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.springframework.boot</groupId>
+            <artifactId>spring-boot-starter-test</artifactId>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.springframework.boot</groupId>
+            <artifactId>spring-boot-starter-web</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.springframework.boot</groupId>
+            <artifactId>spring-boot-starter-quartz</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>mysql</groupId>
+            <artifactId>mysql-connector-java</artifactId>
+            <scope>runtime</scope>
+        </dependency>
+        <dependency>
+            <groupId>com.mchange</groupId>
+            <artifactId>c3p0</artifactId>
+            <version>0.9.5.2</version>
+        </dependency>
+        <!--&lt;!&ndash; druid数据库连接池 &ndash;&gt;-->
+        <dependency>
+            <groupId>com.alibaba</groupId>
+            <artifactId>druid-spring-boot-starter</artifactId>
+            <version>1.1.10</version>
+        </dependency>
+
+        <dependency>
+            <groupId>com.baomidou</groupId>
+            <artifactId>mybatis-plus-boot-starter</artifactId>
+            <version>${mybatisplus.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>com.squareup.okhttp3</groupId>
+            <artifactId>okhttp</artifactId>
+            <version>3.9.1</version>
+        </dependency>
+        <dependency>
+            <groupId>com.google.code.gson</groupId>
+            <artifactId>gson</artifactId>
+            <version>${google.code.gson.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>com.alibaba</groupId>
+            <artifactId>fastjson</artifactId>
+            <version>${fastjson.version}</version>
+        </dependency>
+    </dependencies>
+
+    <build>
+        <plugins>
+            <plugin>
+                <groupId>org.springframework.boot</groupId>
+                <artifactId>spring-boot-maven-plugin</artifactId>
+            </plugin>
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-compiler-plugin</artifactId>
+                <configuration>
+                    <source>16</source>
+                    <target>16</target>
+                </configuration>
+            </plugin>
+        </plugins>
+    </build>
+
+
+</project>

+ 13 - 0
src/main/java/com/example/demo/DemoApplication.java

@@ -0,0 +1,13 @@
+package com.example.demo;
+
+import org.springframework.boot.SpringApplication;
+import org.springframework.boot.autoconfigure.SpringBootApplication;
+
+@SpringBootApplication
+public class DemoApplication {
+
+    public static void main(String[] args) {
+        SpringApplication.run(DemoApplication.class, args);
+    }
+
+}

+ 54 - 0
src/main/java/com/example/demo/base/Constants.java

@@ -0,0 +1,54 @@
+package com.example.demo.base;
+
+public class Constants {
+    public static final String QUARTZ_API = "/api/quartz";
+
+    public static final String NET_ERROR = "网络异常";
+
+    /**
+     * 分隔符-竖线
+     */
+    public static final String SEPARATOR_VERTICAL_BAR = " | ";
+
+    /**
+     * 专利类型
+     */
+    public static final String PATENT_TYPE = "PATENT_TYPE";
+
+    public static final Integer TASK_IMPORT_PATENT = 1;
+    /**
+     * 机构类型
+     */
+    public static final String ORGAN_TYPE = "ORGAN_TYPE";
+
+    /**
+     * 许可人/被许可人
+     */
+    public static final String LICENSOR_TYPE = "LICENSOR_TYPE";
+
+    /**
+     * 简单法律状态
+     */
+    public static final String PATENT_SIMPLE_STATUS = "PATENT_SIMPLE_STATUS";
+
+    /**
+     * 国家
+     */
+    public static final String COUNTRIES = "COUNTRIES";
+
+    /**
+     * 法律状态
+     */
+    public static final String PATENT_STATUS = "PATENT_STATUS";
+
+    /**
+     * 企业应用场景
+     */
+    public static final String ENTERPRISE_APPLICATION_SCENARIO = "ENTERPRISE_APPLICATION_SCENARIO";
+
+    /**
+     * 调查类型
+     */
+    public static final String INVESTIGATION_TYPE = "INVESTIGATION_TYPE";
+
+}

+ 92 - 0
src/main/java/com/example/demo/controller/AssoTaskPersonelController.java

@@ -0,0 +1,92 @@
+package com.example.demo.controller;
+
+import com.alibaba.fastjson.JSONObject;
+import com.example.demo.base.Constants;
+import com.example.demo.domain.PatentCell;
+import com.example.demo.domain.UploadFileDTO;
+import com.example.demo.service.OutInterfaceService;
+import com.example.demo.service.UploadFromWebService;
+import com.example.demo.util.FileUtils;
+import com.example.demo.util.Response;
+import io.swagger.v3.oas.annotations.Operation;
+import io.swagger.v3.oas.annotations.tags.Tag;
+import lombok.RequiredArgsConstructor;
+import org.openqa.selenium.By;
+import org.openqa.selenium.JavascriptExecutor;
+import org.openqa.selenium.WebDriver;
+import org.openqa.selenium.WebElement;
+import org.openqa.selenium.chrome.ChromeDriver;
+import org.openqa.selenium.chrome.ChromeOptions;
+import org.openqa.selenium.interactions.Actions;
+import org.openqa.selenium.support.ui.ExpectedConditions;
+import org.openqa.selenium.support.ui.WebDriverWait;
+import org.springframework.context.annotation.Lazy;
+import org.springframework.web.bind.annotation.*;
+import org.springframework.web.multipart.MultipartFile;
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Set;
+import java.util.concurrent.TimeUnit;
+
+@Tag(name = "任务人员操作")
+@RestController
+@RequestMapping(Constants.QUARTZ_API + "/AssoTaskPersonel")
+@RequiredArgsConstructor(onConstructor_ = {@Lazy})
+public class AssoTaskPersonelController {
+    private final FileUtils fileUtils;
+    private final UploadFromWebService uploadFromWebService;
+    @GetMapping("/getStar")
+    public List<PatentCell> getPatentStar(String patentVO) throws Exception {
+        return uploadFromWebService.getPatentStar(patentVO);
+    }
+
+
+    @GetMapping("/getPartClient")
+    @Operation(summary = "分页获取对比专利")
+    public List<PatentCell> getPatentya(String patentVO) throws IOException, InterruptedException {
+        return uploadFromWebService.getPatentya(patentVO);
+
+    }
+
+
+    @GetMapping("/test")
+    @Operation(summary = "分页获取对比专利")
+    public void test(String patentVO) throws IOException, InterruptedException {
+        System.setProperty("webdriver.chrome.driver", "D:\\driver\\chromedriver.exe");
+        // 1.创建webdriver驱动
+        WebDriver driver = new ChromeDriver();
+        //4、创建一个map集合存放浏览器句柄
+        HashMap<String, String> handleMap = new HashMap<>();
+
+        //5、访问百度
+        driver.get("https://www.baidu.com/");
+
+        //6、获取到打开百度窗口的句柄
+        String baiDuHandle = driver.getWindowHandle();
+
+        //7、将百度句柄放到map中
+        handleMap.put("baidu", baiDuHandle);
+
+        //8、新开一个窗口,用js来完成
+        String js = "window.open('https://www.sogou.com');";
+        ((JavascriptExecutor) driver).executeScript(js);
+
+        //9、获取到所有的句柄
+        Set<String> set = driver.getWindowHandles();
+        //10、循环找到搜狗窗口句柄
+        for (String s : set) {
+            //10.1、将搜狗的句柄放到map中
+            if (!s.equals("baiDuHandle"))
+                handleMap.put("souGou", s);
+        }
+
+        //11、切换到搜狗的窗口
+        driver.switchTo().window(handleMap.get("souGou"));
+        driver.switchTo().window(handleMap.get("baidu"));
+        driver.close();
+
+
+    }
+}

+ 40 - 0
src/main/java/com/example/demo/controller/QuartzController.java

@@ -0,0 +1,40 @@
+package com.example.demo.controller;
+
+import com.example.demo.base.Constants;
+import com.example.demo.domain.PatentCell;
+import com.example.demo.service.DongAoJob;
+import com.example.demo.service.JobService;
+import io.swagger.v3.oas.annotations.tags.Tag;
+import lombok.RequiredArgsConstructor;
+import org.quartz.SchedulerException;
+import org.springframework.context.annotation.Lazy;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+import java.util.List;
+
+
+@RestController
+@RequestMapping(Constants.QUARTZ_API + "/job")
+@RequiredArgsConstructor(onConstructor_ = {@Lazy})
+public class QuartzController {
+    private final JobService jobService;
+@GetMapping("/add")
+    public void addJob(String patentVO) throws InterruptedException, SchedulerException {
+jobService.addJob("testJob","testJobGroup","testTrigger","testTriggerGroupName", DongAoJob.class,"2 * * * * ? ");
+
+    }
+
+    @GetMapping("/delete")
+    public void delete(String triggerName,String triggerGroup,String jobName,String jobGroup) throws InterruptedException, SchedulerException {
+        jobService.deleteJob(triggerName,triggerGroup,jobName,jobGroup);
+
+    }
+    @GetMapping("/update")
+    public void update(String triggerName,String triggerGroup,String cron) throws InterruptedException, SchedulerException {
+        jobService.updateJob(triggerName,triggerGroup,cron);
+
+    }
+
+}

+ 107 - 0
src/main/java/com/example/demo/domain/PatentCell.java

@@ -0,0 +1,107 @@
+package com.example.demo.domain;
+
+
+import lombok.Data;
+
+import java.util.Date;
+import java.util.List;
+
+/**
+ * <p>
+ * 管理员表
+ * </p>
+ *
+ * @author 王岩
+ * @since 2022-03-25
+ */
+@Data
+
+/*数据库中的表对应的类
+ */
+public class PatentCell {
+
+    /**
+     * 管理员用户名
+     */
+    private String patentNo;
+    private String title;
+    private String applications;
+    private String legal;
+    private String url;
+    private String abstrc;
+    private String picUrl;
+    /*
+    申请号
+     */
+    private String applicationNo;
+
+    private String country;
+    private String applicationDate;
+    private String pubilcDate;
+    /*
+    公开授权号
+     */
+    private String publicAccreditNo;
+    /*
+公开授权日
+     */
+    private String publicAccreditDate;
+    /*
+    主分类号
+     */
+    private String mainTypeNo;
+    /*
+      分类号
+       */
+    private String typeNo;
+    /*
+    申请人
+     */
+    private String applicationPerson;
+    /*
+申请人地址
+ */
+    private String applicationAddress;
+    /*
+  发明人
+   */
+    private String inventor;
+
+    /*
+    当前权利人
+     */
+    private String patentApplication;
+    /*
+    范畴分类
+     */
+    private String classical;
+    /*
+    状态
+     */
+    private String statue;
+
+    /*
+    摘要
+     */
+    private  String abstrText;
+
+    /*
+    主权要
+     */
+    private String mainRignt;
+
+    /*
+    权要
+     */
+    private List<String> rights;
+
+    /*
+    PDF文档
+     */
+    private String PDF;
+
+    /*
+    说明书
+     */
+    private String patentInstructionText;
+}

+ 38 - 0
src/main/java/com/example/demo/domain/QrtzTask.java

@@ -0,0 +1,38 @@
+package com.example.demo.domain;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import java.io.Serializable;
+import lombok.Data;
+
+/**
+ * 定时任务表
+ * @TableName qrtz_task
+ */
+@TableName(value ="qrtz_task")
+@Data
+public class QrtzTask implements Serializable {
+    /**
+     * ID
+     */
+    @TableId(type = IdType.AUTO)
+    private Integer id;
+
+    /**
+     * 任务id
+     */
+    private Integer taskId;
+
+    /**
+     * 专题库id
+     */
+    private Integer projectId;
+
+    /**
+     * 查询条件
+     */
+    private String conditions;
+
+}

+ 12 - 0
src/main/java/com/example/demo/domain/UploadFileDTO.java

@@ -0,0 +1,12 @@
+package com.example.demo.domain;
+
+import lombok.Data;
+
+@Data
+public class UploadFileDTO {
+    private String name;
+    private String fileName;
+    private String path;
+    private String extName;
+    private Long fileSize;
+}

+ 17 - 0
src/main/java/com/example/demo/mapper/QrtzTaskMapper.java

@@ -0,0 +1,17 @@
+package com.example.demo.mapper;
+
+import com.example.demo.domain.QrtzTask;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import org.apache.ibatis.annotations.Mapper;
+
+/**
+ * @author admin
+ * @description 针对表【qrtz_task(定时任务表)】的数据库操作Mapper
+ * @createDate 2023-03-15 13:40:32
+ * @Entity com.example.demo.domain.QrtzTask
+ */
+@Mapper
+public interface QrtzTaskMapper extends BaseMapper<QrtzTask> {
+
+}
+

+ 11 - 0
src/main/java/com/example/demo/model/dto/QuartzTaskDTO.java

@@ -0,0 +1,11 @@
+package com.example.demo.model.dto;
+
+import lombok.Data;
+
+@Data
+public class QuartzTaskDTO {
+    private Integer projectId;
+    private String  taskName;
+    private String cron;
+    private String conditions;
+}

+ 27 - 0
src/main/java/com/example/demo/model/dto/TaskParams.java

@@ -0,0 +1,27 @@
+package com.example.demo.model.dto;
+
+import cn.hutool.poi.excel.ExcelReader;
+import lombok.Data;
+import lombok.experimental.Accessors;
+
+import java.io.Serializable;
+import java.util.List;
+import java.util.Map;
+
+@Data
+@Accessors(chain = true)
+public class TaskParams implements Serializable {
+    private Integer taskType;
+    private Integer taskId;
+    private String userId;
+    private String path;
+    private String token;
+    private String ids;
+    private Integer projectId;
+    private String selected;
+    private List<Map<Object, Object>> rowList;
+    private String oldName;
+    private Integer total;
+    private Integer index;
+    private Integer productId;
+}

+ 24 - 0
src/main/java/com/example/demo/service/DongAoJob.java

@@ -0,0 +1,24 @@
+package com.example.demo.service;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.quartz.JobDataMap;
+import org.quartz.JobExecutionContext;
+import org.quartz.JobExecutionException;
+import org.springframework.scheduling.quartz.QuartzJobBean;
+
+/**
+ * 定义任务
+ */
+public class DongAoJob extends QuartzJobBean {
+
+    private static final Log logger = LogFactory.getLog(DongAoJob.class);
+
+    @Override
+    protected void executeInternal(JobExecutionContext context) throws JobExecutionException {
+        JobDataMap jobDataMap =     context.getTrigger().getJobDataMap();
+
+      Object msg =  jobDataMap.get("msg");
+        logger.info("信息是"+msg);
+    }
+}

+ 101 - 0
src/main/java/com/example/demo/service/JobService.java

@@ -0,0 +1,101 @@
+package com.example.demo.service;
+
+import org.quartz.*;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+@Service
+public class JobService {
+    @Autowired
+    private Scheduler scheduler;
+    /**
+     * 删除job
+     *
+     * @param triggerName  触发器名称
+     * @param triggerGroup 触发器分组
+     * @param jobName      任务名称
+     * @param jobGroup     任务分组
+     * @throws SchedulerException
+     */
+    public void deleteJob(String triggerName, String triggerGroup, String jobName, String jobGroup) throws SchedulerException {
+        TriggerKey triggerKey = TriggerKey.triggerKey(triggerName, triggerGroup);
+        scheduler.pauseTrigger(triggerKey);
+        scheduler.unscheduleJob(triggerKey);
+        JobKey jobKey = JobKey.jobKey(jobName, jobGroup);
+        scheduler.deleteJob(jobKey);
+    }
+    /**
+     * 暂停job
+     *
+     * @param triggerName  触发器名称
+     * @param triggerGroup 触发器分组
+     * @param jobName      任务名称
+     * @param jobGroup     任务分组
+     * @throws SchedulerException
+     */
+    public void pauseJob(String triggerName, String triggerGroup, String jobName, String jobGroup) throws SchedulerException {
+        TriggerKey triggerKey = TriggerKey.triggerKey(triggerName, triggerGroup);
+        scheduler.pauseTrigger(triggerKey);
+        scheduler.unscheduleJob(triggerKey);
+        JobKey jobKey = JobKey.jobKey(jobName, jobGroup);
+        scheduler.pauseJob(jobKey);
+    }
+
+    /**
+     * 恢复job
+     *
+     * @param triggerName  触发器名称
+     * @param triggerGroup 触发器分组
+     * @param jobName      任务名称
+     * @param jobGroup     任务分组
+     * @throws SchedulerException
+     */
+    public void resumeJob(String triggerName, String triggerGroup, String jobName, String jobGroup) throws SchedulerException {
+        TriggerKey triggerKey = TriggerKey.triggerKey(triggerName, triggerGroup);
+        scheduler.pauseTrigger(triggerKey);
+        scheduler.unscheduleJob(triggerKey);
+        JobKey jobKey = JobKey.jobKey(jobName, jobGroup);
+        scheduler.resumeJob(jobKey);
+    }
+
+    /**
+     * 修改定时任务
+     *
+     * @param cron          新的cron表达式
+     */
+    public void updateJob(String triggerName, String triggerGroup, String cron) {
+        JobDataMap jobDataMap =new JobDataMap();
+        jobDataMap.put("msg","update1");
+        TriggerKey oldTriggerKey = TriggerKey.triggerKey(triggerName, triggerGroup);
+        CronScheduleBuilder scheduleBuilder = CronScheduleBuilder.cronSchedule(cron);
+        CronTrigger cronTrigger = TriggerBuilder.newTrigger()
+                .withIdentity(oldTriggerKey).usingJobData(jobDataMap).withSchedule(scheduleBuilder).build();
+        try {
+            scheduler.rescheduleJob(oldTriggerKey, cronTrigger);
+        } catch (SchedulerException e) {
+            e.printStackTrace();
+        }
+    }
+
+    /**
+     * 新增job任务
+     *
+     * @param jobName          job名称
+     * @param jobGroupName     job分组名称
+     * @param triggerName      触发器名称
+     * @param triggerGroupName 触发器分组名称
+     * @param jobClass         需要执行的job.class
+     * @param cron             cron 表达式
+     * @throws SchedulerException
+     */
+    public void addJob(String jobName, String jobGroupName,
+                       String triggerName, String triggerGroupName, Class jobClass, String cron) throws SchedulerException {
+        JobDataMap jobDataMap =new JobDataMap();
+        jobDataMap.put("msg","add");
+        CronScheduleBuilder cronScheduleBuilder = CronScheduleBuilder.cronSchedule(cron);
+        JobDetail jobDetail = JobBuilder.newJob(jobClass).withIdentity(jobName, jobGroupName).build();
+        Trigger trigger = TriggerBuilder.newTrigger().withIdentity(triggerName, triggerGroupName)
+                .withSchedule(cronScheduleBuilder).usingJobData(jobDataMap).build();
+        scheduler.scheduleJob(jobDetail, trigger);
+    }
+}

+ 56 - 0
src/main/java/com/example/demo/service/OutInterfaceService.java

@@ -0,0 +1,56 @@
+package com.example.demo.service;
+
+
+import com.example.demo.domain.PatentCell;
+import com.google.gson.Gson;
+
+import lombok.RequiredArgsConstructor;
+
+import okhttp3.*;
+
+import org.springframework.beans.factory.annotation.Value;
+import org.springframework.context.annotation.Lazy;
+import org.springframework.stereotype.Service;
+
+import java.io.IOException;
+import java.util.*;
+import java.util.concurrent.TimeUnit;
+import java.util.stream.Collectors;
+
+/**
+ * @author 沈永艺
+ * @description 调用外部接口的Service类 PCS:权限系统 PAS:专利分析系统
+ * @date 2022-10-31
+ */
+@SuppressWarnings({"all"})
+@Service
+@RequiredArgsConstructor(onConstructor_ = {@Lazy})
+public class OutInterfaceService {
+    @Value("${PCSUrl}")
+    private String PCSUrl;
+    @Value("${PASUrl}")
+    private String PASUrl;
+
+
+    /**
+     * @params 传对象
+     * @title 导入专利
+     * @description 导入专利
+     * @author lrj
+     */
+    public String importPatents(PatentCell patentCell) throws IOException {
+        OkHttpClient httpClient = new OkHttpClient.Builder()
+                .pingInterval(400, TimeUnit.SECONDS) // 设置 PING 帧发送间隔
+                .connectTimeout(300, TimeUnit.SECONDS)//设置连接超时时间
+                .readTimeout(300, TimeUnit.SECONDS)//设置读取超时时间
+                .build();
+        String param = new Gson().toJson(patentCell);
+        RequestBody requestBody = RequestBody.create(MediaType.parse("application/json"), param);
+        Request request = new Request.Builder()
+                .url(PASUrl + "/api/v2/system/patentCellTODb")
+                .post(requestBody)
+                .build();
+        return Objects.requireNonNull(httpClient.newCall(request).execute().body()).string();
+    }
+
+}

+ 32 - 0
src/main/java/com/example/demo/service/QrTaskService.java

@@ -0,0 +1,32 @@
+package com.example.demo.service;
+
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.example.demo.domain.QrtzTask;
+import com.example.demo.model.dto.QuartzTaskDTO;
+import lombok.RequiredArgsConstructor;
+import org.springframework.context.annotation.Lazy;
+import org.springframework.stereotype.Service;
+import com.example.demo.mapper.QrtzTaskMapper;
+
+/**
+* @author admin
+* @description 针对表【qrtz_task(定时任务表)】的数据库操作Service实现
+* @createDate 2023-03-15 13:40:32
+*/
+@Service
+@RequiredArgsConstructor(onConstructor_ = {@Lazy})
+public class QrTaskService extends ServiceImpl<QrtzTaskMapper, QrtzTask>{
+
+    public void addQuartzTask(QuartzTaskDTO quartzTaskDTO){
+
+
+
+
+    }
+
+
+}
+
+
+
+

+ 362 - 0
src/main/java/com/example/demo/service/UploadFromWebService.java

@@ -0,0 +1,362 @@
+package com.example.demo.service;
+
+import com.alibaba.fastjson.JSONObject;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.example.demo.domain.PatentCell;
+import com.example.demo.domain.QrtzTask;
+import com.example.demo.domain.UploadFileDTO;
+import com.example.demo.mapper.QrtzTaskMapper;
+import com.example.demo.model.dto.QuartzTaskDTO;
+import com.example.demo.util.FileUtils;
+import lombok.RequiredArgsConstructor;
+import org.openqa.selenium.By;
+import org.openqa.selenium.WebDriver;
+import org.openqa.selenium.WebElement;
+import org.openqa.selenium.chrome.ChromeDriver;
+import org.openqa.selenium.chrome.ChromeOptions;
+import org.openqa.selenium.interactions.Actions;
+import org.openqa.selenium.support.ui.ExpectedConditions;
+import org.openqa.selenium.support.ui.WebDriverWait;
+import org.springframework.context.annotation.Lazy;
+import org.springframework.stereotype.Service;
+import org.springframework.web.multipart.MultipartFile;
+
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Set;
+import java.util.concurrent.TimeUnit;
+
+/**
+* @author admin
+* @description 针对表【qrtz_task(定时任务表)】的数据库操作Service实现
+* @createDate 2023-03-15 13:40:32
+*/
+@Service
+@RequiredArgsConstructor(onConstructor_ = {@Lazy})
+public class UploadFromWebService{
+    private final FileUtils fileUtils;
+    private final OutInterfaceService outInterfaceService;
+// 查询并上传(智慧芽)
+public List<PatentCell> getPatentStar(String patentVO) throws Exception {
+    List<PatentCell> patentCells = new ArrayList<>();
+    //1.获得驱动
+    System.setProperty("webdriver.chrome.driver", "D:\\driver\\chromedriver.exe");
+    // 2.页面最大化
+    ChromeOptions chromeOptions = new ChromeOptions();
+    chromeOptions.addArguments("--start-maximized");
+    // 3.创建驱动
+    WebDriver driver = new ChromeDriver(chromeOptions);
+    // 4.创建动作
+    Actions action = new Actions(driver);
+    //设置等待时间
+    long formSecond1 = 50;
+    WebDriverWait wait1 = new WebDriverWait(driver, formSecond1);
+    // 打开智慧芽首页
+    driver.get("https://cprs.patentstar.com.cn/Account/LoginOut");
+    wait1.until(ExpectedConditions.presenceOfElementLocated(By.id("loginname")));
+    WebElement loginName = driver.findElement(By.id("loginname"));
+    WebElement password = driver.findElement(By.id("password"));
+    loginName.sendKeys("lrj20000506");
+    password.sendKeys("20000506sz");
+    WebElement loginButton = driver.findElement(By.id("login"));
+    loginButton.click();
+    //获得表格搜索按钮并点击
+    wait1.until(ExpectedConditions.presenceOfElementLocated(By.id("tablepage")));
+    WebElement tablePage = driver.findElement(By.id("tablepage"));
+    WebElement tablePagea = tablePage.findElement(By.tagName("a"));
+    tablePagea.click();
+    //获得搜索框并点击
+    wait1.until(ExpectedConditions.presenceOfElementLocated(By.id("TxtSearch")));
+    WebElement TxtSearch = driver.findElement(By.id("TxtSearch"));
+    TxtSearch.sendKeys("F XX (木箱的/TI)");
+    WebElement searchBtn = driver.findElement(By.id("searchbtn2"));
+    searchBtn.click();
+    wait1.until(ExpectedConditions.presenceOfElementLocated(By.className("tcdNumber")));
+    List<WebElement> tcdNumbers =driver.findElements(By.className("tcdNumber"));
+    String pagesText =  tcdNumbers.get(tcdNumbers.size()-1).getText();
+    int page =Integer.parseInt(pagesText);
+    String Handle = driver.getWindowHandle();
+    //创建一个map集合存放浏览器句柄
+    HashMap<String, String> handleMap = new HashMap<>();
+    //将智慧芽句柄放到map中
+    handleMap.put("mainPage", Handle);
+    for( int p =0;p<1;p++) {
+        //等待数据加载
+        wait1.until(ExpectedConditions.presenceOfElementLocated(By.className("patent")));
+        TimeUnit.MILLISECONDS.sleep(1000);//毫秒
+        //获得列表
+        List<WebElement> patentContents = driver.findElements(By.className("patent"));
+        // 页面元素标签
+        for (int i = 0; i < patentContents.size(); i++) {
+            PatentCell patentCell = new PatentCell();
+            wait1.until(ExpectedConditions.presenceOfElementLocated(By.className("title-color")));
+            WebElement titleA = patentContents.get(i).findElement(By.className("title-color"));
+            titleA.click();
+            //9、获取到所有的句柄
+            Set<String> set = driver.getWindowHandles();
+            //10、循环找到详情窗口句柄
+            for (String s : set) {
+                //10.1、将详情窗口的句柄放到map中
+                if (!s.equals(Handle)) {
+                    handleMap.put("detail", s);
+                }
+            }
+            driver.switchTo().window(handleMap.get("detail"));
+            wait1.until(ExpectedConditions.presenceOfElementLocated(By.className("item-content")));
+            WebElement itemContent = driver.findElement(By.className("item-content"));
+            List<WebElement> divItems = itemContent.findElements(By.tagName("div"));
+            for (int t = 0; t < divItems.size(); t++) {
+                WebElement temEle = divItems.get(t);
+                String text = temEle.getText();
+                String value = "";
+                String[] strings = text.split(":");
+                if (strings.length > 1) {
+                    value = strings[1];
+                }
+                switch (t) {
+                    case 0:
+                        patentCell.setApplicationNo(value);
+                    case 1:
+                        patentCell.setApplicationDate(value);
+                    case 2:
+                        patentCell.setCountry(value);
+                    case 3:
+                        patentCell.setPatentNo(value);
+                    case 4:
+                        patentCell.setPubilcDate(value);
+                    case 5:
+                        patentCell.setPublicAccreditNo(value);
+                    case 6:
+                        patentCell.setPublicAccreditDate(value);
+                    case 7:
+                        patentCell.setMainTypeNo(value);
+                    case 8:
+                        patentCell.setTypeNo(value);
+                    case 9:
+                        patentCell.setApplicationNo(value);
+                    case 10:
+                        patentCell.setApplicationAddress(value);
+                    case 11:
+                        patentCell.setInventor(value);
+                    case 12:
+                        patentCell.setPatentApplication(value);
+                    case 13:
+                        patentCell.setClassical(value);
+                    case  14:
+                        patentCell.setStatue(value);
+                        break;
+                }
+            }
+            //获得摘要
+            WebElement abstrElement = driver.findElement(By.className("item-summary"));
+            List<WebElement> spans =abstrElement.findElements(By.tagName("span"));
+            String abstrText =  spans.get(0).getText();
+            patentCell.setAbstrText(abstrText);
+            //获得主权要
+            String mainRight =spans.get(1).getText();
+            patentCell.setMainRignt(mainRight);
+            //获得图片路径
+            wait1.until(ExpectedConditions.presenceOfElementLocated(By.className("item-img")));
+            WebElement picElement = driver.findElement(By.className("item-img"));
+            WebElement imag =picElement.findElement(By.tagName("img"));
+            String url =  imag.getAttribute("src");
+            patentCell.setPicUrl(url);
+            //获得权要
+            WebElement CLElement = driver.findElement(By.id("itemCL"));
+            CLElement.click();
+            wait1.until(ExpectedConditions.presenceOfElementLocated(By.tagName("claim-text")));
+            List<WebElement> rightElements = driver.findElements(By.tagName("claim-text"));
+            List<String> rights= new ArrayList<>();
+            rightElements.forEach(item->{
+                rights.add(item.getText());
+            });
+            patentCell.setRights(rights);
+            //获得说明书
+            WebElement DSElement = driver.findElement(By.id("itemDS"));
+            DSElement.click();
+            wait1.until(ExpectedConditions.presenceOfElementLocated(By.id("title1")));
+            WebElement titleElement = driver.findElement(By.id("title1"));
+            patentCell.setTitle(titleElement.getText());
+            StringBuilder stringBuilder =new StringBuilder();
+            int flag =1;
+            //技术领域
+            WebElement textElement1 = driver.findElement(By.id("technical-field001"));
+            List<WebElement> textP1 =textElement1.findElements(By.tagName("p"));
+            stringBuilder.append(textP1.get(0).getText());
+            stringBuilder.append("\r\n");
+            for(int t=1;t<textP1.size();t++){
+                String tem=	String.format("%04d", flag);
+                stringBuilder.append("["+tem+"]"+textP1.get(t).getText());
+                stringBuilder.append("\r\n");
+                flag+=1;
+            }
+            //背景技术
+            WebElement textElement2 = driver.findElement(By.id("background-art001"));
+            List<WebElement> textP2 =textElement2.findElements(By.tagName("p"));
+            stringBuilder.append(textP2.get(0).getText());
+            stringBuilder.append("\r\n");
+            for(int t=1;t<textP2.size();t++){
+                String tem=	String.format("%04d", flag);
+                stringBuilder.append("["+tem+"]"+textP2.get(t).getText());
+                stringBuilder.append("\r\n");
+                flag+=1;
+            }
+            //说明文本
+            WebElement textElement3 = driver.findElement(By.id("disclosure001"));
+            List<WebElement> textP3 =textElement3.findElements(By.tagName("p"));
+            stringBuilder.append(textP3.get(0).getText());
+            stringBuilder.append("\r\n");
+            for(int t=1;t<textP3.size();t++){
+                String tem=	String.format("%04d", flag);
+                stringBuilder.append("["+tem+"]"+textP3.get(t).getText());
+                stringBuilder.append("\r\n");
+                flag+=1;
+            }
+            //发明内容
+            WebElement textElement4 = driver.findElement(By.id("disclosure001"));
+            List<WebElement> textP4 =textElement4.findElements(By.tagName("p"));
+            stringBuilder.append(textP4.get(0).getText());
+            stringBuilder.append("\r\n");
+            for(int t=1;t<textP4.size();t++){
+                String tem=	String.format("%04d", flag);
+                stringBuilder.append("["+tem+"]"+textP4.get(t).getText());
+                stringBuilder.append("\r\n");
+                flag+=1;
+            }
+            //附图说明
+            WebElement textElement5 = driver.findElement(By.id("description-of-drawings001"));
+            List<WebElement> textP5 =textElement5.findElements(By.tagName("p"));
+            stringBuilder.append(textP5.get(0).getText());
+            stringBuilder.append("\r\n");
+            for(int t=1;t<textP5.size();t++){
+                String tem=	String.format("%04d", flag);
+                stringBuilder.append("["+tem+"]"+textP5.get(t).getText());
+                stringBuilder.append("\r\n");
+                flag+=1;
+            }
+            patentCell.setPatentInstructionText(stringBuilder.toString());
+            //获得pdf文档
+            WebElement PDFElement = driver.findElement(By.id("itemPdf"));
+            PDFElement.click();
+            wait1.until(ExpectedConditions.presenceOfElementLocated(By.tagName("embed")));
+            WebElement PDFFile =driver.findElement(By.tagName("embed"));
+            patentCell.setPDF(PDFFile.getAttribute("src"));
+            String res =   outInterfaceService.importPatents(patentCell);
+
+            JSONObject jsonObject =JSONObject.parseObject(res);
+            if(jsonObject.get("code").toString().equals("0")){
+                return null;
+            }
+            patentCells.add(patentCell);
+            //上传
+            MultipartFile file = FileUtils.urlToMultipartFile(patentCell.getPDF(),".PDF");
+            UploadFileDTO fileDTO = fileUtils.uploadFile(file);
+            String path = fileUtils.getPath(fileDTO.getPath());
+            patentCell.setUrl(path);
+            driver.close();
+            driver.switchTo().window(handleMap.get("mainPage"));
+        }
+        wait1.until(ExpectedConditions.presenceOfElementLocated(By.className("tcdPageCode")));
+
+        List<WebElement> nexts = driver.findElements(By.className("nextPage"));
+        if (nexts.size()!=0){
+            nexts.get(0).click();
+        }
+    }
+//        driver.quit();
+    return patentCells;
+}
+
+    public List<PatentCell> getPatentya(String patentVO) throws IOException, InterruptedException {
+        //1.获得驱动
+        System.setProperty("webdriver.chrome.driver", "D:\\driver\\chromedriver.exe");
+        // 2.页面最大化
+        ChromeOptions chromeOptions = new ChromeOptions();
+        chromeOptions.addArguments("--start-maximized");
+        // 3.创建驱动
+        WebDriver driver = new ChromeDriver(chromeOptions);
+        // 4.创建动作
+        Actions action = new Actions(driver);
+        // 打开智慧芽首页
+        driver.get("https://account.zhihuiya.com");
+        //设置等待时间
+        long formSecond1 = 50;
+        WebDriverWait wait1 = new WebDriverWait(driver, formSecond1);
+        //等待密码登录界面加载
+        wait1.until(ExpectedConditions.presenceOfElementLocated(By.id("tab-password")));
+        // 点击密码登录
+        driver.findElement(By.id("tab-password")).click();
+        // 获取输入框,输入账号密码
+        List<WebElement> ret = driver.findElements(By.className("el-input__inner"));
+        ret.get(0).sendKeys("liting@china-wispro.com");
+        ret.get(1).sendKeys("Lt199299");
+        // 点击登录
+        driver.findElement(By.className("el-button")).click();
+        //等待加载
+        TimeUnit.MILLISECONDS.sleep(1000);//毫秒
+        List<WebElement> alerts = driver.findElements(By.className("patsnap-el-confirm"));
+        if (alerts.size() != 0) {
+            alerts.get(0).click();
+        }
+        wait1.until(ExpectedConditions.presenceOfElementLocated(By.className("master_nav-item__2nd_lv")));
+        WebElement searchTag = driver.findElement(By.className("master_nav-item__2nd_lv"));
+        searchTag.click();
+        //等待搜索框加载
+        wait1.until(ExpectedConditions.presenceOfElementLocated(By.className("div-textarea")));
+        List<WebElement> ret1 = driver.findElements(By.className("div-textarea"));
+        //搜索框赋值
+        ret1.get(0).sendKeys(patentVO);
+        TimeUnit.MILLISECONDS.sleep(2000);//毫秒
+        wait1.until(ExpectedConditions.presenceOfElementLocated(By.className("search-form__btn")));
+        WebElement rr = driver.findElement(By.className("search-form__btn"));
+        rr.click();
+        TimeUnit.MILLISECONDS.sleep(1000);//毫秒
+        List<PatentCell> patentCells = new ArrayList<>();
+        long formSecond = 50;
+        WebDriverWait wait = new WebDriverWait(driver, formSecond);
+        wait.until(ExpectedConditions.presenceOfElementLocated(By.className("search-result-standard-view__patent")));
+//            String js ="document.getElementsByClassName('sidebar-table__right')[0].scrollBy(0, 8000)";
+//            ((JavascriptExecutor) driver).executeScript(js);
+
+        List<WebElement> ret2 = driver.findElements(By.className("search-result-standard-view__patent"));
+        ret2.remove(ret2.size() - 1);
+        List<WebElement> ret3 = driver.findElements(By.className("pn-cell-popover"));
+        for (int i = 0; i < ret2.size(); i++) {
+            action.moveToElement(ret3.get(i)).perform();
+            wait.until(ExpectedConditions.attributeToBeNotEmpty(ret3.get(i), "href"));
+            String patenNo = ret3.get(i).getAttribute("data-link-data");
+            System.out.println(patenNo);
+        }
+        for (WebElement item : ret2) {
+            List<WebElement> aLinks = item.findElements(By.tagName("a"));
+            PatentCell patentCell = new PatentCell();
+            aLinks.forEach(tem -> {
+                String type = tem.getAttribute("data-link-type");
+                if (type != null && type.equals("TITLE")) {
+                    String title = tem.getAttribute("data-link-data");
+                    patentCell.setTitle(title);
+                } else if (type != null && type.equals("PN")) {
+                    String url = tem.getAttribute("href");
+                    patentCell.setUrl(url);
+                    String patenNo = tem.getAttribute("data-link-data");
+                    patentCell.setPatentNo(patenNo);
+                } else if (type != null && type.equals("ANC")) {
+                    String applications = tem.getAttribute("data-link-data");
+                    patentCell.setApplications(applications);
+                }
+            });
+            String legal = driver.findElement(By.className("legal-tag__LEGAL_STATUS")).getText();
+            patentCell.setLegal(legal);
+            patentCells.add(patentCell);
+
+        }
+        return patentCells;
+    }
+
+}
+
+
+
+

+ 662 - 0
src/main/java/com/example/demo/util/DateUtils.java

@@ -0,0 +1,662 @@
+package com.example.demo.util;
+
+import cn.hutool.core.date.DateTime;
+import cn.hutool.core.date.DateUtil;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import java.lang.management.ManagementFactory;
+import java.text.ParseException;
+import java.text.SimpleDateFormat;
+import java.util.*;
+import java.util.regex.Pattern;
+
+public class DateUtils {
+
+    public static final String START_TIME = " 00:00:00";
+    public static final String END_TIME = " 23:59:59";
+    public final static String FORMAT_STRING = "yyyy-MM-dd HH:mm:ss";
+    public final static String[] REPLACE_STRING = new String[]{"GMT+0800", "GMT+08:00"};
+    public final static String SPLIT_STRING = "(中国标准时间)";
+    public static Logger log = LoggerFactory.getLogger(DateUtils.class);
+    public static String YYYY = "yyyy";
+    public static String YYYY_MM = "yyyy-MM";
+    public static String YYYY_MM_DD = "yyyy-MM-dd";
+    public static String YYYYMMDDHHMMSS = "yyyyMMddHHmmss";
+    public static String YYYYMMDD = "yyyyMMdd";
+    public static String YYYY_MM_DD_HH_MM_SS = "yyyy-MM-dd HH:mm:ss";
+    private static String[] parsePatterns = {
+            "yyyy-MM-dd", "yyyy-MM-dd HH:mm:ss", "yyyy-MM-dd HH:mm", "yyyy-MM",
+            "yyyy/MM/dd", "yyyy/MM/dd HH:mm:ss", "yyyy/MM/dd HH:mm", "yyyy/MM",
+            "yyyy.MM.dd", "yyyy.MM.dd HH:mm:ss", "yyyy.MM.dd HH:mm", "yyyy.MM"};
+
+    public static String getDateSourceName(Date startTime, Date endTime, Integer offset, Integer index) {
+        String ret = null;
+        switch (offset) {
+            //月份
+            case -1:
+                ret = DateUtil.format(startTime, "yyyy-MM");
+                break;
+            //季度
+            case -3:
+                ret = String.format("%s-Q%s", DateUtil.format(startTime, "yyyy"), (index % 4) + 1);
+                break;
+            //半年
+            case -6:
+                ret = String.format("%s-%s", DateUtil.format(startTime, "yyyy"), index % 2 == 0 ? "H1" : "H2");
+                break;
+            //1年
+            case -12:
+                ret = DateUtil.format(startTime, "yyyy");
+                break;
+            //2年,3年,5年
+            case -24:
+            case -36:
+            case -60:
+                ret = String.format("%s-%s", DateUtil.format(DateUtil.offsetMonth(endTime, offset / 12 * -1), "yyyy"), DateUtil.format(startTime, "yyyy"));
+                break;
+        }
+        return ret;
+    }
+
+    private DateUtils() {
+    }
+
+    public static Integer getWeek(String beginDateStr, String endDateStr, String date) {
+        DateTime beginDate = DateUtil.parseDate(beginDateStr);
+        DateTime endDate = DateUtil.parseDate(endDateStr);
+        DateTime currentDate = DateUtil.parseDate(date);
+        int week = 1;
+        if (DateUtil.isIn(currentDate, beginDate, endDate)) {
+            Date endDateOfWeek = DateUtil.endOfWeek(beginDate);
+            while (!DateUtil.isIn(currentDate, beginDate, endDateOfWeek)) {
+                ++week;
+                endDateOfWeek = DateUtil.endOfWeek(DateUtil.offsetDay(endDateOfWeek, 1));
+            }
+            return week;
+        }
+        return -1;
+    }
+
+    public static boolean belongCalendar(Date nowTime, Date beginTime, Date endTime) {
+        Calendar date = Calendar.getInstance();
+        date.setTime(nowTime);
+        Calendar begin = Calendar.getInstance();
+        begin.setTime(beginTime);
+        Calendar end = Calendar.getInstance();
+        end.setTime(endTime);
+        return date.after(begin) && date.before(end);
+    }
+
+    /**
+     * 获取现在的时间 yyyy-MM-dd HH:mm:ss
+     */
+    public static String getNowTime() {
+        SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
+        Date date = new Date(System.currentTimeMillis());
+        return format.format(date);
+    }
+
+    /**
+     * 获取当前Date型日期
+     *
+     * @return Date() 当前日期
+     */
+    public static Date getNowDate() {
+        return new Date();
+    }
+
+    public static Integer getDateTime() {
+        return (int) (new Date().getTime() / 1000);
+    }
+
+    public static Integer getDateTime(String date) {
+        int dateTime = 0;
+        if (date.contains("/")) {
+            dateTime = Math.toIntExact(strToDateTime(date, parsePatterns[4]).getTime() / 1000);
+        } else if (date.contains("-")) {
+            dateTime = Math.toIntExact(strToDateTime(date, YYYY_MM_DD).getTime() / 1000);
+        }
+        return dateTime;
+    }
+
+    /**
+     * @author 陌溪
+     * @date 2018年6月14日
+     */
+    public static String getNowTimeFormat(String format) {
+        SimpleDateFormat simpleDateFormat = new SimpleDateFormat(format);
+        Date date = new Date(System.currentTimeMillis());
+        return simpleDateFormat.format(date);
+    }
+
+
+    public static Date str2Date(String dateString) {
+        try {
+            dateString = dateString.split(Pattern.quote(SPLIT_STRING))[0].replace(REPLACE_STRING[0], REPLACE_STRING[1]);
+            SimpleDateFormat sf1 = new SimpleDateFormat("E MMM dd yyyy HH:mm:ss z", Locale.US);
+            return sf1.parse(dateString);
+        } catch (Exception e) {
+            throw new RuntimeException("时间转化格式错误" + "[dateString=" + dateString + "]" + "[FORMAT_STRING=" + FORMAT_STRING + "]");
+        }
+    }
+
+    public static Date strToDate(String dateString) {
+        try {
+            SimpleDateFormat sf1;
+            if (dateString.contains("-")) {
+                sf1 = new SimpleDateFormat("yyyy-MM-dd");
+            } else if (dateString.contains("//")) {
+                sf1 = new SimpleDateFormat("yyyy/MM/dd");
+            } else if (dateString.contains(":")) {
+                sf1 = new SimpleDateFormat("yyyy:MM:dd");
+            } else if (dateString.contains(".")) {
+                sf1 = new SimpleDateFormat("yyyy.MM.dd");
+            } else {
+                sf1 = new SimpleDateFormat("yyyyMMdd");
+            }
+
+            return sf1.parse(dateString);
+        } catch (Exception e) {
+            throw new RuntimeException("时间转化格式错误" + "[dateString=" + dateString + "]" + "[FORMAT_STRING=" + FORMAT_STRING + "]");
+        }
+    }
+
+    /**
+     * 获取今天开始的时间
+     */
+    public static String getToDayStartTime() {
+        SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd 00:00:00");
+        Date date = new Date(System.currentTimeMillis());
+        return format.format(date);
+    }
+
+    /**
+     * 获取今天结束的时间
+     */
+    public static String getToDayEndTime() {
+        SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd 23:59:59");
+        Date date = new Date(System.currentTimeMillis());
+        return format.format(date);
+    }
+
+    /**
+     * 获取昨天开始的时间
+     */
+    public static String getYesterdayStartTime() {
+        SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd 00:00:00");
+        Date date = new Date(System.currentTimeMillis() - 24 * 60 * 60 * 1000L);
+        return format.format(date);
+    }
+
+    /**
+     * 获取昨天结束的时间
+     */
+    public static String getYesterdayEndTime() {
+        SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd 23:59:59");
+        Date date = new Date(System.currentTimeMillis() - 24 * 60 * 60 * 1000L);
+        return format.format(date);
+    }
+
+    /**
+     * 获取某天开始的时间
+     */
+    public static String getOneDayStartTime(String oneDay) {
+        SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd 00:00:00");
+        Date date = new Date(oneDay);
+        return format.format(oneDay);
+    }
+
+    /**
+     * 获取某天开始的日期
+     */
+    public static String getOneDayStartTime(Date oneDay) {
+        SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd 00:00:00");
+        return format.format(oneDay);
+    }
+
+    /**
+     * 获取某天结束的时间
+     */
+    public static String getOneDayEndTime(String oneDay) {
+        SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd 00:00:00");
+        Date date = new Date(oneDay);
+        return format.format(date);
+    }
+
+    /**
+     * 获取某天结束的日期
+     */
+    public static String getOneDayEndTime(Date oneDay) {
+        SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd 00:00:00");
+        return format.format(oneDay);
+    }
+
+    /**
+     * 获取本周开始的时间
+     */
+    public static Date getWeekStartTime() {
+        //获得本周一0点时间
+        Calendar cal = Calendar.getInstance();
+        cal.set(cal.get(Calendar.YEAR), cal.get(Calendar.MONTH), cal.get(Calendar.DAY_OF_MONTH), 0, 0, 0);
+        cal.set(Calendar.DAY_OF_WEEK, Calendar.MONDAY);
+        return cal.getTime();
+    }
+
+    /**
+     * 将 String 转换成 Date
+     */
+    public static Date strToDateTime(String dateTime) {
+        Date date = null;
+        try {
+            SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
+            date = format.parse(dateTime);
+        } catch (ParseException e) {
+            e.printStackTrace();
+        }
+        return date;
+    }
+
+    /**
+     * 将 String 转换成 Date (转换格式可传入)
+     */
+    public static Date strToDateTime(String dateTime, String fmt) {
+        Date date = null;
+        try {
+            SimpleDateFormat format = new SimpleDateFormat(fmt);
+            date = format.parse(dateTime);
+        } catch (ParseException e) {
+            e.printStackTrace();
+        }
+        return date;
+    }
+
+    /**
+     * 将 Date 转换成时间戳
+     */
+    public static Long dateToStamp(String s) throws ParseException {
+        SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
+        Date date = simpleDateFormat.parse(s);
+        return date.getTime();
+    }
+
+    /**
+     * 将 Date 转换成 String
+     */
+    public static String dateTimeToStr(Date dateTime) {
+        SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
+        return format.format(dateTime);
+    }
+
+    public static String dateTimeToStr(Date dateTime, String fmt) {
+
+        SimpleDateFormat format = new SimpleDateFormat(fmt);
+        return format.format(dateTime);
+    }
+
+    /**
+     * 获取本周开始的时间的字符串
+     */
+    public static String getWeekStartTimeStr() {
+        //获得本周一0点时间
+        Calendar cal = Calendar.getInstance();
+        cal.set(cal.get(Calendar.YEAR), cal.get(Calendar.MONTH), cal.get(Calendar.DAY_OF_MONTH), 0, 0, 0);
+        cal.set(Calendar.DAY_OF_WEEK, Calendar.MONDAY);
+        SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd 00:00:00");
+        return format.format(cal.getTime());
+    }
+
+    /**
+     * 获取本周结束的时间
+     */
+    public static Date getWeekEndTime() {
+        Calendar cal = Calendar.getInstance();
+        cal.setTime(getWeekStartTime());
+        cal.add(Calendar.DAY_OF_WEEK, 7);
+        return cal.getTime();
+    }
+
+    /**
+     * 获取本周结束的时间的字符串
+     */
+    public static String getWeekEndTimeStr() {
+        Calendar cal = Calendar.getInstance();
+        cal.setTime(getWeekStartTime());
+        cal.add(Calendar.DAY_OF_WEEK, 7);
+        SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd 23:59:59");
+        return format.format(cal.getTime());
+    }
+
+    /**
+     * 获取上周开始的时间的字符串
+     */
+    public static String getLastWeekStartTimeStr() {
+        int weeks = -1;
+        int mondayPlus = getMondayPlus();
+        GregorianCalendar currentDate = new GregorianCalendar();
+        currentDate.add(GregorianCalendar.DATE, mondayPlus + 7 * weeks);
+        Date monday = currentDate.getTime();
+        SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd 00:00:00");
+        return format.format(monday);
+    }
+
+    /**
+     * 获取本月开始的时间
+     */
+    public static Date getMonthStartTime() {
+        Calendar cal = Calendar.getInstance();
+        cal.set(cal.get(Calendar.YEAR), cal.get(Calendar.MONTH), cal.get(Calendar.DAY_OF_MONTH), 0, 0, 0);
+        cal.set(Calendar.DAY_OF_MONTH, cal.getActualMinimum(Calendar.DAY_OF_MONTH));
+        return cal.getTime();
+    }
+
+    /**
+     * 获取本月开始的时间的字符串
+     */
+    public static String getMonthStartTimeStr() {
+        Calendar cal = Calendar.getInstance();
+        cal.set(cal.get(Calendar.YEAR), cal.get(Calendar.MONTH), cal.get(Calendar.DAY_OF_MONTH), 0, 0, 0);
+        cal.set(Calendar.DAY_OF_MONTH, cal.getActualMinimum(Calendar.DAY_OF_MONTH));
+        SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd 23:59:59");
+        return format.format(cal.getTime());
+    }
+
+    /**
+     * 获取本月结束的时间
+     */
+    public static Date getMonthEndTime() {
+        Calendar cal = Calendar.getInstance();
+        cal.set(cal.get(Calendar.YEAR), cal.get(Calendar.MONTH), cal.get(Calendar.DAY_OF_MONTH), 0, 0, 0);
+        cal.set(Calendar.DAY_OF_MONTH, cal.getActualMaximum(Calendar.DAY_OF_MONTH));
+        cal.set(Calendar.HOUR_OF_DAY, 24);
+        return cal.getTime();
+    }
+
+    /**
+     * 获取本月结束的时间的字符串
+     */
+    public static String getMonthEndTimeStr() {
+        Calendar cal = Calendar.getInstance();
+        cal.set(cal.get(Calendar.YEAR), cal.get(Calendar.MONTH), cal.get(Calendar.DAY_OF_MONTH), 0, 0, 0);
+        cal.set(Calendar.DAY_OF_MONTH, cal.getActualMaximum(Calendar.DAY_OF_MONTH));
+        cal.set(Calendar.HOUR_OF_DAY, 24);
+        SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd 23:59:59");
+        return format.format(cal.getTime());
+    }
+
+    /**
+     * 获取当月的 天数
+     */
+    public static int getCurrentMonthDay() {
+        Calendar a = Calendar.getInstance();
+        a.set(Calendar.DATE, 1);
+        a.roll(Calendar.DATE, -1);
+        return a.get(Calendar.DATE);
+    }
+
+    /**
+     * 得到二个日期间的间隔天数
+     */
+    public static int getDayByTwoDay(String date1, String date2) {
+        SimpleDateFormat myFormatter = new SimpleDateFormat("yyyy-MM-dd");
+        long day;
+        try {
+            Date date = myFormatter.parse(date1);
+            Date myDate = myFormatter.parse(date2);
+            day = (date.getTime() - myDate.getTime()) / (24 * 60 * 60 * 1000);
+        } catch (Exception e) {
+            return 0;
+        }
+        return (int) day;
+    }
+
+    /**
+     * 得到两个日期相差的秒数
+     */
+    public static int getSecondByTwoDay(Date lastDate, Date date) {
+        long second;
+        try {
+            second = (lastDate.getTime() - date.getTime()) / 1000;
+        } catch (Exception e) {
+            return 0;
+        }
+        return (int) second;
+    }
+
+    /**
+     * 判断某个日期属于本周的第几天 (星期一代表第一天)
+     */
+    public static int getDaysByWeek(String dateTime) throws ParseException {
+        Calendar cal = Calendar.getInstance();
+        SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd");
+        Date date = dateFormat.parse(dateTime);
+        cal.setTime(date);
+        int day = cal.get(Calendar.DAY_OF_WEEK);
+        day = day - 1;
+        if (day == 0) {
+            day = 7;
+        }
+        return day;
+    }
+
+    /**
+     * 判断某个日期属于本月的第几天
+     */
+    public static int getDaysByMonth(String dateTime) throws ParseException {
+        Calendar cal = Calendar.getInstance();
+        SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd");
+        Date date = dateFormat.parse(dateTime);
+        cal.setTime(date);
+        return cal.get(Calendar.DAY_OF_MONTH);
+    }
+
+    /**
+     * 根据年 月 获取对应的月份 天数
+     */
+    public static int getDaysByYearMonth(int year, int month) {
+        Calendar a = Calendar.getInstance();
+        a.set(Calendar.YEAR, year);
+        a.set(Calendar.MONTH, month - 1);
+        a.set(Calendar.DATE, 1);
+        a.roll(Calendar.DATE, -1);
+        return a.get(Calendar.DATE);
+    }
+
+
+    /**
+     * 获取当前的年
+     */
+    public static Integer getYears() {
+        Calendar calendar = new GregorianCalendar(TimeZone
+                .getDefault());
+        return calendar.get(Calendar.YEAR);
+    }
+
+    /**
+     * 获取当前的月
+     */
+    public static Integer getMonth() {
+        Calendar calendar = new GregorianCalendar(TimeZone
+                .getDefault());
+        return calendar.get(Calendar.MONTH) + 1;
+    }
+
+    /**
+     * 获取当前天
+     */
+    public static Integer getDay() {
+        Calendar calendar = new GregorianCalendar(TimeZone
+                .getDefault());
+        return calendar.get(Calendar.DAY_OF_MONTH);
+    }
+
+    /**
+     * wx支付的过期时间
+     */
+    public static String getTime(double hour) {
+        long time = (long) (System.currentTimeMillis() + hour * 60 * 60 * 1000L);
+        Date date = new Date(time);
+        SimpleDateFormat format = new SimpleDateFormat("yyyyMMddHHmmss");
+        return format.format(date);
+    }
+
+    /**
+     * 获得当前日期与本周日相差的天数
+     */
+    private static int getMondayPlus() {
+        Calendar cd = Calendar.getInstance();
+        // 获得今天是一周的第几天,星期日是第一天,星期二是第二天......
+        // 因为按中国礼拜一作为第一天所以这里减1
+        int dayOfWeek = cd.get(Calendar.DAY_OF_WEEK) - 1;
+        if (dayOfWeek == 1) {
+            return 0;
+        } else {
+            return 1 - dayOfWeek;
+        }
+    }
+
+    /**
+     * 获取几天之后的日期
+     *
+     * @param date yyyy-MM-dd HH:mm:ss
+     * @param day  加减的天数
+     */
+    public static Date getDate(String date, int day) {
+        SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
+        Calendar cal = Calendar.getInstance();
+        Date beforeDate;
+        try {
+            beforeDate = format.parse(date);
+            cal.setTime(beforeDate);
+            cal.add(Calendar.DAY_OF_MONTH, day);
+            return cal.getTime();
+        } catch (ParseException e) {
+            e.printStackTrace();
+        }
+        return null;
+    }
+
+    /**
+     * 获取某个日期 在加上 秒数的时间
+     *
+     * @param beforeDate yyyy-MM-dd HH:mm:ss
+     * @param timeSecond 加减的秒数
+     */
+    public static String getDateStr(Date beforeDate, Long timeSecond) {
+        SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
+        try {
+            // 返回毫秒数 + 添加的毫秒数
+            Long time = beforeDate.getTime() + timeSecond * 1000;
+            return format.format(time);
+        } catch (Exception e) {
+            log.error(e.getMessage());
+        }
+        return "";
+    }
+
+    /**
+     * 把date转换成字符串
+     */
+    public static String formatDate(Date date, String code) {
+        SimpleDateFormat format = new SimpleDateFormat(code);
+        return format.format(date);
+    }
+
+    public static String formatDate(Integer timestamp, String code) {
+        if (timestamp == null || timestamp == 0) {
+            return "";
+        }
+        return formatDate(new Date(timestamp * 1000L), code);
+    }
+
+    /**
+     * 获取过去N天内的日期数组
+     *
+     * @param intervals intervals天内
+     * @param formatStr 格式化字符串   yyyy-MM-dd
+     * @return 日期数组
+     */
+    public static ArrayList<String> getDaysByN(int intervals, String formatStr) {
+        ArrayList<String> pastDaysList = new ArrayList<>();
+        for (int i = intervals - 1; i >= 0; i--) {
+            pastDaysList.add(getPastDate(i, formatStr));
+        }
+        return pastDaysList;
+    }
+
+    /**
+     * 获取过去第几天的日期
+     */
+    public static String getPastDate(int past, String formatStr) {
+        Calendar calendar = Calendar.getInstance();
+        calendar.set(Calendar.DAY_OF_YEAR, calendar.get(Calendar.DAY_OF_YEAR) - past);
+        Date today = calendar.getTime();
+        SimpleDateFormat format = new SimpleDateFormat(formatStr);
+        return format.format(today);
+    }
+
+    /**
+     * 获取某个时间段内所有日期
+     */
+    public static List<String> getDayBetweenDates(String begin, String end) {
+        Date dBegin = strToDateTime(begin);
+        Date dEnd = strToDateTime(end);
+        List<String> lDate = new ArrayList<>();
+        SimpleDateFormat sd = new SimpleDateFormat("yyyy-MM-dd");
+        lDate.add(sd.format(dBegin));
+        Calendar calBegin = Calendar.getInstance();
+        // 使用给定的 Date 设置此 Calendar 的时间
+        calBegin.setTime(dBegin);
+        Calendar calEnd = Calendar.getInstance();
+        // 使用给定的 Date 设置此 Calendar 的时间
+        calEnd.setTime(dEnd);
+        // 测试此日期是否在指定日期之后
+        while (dEnd.after(calBegin.getTime())) {
+            // 根据日历的规则,为给定的日历字段添加或减去指定的时间量
+            calBegin.add(Calendar.DAY_OF_MONTH, 1);
+            lDate.add(sd.format(calBegin.getTime()));
+        }
+        return lDate;
+    }
+
+    /**
+     * 获取服务器启动时间
+     */
+    public static Date getServerStartDate() {
+        long time = ManagementFactory.getRuntimeMXBean().getStartTime();
+        return new Date(time);
+    }
+
+    /**
+     * 计算两个时间差
+     */
+    public static String getDatePoor(Date endDate, Date nowDate) {
+        long nd = 1000 * 24 * 60 * 60;
+        long nh = 1000 * 60 * 60;
+        long nm = 1000 * 60;
+        // 获得两个时间的毫秒时间差异
+        long diff = endDate.getTime() - nowDate.getTime();
+        // 计算差多少天
+        long day = diff / nd;
+        // 计算差多少小时
+        long hour = diff % nd / nh;
+        // 计算差多少分钟
+        long min = diff % nd % nh / nm;
+        return day + "天" + hour + "小时" + min + "分钟";
+    }
+
+    public static long getTimeDiff(Date date) {
+        long NTime = date.getTime();
+        long OTime = getNowDate().getTime();
+        return (NTime - OTime) / 1000 / 60;
+    }
+
+    public static Date setDateHourAndMinute(Date date, int hour, int minute) {
+        Calendar calendar = Calendar.getInstance();
+        calendar.setTime(date);
+        calendar.set(Calendar.HOUR_OF_DAY, hour);
+        calendar.set(Calendar.MINUTE, minute);
+        calendar.set(Calendar.SECOND, 0);
+        return calendar.getTime();
+    }
+}

+ 252 - 0
src/main/java/com/example/demo/util/FileUtils.java

@@ -0,0 +1,252 @@
+package com.example.demo.util;
+
+import cn.hutool.core.io.FileUtil;
+import cn.hutool.core.util.IdUtil;
+import com.example.demo.domain.UploadFileDTO;
+import org.apache.commons.fileupload.FileItem;
+import org.apache.commons.fileupload.disk.DiskFileItemFactory;
+import org.springframework.boot.system.ApplicationHome;
+import org.springframework.stereotype.Service;
+import org.springframework.web.multipart.MultipartFile;
+import org.springframework.web.multipart.commons.CommonsMultipartFile;
+
+import java.io.*;
+import java.net.URL;
+import java.nio.charset.StandardCharsets;
+
+@Service
+public class FileUtils {
+
+    public static final String FILE_SEPARATOR = System.getProperty("file.separator");
+    public static final String COMMON_FILE = "file";
+    public static final String BACKUP_FILE = "backup";
+
+    public static String getStaticPath(String fileName) {
+        //ApplicationHome类 返回target目录层级
+        ApplicationHome ah = new ApplicationHome(FileUtils.class);
+        //获取 applicationHome 内的路径 ...\target\classes 到这一层级下
+        File file = ah.getSource();
+        //获取 file的parentFile 即最后一级之前的所有层级路径(包括盘符) 这里能获得到的最终层级为  ...\target 后续用FILE_SEPARATOR(系统路径分割通配符 即 "\") 以及fileName拼接生成存放文件的目录层级 即为根目录 root
+        String rootPath = file.getParentFile().toString() + FILE_SEPARATOR + fileName;
+        //根据上方生成的根目录路径 生成对应文件夹 没有就新建
+        File root = new File(rootPath);
+        if (!root.exists()) {
+            root.mkdir();
+        }
+        //返回的最终形式为 盘符:\项目层级\target\file
+        return rootPath;
+    }
+
+    public UploadFileDTO uploadFile(MultipartFile file) {
+        UploadFileDTO fileDTO = new UploadFileDTO();
+        //以下操作为 先取得传入文件的完整文件名 (文件名 + 后缀) 然后用FileUtil分别取出 文件名 和 不带 "." 的后缀 然后将这些内容装配进 实体中
+        //file.getOriginFilename 获取源文件
+        //FileUtil.getPrefix 返回主文件名
+        fileDTO.setName(FileUtil.getPrefix(file.getOriginalFilename()));
+        //FileUtil.extName 获取文件的扩展名(后缀名),扩展名不带 "."
+        fileDTO.setExtName(FileUtil.extName(file.getOriginalFilename()));
+        //获取目录名 用时间作为目录名称
+        String directoryName = this.getDirectoryName();
+        //用IdUtil生成的UUID 与实体中的 extName(后缀名) 拼接后作为文件名 simpleUUID与randomUUID的区别是 simpleUUID 没有 "-"
+        String fileName = IdUtil.simpleUUID() + "." + fileDTO.getExtName();
+        //将完整文件名进行装配
+        fileDTO.setFileName(fileName);
+        //生成存储文件的路径
+        String savePath = this.getSavePath(directoryName);
+        //根据生成存储文件的路径 生成对应文件夹 没有就新建
+        File directory = new File(savePath);
+        if (!directory.exists()) {
+            directory.mkdir();
+        }
+        this.saveFile(file, savePath + fileName);
+        fileDTO.setPath(FILE_SEPARATOR + directoryName + FILE_SEPARATOR + fileName);
+        fileDTO.setFileSize(file.getSize());
+        return fileDTO;
+    }
+
+    public String createDirectory() {
+        String directoryName = this.getDirectoryName();
+        String savePath = this.getSavePath(directoryName);
+        File directory = new File(savePath);
+        if (!directory.exists()) {
+            directory.mkdir();
+        }
+        return directoryName;
+    }
+
+    public void saveFile(MultipartFile file, String path) {
+        try {
+            file.transferTo(new File(path));
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+    }
+
+    public String getTempPath(String fileName) {
+        String tempPath = getStaticPath(COMMON_FILE) + FILE_SEPARATOR + "temp";
+        File file = new File(tempPath);
+        if (!file.exists()) {
+            file.mkdir();
+        }
+        return tempPath + FILE_SEPARATOR + fileName;
+    }
+
+    public String getSavePath(String directoryName) {
+        return getStaticPath(COMMON_FILE) + FILE_SEPARATOR + directoryName + FILE_SEPARATOR;
+    }
+
+    public String getDirectory(String fileName) {
+        return FILE_SEPARATOR + this.createDirectory() + FILE_SEPARATOR + fileName;
+    }
+
+    public String getDirectory2(String directoryName) {
+        return FILE_SEPARATOR + directoryName + FILE_SEPARATOR;
+    }
+
+    public String getSystemPath(String url) {
+        return getStaticPath(COMMON_FILE) + FILE_SEPARATOR + url;
+    }
+
+    public String getSystemPath() {
+        return getStaticPath(COMMON_FILE);
+    }
+
+    public String getDirectoryName() {
+        return DateUtils.getNowTimeFormat("yyyyMMdd");
+    }
+
+    public String getPath(String url) {
+        return getStaticPath(COMMON_FILE) + url;
+    }
+
+
+    public static MultipartFile fileToMultipartFile(File file) {
+        DiskFileItemFactory diskFileItemFactory = new DiskFileItemFactory(16, null);
+        FileItem item = diskFileItemFactory.createItem(file.getName(), "text/plain", true, file.getName());
+        int bytesRead = 0;
+        byte[] buffer = new byte[8192];
+        try {
+            FileInputStream fis = new FileInputStream(file);
+            OutputStream os = item.getOutputStream();
+            int len = 8192;
+            while ((bytesRead = fis.read(buffer, 0, len)) != -1){
+                os.write(buffer, 0, bytesRead);
+            }
+            os.close();
+            fis.close();
+        } catch (IOException e) {
+            e.printStackTrace();
+        }
+        return (MultipartFile)new CommonsMultipartFile(item);
+    }
+    public static File getFile(String url,String type) throws Exception {
+        //读取图片类型
+        String fileName = url.substring(url.lastIndexOf("."),url.length());
+        File file = null;
+
+        URL urlfile;
+        InputStream inStream = null;
+        OutputStream os = null;
+        try {
+            file = File.createTempFile("new_url", type);
+            //获取文件
+            urlfile = new URL(url);
+            inStream = urlfile.openStream();
+            os = new FileOutputStream(file);
+
+            int bytesRead = 0;
+            byte[] buffer = new byte[8192];
+            while ((bytesRead = inStream.read(buffer, 0, 8192)) != -1) {
+                os.write(buffer, 0, bytesRead);
+            }
+        } catch (Exception e) {
+            e.printStackTrace();
+        } finally {
+            try {
+                if (null != os) {
+                    os.close();
+                }
+                if (null != inStream) {
+                    inStream.close();
+                }
+
+            } catch (Exception e) {
+                e.printStackTrace();
+            }
+        }
+
+        return file;
+    }
+
+    public static File urlToFile(String fileUrl) {
+        String path = System.getProperty("user.dir");
+        File tmpFile = new File(path, "tmp");
+        if (!tmpFile.exists()) {
+            tmpFile.mkdirs();
+        }
+        return urlToFile(fileUrl, tmpFile);
+    }
+
+    /**
+     * @param fileUrl 资源地址
+     * @param tmpFile  临时文件
+     * @Description: 网络资源转file, 用完以后必须删除该临时文件
+     * @return: 返回值
+     */
+    public static File urlToFile(String fileUrl, File tmpFile) {
+        String fileName = fileUrl.substring(fileUrl.lastIndexOf("/"));
+        FileOutputStream downloadFile = null;
+        InputStream openStream = null;
+        File savedFile = null;
+        try {
+            savedFile = new File(tmpFile.getAbsolutePath() + fileName);
+            URL url = new URL(fileUrl);
+            java.net.HttpURLConnection connection = (java.net.HttpURLConnection) url.openConnection();
+            openStream = connection.getInputStream();
+            int index;
+            byte[] bytes = new byte[1024];
+            downloadFile = new FileOutputStream(savedFile);
+            while ((index = openStream.read(bytes)) != -1) {
+                downloadFile.write(bytes, 0, index);
+                downloadFile.flush();
+            }
+        } catch (Exception e) {
+            e.printStackTrace();
+        } finally {
+            try {
+                if (openStream != null) {
+                    openStream.close();
+                }
+                if (downloadFile != null) {
+                    downloadFile.close();
+                }
+            } catch (Exception e) {
+                e.printStackTrace();
+            }
+        }
+        return savedFile;
+    }
+
+    public static MultipartFile urlToMultipartFile(String  url,String type) throws Exception {
+        File file =FileUtils.getFile(url,type);
+        DiskFileItemFactory diskFileItemFactory = new DiskFileItemFactory(16, null);
+        FileItem item = diskFileItemFactory.createItem(file.getName(), "text/plain", true, file.getName());
+        int bytesRead = 0;
+        byte[] buffer = new byte[8192];
+        try {
+            FileInputStream fis = new FileInputStream(file);
+            OutputStream os = item.getOutputStream();
+            int len = 8192;
+            while ((bytesRead = fis.read(buffer, 0, len)) != -1){
+                os.write(buffer, 0, bytesRead);
+            }
+            os.close();
+            fis.close();
+        } catch (IOException e) {
+            e.printStackTrace();
+        }
+        return (MultipartFile)new CommonsMultipartFile(item);
+    }
+
+}
+

+ 313 - 0
src/main/java/com/example/demo/util/JsonUtils.java

@@ -0,0 +1,313 @@
+package com.example.demo.util;
+
+import com.fasterxml.jackson.databind.JavaType;
+import com.fasterxml.jackson.databind.ObjectMapper;
+import com.google.gson.Gson;
+import com.google.gson.GsonBuilder;
+import com.google.gson.JsonElement;
+import com.google.gson.JsonSyntaxException;
+import com.google.gson.reflect.TypeToken;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import java.lang.reflect.InvocationTargetException;
+import java.lang.reflect.Method;
+import java.lang.reflect.Modifier;
+import java.lang.reflect.Type;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+
+/**
+ * json解析的工具类
+ */
+public class JsonUtils {
+
+    // 定义jackson对象
+    private static final ObjectMapper MAPPER = new ObjectMapper();
+    public static Logger log = LoggerFactory.getLogger(JsonUtils.class);
+
+    /**
+     * 把对象转换为json数据
+     *
+     * @param obj
+     * @return 2018年5月7日  下午5:27:16
+     */
+    public static String objectToJson(Object obj) {
+        Gson gson = new GsonBuilder().setDateFormat("yyyy-MM-dd HH:mm:ss").create();
+        try {
+            String json = gson.toJson(obj);
+            return json;
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+        return null;
+    }
+
+    /**
+     * 将Object转换成Map
+     *
+     * @param obj
+     * @return
+     */
+    public static Map<String, Object> objectToMap(Object obj) {
+
+        try {
+            Gson gson = new GsonBuilder().setDateFormat("yyyy-MM-dd HH:mm:ss").create();
+            String json = gson.toJson(obj);
+            return jsonToMap(json);
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+        return null;
+    }
+
+    /**
+     * 将Object类型的map转换成String类型
+     *
+     * @param map
+     * @return
+     */
+    public static Map<String, String> mapToMap(Map<String, Object> map) {
+        Map<String, String> returnMap = new HashMap<>();
+        for (String key : map.keySet()) {
+            returnMap.put(key, String.valueOf(map.get(key)));
+        }
+        return returnMap;
+    }
+
+    /**
+     * 任意类型转换成Map
+     * @return
+     */
+    public static Map<String, String> object2Map(Object obj) {
+        Map<String, String> hashMap = new HashMap();
+        try {
+            Class c = obj.getClass();
+            Method m[] = c.getDeclaredMethods();
+            for (int i = 0; i < m.length; i++) {
+                if (m[i].getName().indexOf("get")==0) {
+                    // 得到Map的key
+                    String suffixKey = m[i].getName().substring(4);
+                    String prefixKey = m[i].getName().substring(3,4).toLowerCase();
+                    hashMap.put(prefixKey + suffixKey, String.valueOf(m[i].invoke(obj, new Object[0])));
+                }
+            }
+        } catch (Throwable e) {
+            log.error(e.getMessage());
+        }
+        return hashMap;
+    }
+
+
+    /**
+     * 把json字符串转化为对象
+     *
+     * @param jsonString
+     * @param clazz
+     * @return
+     */
+    public static Object jsonToObject(String jsonString, Class<?> clazz) {
+
+        Gson gson = new GsonBuilder().setDateFormat("yyyy-MM-dd HH:mm:ss").create();
+        Object obj = null;
+        try {
+            obj = gson.fromJson(jsonString, clazz);
+        } catch (JsonSyntaxException e) {
+            e.printStackTrace();
+        }
+        return obj;
+    }
+
+    /**
+     * josn转arrayList
+     *
+     * @param jsonArray
+     * @return
+     */
+    public static ArrayList<?> jsonArrayToArrayList(String jsonArray) {
+
+        Gson gson = new GsonBuilder()
+                .excludeFieldsWithModifiers(Modifier.FINAL, Modifier.TRANSIENT, Modifier.STATIC)
+                .setDateFormat("yyyy-MM-dd HH:mm:ss")
+                .serializeNulls()
+                .create();
+        ArrayList<?> list = null;
+        try {
+            Type listType = new TypeToken<ArrayList<?>>() {
+            }.getType();
+
+            list = gson.fromJson(jsonArray, listType);
+        } catch (JsonSyntaxException e) {
+            e.printStackTrace();
+        }
+        return list;
+    }
+
+    /**
+     * JSON 转 ArrayList
+     */
+    public static ArrayList<?> jsonArrayToArrayList(String jsonArray, Class<?> clazz) {
+
+        Gson gson = new GsonBuilder()
+                .excludeFieldsWithModifiers(Modifier.FINAL, Modifier.TRANSIENT, Modifier.STATIC)
+                .setDateFormat("yyyy-MM-dd HH:mm:ss")
+                .serializeNulls()
+                .create();
+        ArrayList<?> list = null;
+        try {
+
+            list = (ArrayList<?>) gson.fromJson(jsonArray, clazz);
+        } catch (JsonSyntaxException e) {
+            e.printStackTrace();
+        }
+        return list;
+    }
+
+    /**
+     * 把json转换为map类型的数据
+     *
+     * @param json
+     * @return
+     */
+    public static Map<String, Object> jsonToMap(String json) {
+
+        Gson gson = new GsonBuilder()
+                .excludeFieldsWithModifiers(Modifier.FINAL, Modifier.TRANSIENT, Modifier.STATIC)
+                .setDateFormat("yyyy-MM-dd HH:mm:ss")
+                .serializeNulls()
+                .create();
+        Map<String, Object> map = null;
+        try {
+            Type type = new TypeToken<Map<String, Object>>() {
+            }.getType();
+
+            map = gson.fromJson(json, type);
+        } catch (JsonSyntaxException e) {
+            e.printStackTrace();
+        }
+        return map;
+    }
+
+    /**
+     * 将Json转换成Map<String, ?>
+     *
+     * @param json
+     * @param clazz
+     * @return
+     */
+    public static Map<String, ?> jsonToMap(String json, Class<?> clazz) {
+
+        Gson gson = new GsonBuilder()
+                .excludeFieldsWithModifiers(Modifier.FINAL, Modifier.TRANSIENT, Modifier.STATIC)
+                .setDateFormat("yyyy-MM-dd HH:mm:ss")
+                .serializeNulls()
+                .create();
+        Map<String, ?> map = null;
+        try {
+            Type type = new TypeToken<Map<String, ?>>() {
+            }.getType();
+
+            map = gson.fromJson(json, type);
+        } catch (JsonSyntaxException e) {
+            e.printStackTrace();
+        }
+        return map;
+    }
+
+    /**
+     * 将map转换成pojo
+     *
+     * @param map
+     * @param beanType
+     * @param <T>
+     * @return
+     */
+    public static <T> T mapToPojo(Map<String, Object> map, Class<T> beanType) {
+
+        Gson gson = new GsonBuilder()
+                .excludeFieldsWithModifiers(Modifier.FINAL, Modifier.TRANSIENT, Modifier.STATIC)
+                .setDateFormat("yyyy-MM-dd HH:mm:ss")
+                .serializeNulls()
+                .create();
+
+        JsonElement jsonElement = gson.toJsonTree(map);
+        T pojo = gson.fromJson(jsonElement, beanType);
+
+        return pojo;
+    }
+
+    /**
+     * 将json结果集转化为对象
+     *
+     * @param jsonData
+     * @param beanType
+     * @param <T>
+     * @return
+     */
+    public static <T> T jsonToPojo(String jsonData, Class<T> beanType) {
+        try {
+            T t = MAPPER.readValue(jsonData, beanType);
+            return t;
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+        return null;
+    }
+
+    /**
+     * 将json数据转换成pojo对象list
+     *
+     * @param jsonData
+     * @param beanType
+     * @return
+     */
+    public static <T> List<T> jsonToList(String jsonData, Class<T> beanType) {
+        JavaType javaType = MAPPER.getTypeFactory().constructParametricType(List.class, beanType);
+        try {
+            List<T> list = MAPPER.readValue(jsonData, javaType);
+            return list;
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+        return null;
+    }
+
+
+    /**
+     * 将任意pojo转化成map
+     *
+     * @param t pojo对象
+     * @return
+     */
+    public static <T> Map<String, Object> pojoToMap(T t) {
+        Map<String, Object> result = new HashMap<String, Object>();
+        Method[] methods = t.getClass().getMethods();
+        try {
+            for (Method method : methods) {
+                Class<?>[] paramClass = method.getParameterTypes();
+                // 如果方法带参数,则跳过
+                if (paramClass.length > 0) {
+                    continue;
+                }
+                String methodName = method.getName();
+                if (methodName.startsWith("get")) {
+                    Object value = method.invoke(t);
+                    result.put(methodName, value);
+                }
+            }
+        } catch (IllegalArgumentException e) {
+            e.printStackTrace();
+        } catch (IllegalAccessException e) {
+            e.printStackTrace();
+        } catch (InvocationTargetException e) {
+            e.printStackTrace();
+        } catch (SecurityException e) {
+            e.printStackTrace();
+        }
+        return result;
+    }
+
+}

+ 102 - 0
src/main/java/com/example/demo/util/Response.java

@@ -0,0 +1,102 @@
+package com.example.demo.util;
+
+public class Response {
+
+    private Integer code;
+    private Object data;
+    private String message;
+
+    public static String success() {
+        Response response = new Response();
+        response.setResultEnum(ResponseEnum.SUCCESS);
+        return JsonUtils.objectToJson(response);
+    }
+
+    public static String success(Object data) {
+        Response response = new Response();
+        response.setResultEnum(ResponseEnum.SUCCESS);
+        response.setData(data);
+        return JsonUtils.objectToJson(response);
+    }
+
+    public static String successBut(Object data) {
+        Response response = new Response();
+        response.setResultEnum(ResponseEnum.SUCCESSBUT);
+        response.setData(data);
+        return JsonUtils.objectToJson(response);
+    }
+    /**
+     * 陈宇 ↓ 直接返回对象(前台默认显示为jsonResult格式对象)
+     */
+    public static Response success2(Object data) {
+        Response response = new Response();
+        response.setResultEnum(ResponseEnum.SUCCESS);
+        response.setData(data);
+        return response;
+    }
+
+    public static String websocket(Object data, ResponseEnum responseEnum) {
+        Response response = new Response();
+        response.setResultEnum(responseEnum);
+        response.setData(data);
+        return JsonUtils.objectToJson(response);
+    }
+
+    public static String error() {
+        Response response = new Response();
+        response.setData(Boolean.FALSE);
+        response.setResultEnum(ResponseEnum.ERROR);
+        return JsonUtils.objectToJson(response);
+    }
+
+    public static String error(String message) {
+        Response response = new Response();
+        response.setCode(ResponseEnum.ERROR.getCode());
+        response.setData(Boolean.FALSE);
+        response.setMessage(message);
+        return JsonUtils.objectToJson(response);
+    }
+
+    public static String error(ResponseEnum responseEnum) {
+        Response response = new Response();
+        response.setResultEnum(responseEnum);
+        return JsonUtils.objectToJson(response);
+    }
+
+    public Response(Integer code, String message) {
+        this.code = code;
+        this.message = message;
+    }
+
+    public Response() {
+    }
+
+    public Object getData() {
+        return data;
+    }
+
+    public void setData(Object data) {
+        this.data = data;
+    }
+
+    public Integer getCode() {
+        return code;
+    }
+
+    public void setCode(Integer code) {
+        this.code = code;
+    }
+
+    public String getMessage() {
+        return message;
+    }
+
+    public void setMessage(String message) {
+        this.message = message;
+    }
+
+    private void setResultEnum(ResponseEnum responseEnum) {
+        this.code = responseEnum.getCode();
+        this.message = responseEnum.getMessage();
+    }
+}

+ 50 - 0
src/main/java/com/example/demo/util/ResponseEnum.java

@@ -0,0 +1,50 @@
+package com.example.demo.util;
+
+public enum ResponseEnum {
+
+    SUCCESS(200, "请求成功"),
+    WEB_SOCKET_SUCCESS(2, "WebSocket请求成功"),
+    BATCH_UPLOAD_INSTRUCTION_TASK_SUCCESS(900, "WebSocket请求成功"),
+    PROJECT_IMPORT_TASK_SUCCESS(901, "WebSocket请求成功"),
+    PROJECT_EXPORT_TASK_SUCCESS(902, "WebSocket请求成功"),
+    PATENT_IMPORT_TASK_SUCCESS(903, "WebSocket请求成功"),
+    PATENT_EXPORT_TASK_SUCCESS(904, "WebSocket请求成功"),
+    UNAUTHORIZED(401, "未登录"),
+    NOT_PERMISSION(402, "无操作权限"),
+    FORBIDDEN(403, "拒绝访问"),
+    USERNAME_ERROR(0, "用户名不存在"),
+    PASSWORD_ERROR(0, "密码错误"),
+    VERIFY_CODE_ERROR(0, "验证码错误"),
+    QUERY_CACHE_ERROR(0, "专利检索缓存失效,请重试"),
+    BATCH_UPLOAD_INSTRUCTION_TASK_ERROR(800, "导入说明书失败"),
+    PROJECT_EXPORT_TASK_ERROR(802, "专题库数据导出失败"),
+    PATENT_IMPORT_TASK_ERROR(803, "专利导入专利失败"),
+    PATENT_EXPORT_TASK_ERROR(804, "专利导出专利失败"),
+    SYSTEM_ERROR(500, "系统异常"),
+    SUCCESSBUT(200, "请求成功"),
+    ERROR(0, "请求失败");
+
+    private Integer code;
+    private String message;
+
+    ResponseEnum(Integer code, String message) {
+        this.code = code;
+        this.message = message;
+    }
+
+    public Integer getCode() {
+        return code;
+    }
+
+    public void setCode(Integer code) {
+        this.code = code;
+    }
+
+    public String getMessage() {
+        return message;
+    }
+
+    public void setMessage(String message) {
+        this.message = message;
+    }
+}

+ 50 - 0
src/main/resources/application.yml

@@ -0,0 +1,50 @@
+server:
+  port: 8111
+
+spring:
+  datasource:
+    url: jdbc:mysql://192.168.1.24:3306/pas?autoReconnect=true&useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=CONVERT_TO_NULL&useSSL=false&serverTimezone=GMT%2B8
+    username: root
+    password: rrzTwWAYX8Gxh5JH
+    driver-class-name: com.mysql.cj.jdbc.Driver
+    type: com.alibaba.druid.pool.DruidDataSource
+    druid:
+      stat-view-servlet:
+        login-username: admin
+        login-password: 123456
+      web-stat-filter:
+        exclusions: "*.js,*.gif,*.jpg,*.png,*.css,*.ico,/druid/*"
+  quartz:
+    #相关属性配置
+    properties:
+      org:
+        quartz:
+          scheduler:
+            instanceName: DefaultQuartzScheduler
+            instanceId: AUTO
+          jobStore:
+            class: org.springframework.scheduling.quartz.LocalDataSourceJobStore
+            driverDelegateClass: org.quartz.impl.jdbcjobstore.StdJDBCDelegate
+            tablePrefix: QRTZ_
+            isClustered: false
+            clusterCheckinInterval: 10000
+            useProperties: true
+          threadPool:
+            class: org.quartz.simpl.SimpleThreadPool
+            threadCount: 10
+            threadPriority: 5
+            threadsInheritContextClassLoaderOfInitializingThread: true
+          dataSource:
+            default:
+              URL: jdbc:mysql://192.168.1.24:3306/pas?autoReconnect=true&useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=CONVERT_TO_NULL&useSSL=false&serverTimezone=GMT%2B8
+              user: root
+              password: rrzTwWAYX8Gxh5JH
+              driver: com.mysql.jdbc.Driver
+
+    #数据库方式
+    job-store-type: jdbc
+    #初始化表结构
+    jdbc:
+     initialize-schema: never
+PCSUrl: http://localhost:8871
+PASUrl: http://localhost:8877

BIN
src/main/resources/chromedriver.exe