浏览代码

初次提交

zsy 1 年之前
当前提交
ff3347b710
共有 100 个文件被更改,包括 8132 次插入0 次删除
  1. 20 0
      .gitignore
  2. 3 0
      README.md
  3. 155 0
      build.gradle
  4. 234 0
      gradlew
  5. 89 0
      gradlew.bat
  6. 5 0
      h2p/export_pdf/.idea/.gitignore
  7. 12 0
      h2p/export_pdf/.idea/export_pdf.iml
  8. 8 0
      h2p/export_pdf/.idea/modules.xml
  9. 0 0
      h2p/export_pdf/css/index.css
  10. 342 0
      h2p/export_pdf/export-sh.html
  11. 341 0
      h2p/export_pdf/export-wlf.html
  12. 341 0
      h2p/export_pdf/export.html
  13. 34 0
      h2p/export_pdf/js/echarts.min.js
  14. 0 0
      h2p/export_pdf/js/index.js
  15. 5 0
      h2p/export_pdf/js/vue@2
  16. 817 0
      h2p/export_pdf/miniprogramReport.html
  17. 379 0
      h2p/export_pdf/miniprogramScaleDetail.html
  18. 24 0
      h2p/export_pdf/promptResource.html
  19. 1 0
      settings.gradle
  20. 168 0
      src/main/java/com/rf/psychological/PsychologicalApplication.java
  21. 464 0
      src/main/java/com/rf/psychological/SoftKey.java
  22. 196 0
      src/main/java/com/rf/psychological/TestPush.java
  23. 669 0
      src/main/java/com/rf/psychological/api/SubjectApi.java
  24. 208 0
      src/main/java/com/rf/psychological/api/UserApi.java
  25. 37 0
      src/main/java/com/rf/psychological/api/key/dao/model/KeyEntity.java
  26. 8 0
      src/main/java/com/rf/psychological/api/key/dao/repository/KeyRepository.java
  27. 52 0
      src/main/java/com/rf/psychological/api/key/rest/KeyApi.java
  28. 19 0
      src/main/java/com/rf/psychological/api/key/service/KeyService.java
  29. 57 0
      src/main/java/com/rf/psychological/api/key/service/impl/KeyServiceImpl.java
  30. 37 0
      src/main/java/com/rf/psychological/base/model/BaseEntity.java
  31. 4 0
      src/main/java/com/rf/psychological/base/package-info.java
  32. 19 0
      src/main/java/com/rf/psychological/base/repository/BaseRepository.java
  33. 77 0
      src/main/java/com/rf/psychological/base/rest/BaseController.java
  34. 46 0
      src/main/java/com/rf/psychological/config/CorsConfig.java
  35. 24 0
      src/main/java/com/rf/psychological/config/Properties.java
  36. 109 0
      src/main/java/com/rf/psychological/config/RedisConfig.java
  37. 54 0
      src/main/java/com/rf/psychological/config/Swagger2Config.java
  38. 25 0
      src/main/java/com/rf/psychological/config/SystemExcludeFilter.java
  39. 25 0
      src/main/java/com/rf/psychological/dao/cognizeModel/BSNTaskEntity.java
  40. 27 0
      src/main/java/com/rf/psychological/dao/cognizeModel/ECATEntity.java
  41. 31 0
      src/main/java/com/rf/psychological/dao/cognizeModel/EMEMEntity.java
  42. 30 0
      src/main/java/com/rf/psychological/dao/cognizeModel/ETB01Entity.java
  43. 32 0
      src/main/java/com/rf/psychological/dao/cognizeModel/FDOTEntity.java
  44. 112 0
      src/main/java/com/rf/psychological/dao/dto/CognitiveTaskEntityDto.java
  45. 64 0
      src/main/java/com/rf/psychological/dao/dto/InstitutionAuthConTaskDto.java
  46. 253 0
      src/main/java/com/rf/psychological/dao/dto/InstitutionAuthSubjectNameDto.java
  47. 16 0
      src/main/java/com/rf/psychological/dao/dto/InstitutionRecordingDTO.java
  48. 39 0
      src/main/java/com/rf/psychological/dao/dto/InstitutionRecordingUserApiDTO.java
  49. 50 0
      src/main/java/com/rf/psychological/dao/dto/InstitutionRecordingUserDTO.java
  50. 66 0
      src/main/java/com/rf/psychological/dao/dto/InstitutionRecordingUsersDTO.java
  51. 18 0
      src/main/java/com/rf/psychological/dao/dto/JpaDto.java
  52. 99 0
      src/main/java/com/rf/psychological/dao/dto/JpaDtoConfig.java
  53. 21 0
      src/main/java/com/rf/psychological/dao/dto/ProgressDto.java
  54. 74 0
      src/main/java/com/rf/psychological/dao/dto/SubjectEntityDto.java
  55. 56 0
      src/main/java/com/rf/psychological/dao/dto/UserRecordsDto.java
  56. 36 0
      src/main/java/com/rf/psychological/dao/dto/scale/NewResultDto.java
  57. 2 0
      src/main/java/com/rf/psychological/dao/lombok.config
  58. 50 0
      src/main/java/com/rf/psychological/dao/model/ANTEntity.java
  59. 66 0
      src/main/java/com/rf/psychological/dao/model/ANTFISHV2Entity.java
  60. 55 0
      src/main/java/com/rf/psychological/dao/model/ASKEntity.java
  61. 68 0
      src/main/java/com/rf/psychological/dao/model/AnswerEntity.java
  62. 40 0
      src/main/java/com/rf/psychological/dao/model/AviationEntity.java
  63. 35 0
      src/main/java/com/rf/psychological/dao/model/CategorySubjectEntity.java
  64. 56 0
      src/main/java/com/rf/psychological/dao/model/CattellEntity.java
  65. 84 0
      src/main/java/com/rf/psychological/dao/model/CognitiveTaskEntity.java
  66. 30 0
      src/main/java/com/rf/psychological/dao/model/DSTEntity.java
  67. 53 0
      src/main/java/com/rf/psychological/dao/model/DepressEntity.java
  68. 59 0
      src/main/java/com/rf/psychological/dao/model/DimensionEntity.java
  69. 58 0
      src/main/java/com/rf/psychological/dao/model/EATEntity.java
  70. 43 0
      src/main/java/com/rf/psychological/dao/model/EPRTEntity.java
  71. 47 0
      src/main/java/com/rf/psychological/dao/model/GBEEntity.java
  72. 50 0
      src/main/java/com/rf/psychological/dao/model/GONOGO2Entity.java
  73. 39 0
      src/main/java/com/rf/psychological/dao/model/GONOGOADDICTIONEntity.java
  74. 39 0
      src/main/java/com/rf/psychological/dao/model/GONOGOEntity.java
  75. 54 0
      src/main/java/com/rf/psychological/dao/model/GTCTEntity.java
  76. 31 0
      src/main/java/com/rf/psychological/dao/model/HaiKongJiZhanAndTanKeHongLiuEntity.java
  77. 48 0
      src/main/java/com/rf/psychological/dao/model/HearingTestEntity.java
  78. 38 0
      src/main/java/com/rf/psychological/dao/model/LifeEntity.java
  79. 72 0
      src/main/java/com/rf/psychological/dao/model/MemoryCheckEntity.java
  80. 46 0
      src/main/java/com/rf/psychological/dao/model/MemoryEntity.java
  81. 55 0
      src/main/java/com/rf/psychological/dao/model/MemoryTestEntity.java
  82. 46 0
      src/main/java/com/rf/psychological/dao/model/MoodEntity.java
  83. 52 0
      src/main/java/com/rf/psychological/dao/model/MovementEntity.java
  84. 27 0
      src/main/java/com/rf/psychological/dao/model/ObjectEntity.java
  85. 51 0
      src/main/java/com/rf/psychological/dao/model/POMSEntity.java
  86. 50 0
      src/main/java/com/rf/psychological/dao/model/PSQIEntity.java
  87. 38 0
      src/main/java/com/rf/psychological/dao/model/RDTEntity.java
  88. 19 0
      src/main/java/com/rf/psychological/dao/model/ReturnEntity.java
  89. 44 0
      src/main/java/com/rf/psychological/dao/model/RhythmEntity.java
  90. 38 0
      src/main/java/com/rf/psychological/dao/model/SCEntity.java
  91. 41 0
      src/main/java/com/rf/psychological/dao/model/SCLEntity.java
  92. 39 0
      src/main/java/com/rf/psychological/dao/model/SHAPE2Entity.java
  93. 48 0
      src/main/java/com/rf/psychological/dao/model/STFSEntity.java
  94. 44 0
      src/main/java/com/rf/psychological/dao/model/STROOPTASKEntity.java
  95. 24 0
      src/main/java/com/rf/psychological/dao/model/STTEntity.java
  96. 56 0
      src/main/java/com/rf/psychological/dao/model/StatusEntity.java
  97. 35 0
      src/main/java/com/rf/psychological/dao/model/StroopEntity.java
  98. 50 0
      src/main/java/com/rf/psychological/dao/model/SupportEntity.java
  99. 35 0
      src/main/java/com/rf/psychological/dao/model/TypeEntity.java
  100. 45 0
      src/main/java/com/rf/psychological/dao/model/WebMemoryEntity.java

+ 20 - 0
.gitignore

@@ -0,0 +1,20 @@
+# ---> Java
+*.class
+
+# Mobile Tools for Java (J2ME)
+.mtj.tmp/
+
+# Package Files #
+*.jar
+*.war
+*.ear
+
+# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
+hs_err_pid*
+
+/.gradle/
+/build/
+/logs/
+/gradle/
+/.idea/
+/.local-browser/

+ 3 - 0
README.md

@@ -0,0 +1,3 @@
+# psychological_camera
+
+review code

+ 155 - 0
build.gradle

@@ -0,0 +1,155 @@
+buildscript {
+	ext {
+		queryDslVersion = '4.2.1'
+		lombokVersion = '1.18.12'
+	}
+}
+plugins {
+	id 'org.springframework.boot' version '2.4.2'
+	id 'io.spring.dependency-management' version '1.0.11.RELEASE'
+	id 'java'
+}
+
+group = 'com.rf'
+version = 'v1.1-'+getNewVersion()
+sourceCompatibility = '8'
+
+configurations {
+	compileOnly {
+		extendsFrom annotationProcessor
+	}
+}
+
+repositories {
+	maven {
+		url 'https://maven.aliyun.com/repository/public'
+	}
+	maven {
+		credentials {
+			username '0p07qf'
+			password 'z1XwdFEf4M'
+		}
+		url 'https://repo.rdc.aliyun.com/repository/107260-release-GqdtcU/'
+	}
+	maven {
+		credentials {
+			username '0p07qf'
+			password 'z1XwdFEf4M'
+		}
+		url 'https://repo.rdc.aliyun.com/repository/107260-snapshot-C6ziam/'
+	}
+	maven {
+		url "https://plugins.gradle.org/m2/"
+	}
+	mavenLocal()
+}
+
+dependencies {
+	implementation 'org.springframework.boot:spring-boot-starter-data-jpa'
+	implementation 'org.springframework.boot:spring-boot-starter-web'
+	compileOnly 'org.projectlombok:lombok'
+	annotationProcessor 'org.projectlombok:lombok'
+//	testImplementation 'org.springframework.boot:spring-boot-starter-test'
+////	classpath "gradle.plugin.com.ewerk.gradle.plugins:querydsl-plugin:1.0.10"
+//	// https://mvnrepository.com/artifact/com.querydsl/querydsl-apt
+//	compile group: 'com.querydsl', name: 'querydsl-apt', version: '4.2.1'
+	// https://mvnrepository.com/artifact/org.springframework.boot/spring-boot-starter-validation
+	implementation 'org.springframework.boot:spring-boot-starter-validation:2.6.3'
+
+//	// https://mvnrepository.com/artifact/org.springframework.data/spring-data-commons
+//	compile group: 'org.springframework.data', name: 'spring-data-commons', version: '2.4.1'
+	// https://mvnrepository.com/artifact/mysql/mysql-connector-java
+	implementation 'mysql:mysql-connector-java:8.0.21'
+
+//	compile group: 'com.querydsl', name: 'querydsl-jpa', version: '4.2.1'
+//	compile group: 'com.querydsl', name: 'querydsl-apt', version: '4.2.1'
+	// QueryDSL
+	implementation("com.querydsl:querydsl-core:${queryDslVersion}")
+	implementation("com.querydsl:querydsl-jpa:${queryDslVersion}")
+	//关键地方(记得开启annotationProcessor)
+	annotationProcessor("com.querydsl:querydsl-apt:${queryDslVersion}:jpa",
+			"org.hibernate.javax.persistence:hibernate-jpa-2.1-api:1.0.2.Final",
+			"javax.annotation:javax.annotation-api:1.3.2",
+			"org.projectlombok:lombok")
+
+	// Lombok(记得安装IDEA插件)
+	compileOnly "org.projectlombok:lombok:${lombokVersion}"
+	annotationProcessor "org.projectlombok:lombok:${lombokVersion}"
+	implementation("org.projectlombok:lombok:${lombokVersion}")
+	// https://mvnrepository.com/artifact/org.springframework.boot/spring-boot-starter-test
+	testImplementation 'org.springframework.boot:spring-boot-starter-test:2.6.3'
+
+	// https://mvnrepository.com/artifact/com.alibaba/fastjson
+	implementation 'com.alibaba:fastjson:1.2.83'
+	// https://mvnrepository.com/artifact/org.apache.poi/poi-ooxml
+	implementation 'org.apache.poi:poi-ooxml:3.17'
+
+	// https://mvnrepository.com/artifact/commons-lang/commons-lang
+	implementation 'commons-lang:commons-lang:2.6'
+
+	// https://mvnrepository.com/artifact/io.springfox/springfox-swagger2
+	implementation group: 'io.springfox', name: 'springfox-swagger2', version: '2.9.2'
+	// https://mvnrepository.com/artifact/io.springfox/springfox-swagger-ui
+	implementation group: 'io.springfox', name: 'springfox-swagger-ui', version: '2.9.2'
+	// https://mvnrepository.com/artifact/io.swagger/swagger-annotations
+	implementation group: 'io.swagger', name: 'swagger-annotations', version: '1.5.22'
+	implementation group: 'io.swagger', name: 'swagger-models', version: '1.5.22'
+
+	// https://mvnrepository.com/artifact/commons-fileupload/commons-fileupload
+	implementation group: 'commons-fileupload', name: 'commons-fileupload', version: '1.3.1'
+	// https://mvnrepository.com/artifact/com.github.qcloudsms/qcloudsms
+	implementation group: 'com.github.qcloudsms', name: 'qcloudsms', version: '1.0.6'
+	// https://mvnrepository.com/artifact/cn.keking.project/kk-anti-reptile
+	implementation group: 'cn.keking.project', name: 'kk-anti-reptile', version: '1.0.0-RELEASE'
+	// https://mvnrepository.com/artifact/com.belerweb/pinyin4j
+	implementation group: 'com.belerweb', name: 'pinyin4j', version: '2.5.1'
+	// https://mvnrepository.com/artifact/org.springframework.boot/spring-boot-starter-websocket
+	implementation 'org.springframework.boot:spring-boot-starter-websocket:2.5.5'
+	//https://mvnrepository.com/artifact/org.java-websocket/Java-WebSocket
+	//implementation 'org.java-websocket:Java-WebSocket:1.3.0'
+	// https://mvnrepository.com/artifact/org.java-websocket/Java-WebSocket
+	implementation 'org.java-websocket:Java-WebSocket:1.5.1'
+	//https://github.com/auth0/java-jwt
+	// 添加jwt
+	implementation 'com.auth0:java-jwt:3.18.2'
+	// https://mvnrepository.com/artifact/com.alibaba/druid-spring-boot-starter
+	implementation group: 'com.alibaba', name: 'druid-spring-boot-starter', version: '1.2.9'
+	// https://mvnrepository.com/artifact/junit/junit
+	testImplementation group: 'junit', name: 'junit', version: '4.13.2'
+	// https://mvnrepository.com/artifact/io.github.fanyong920/jvppeteer
+	implementation "io.github.fanyong920:jvppeteer:1.1.5"
+
+
+
+
+
+	//wxpay
+	// https://mvnrepository.com/artifact/com.github.wxpay/wxpay-sdk
+	//implementation group: 'com.github.wxpay', name: 'wxpay-sdk', version: '0.0.3'
+
+	implementation 'com.github.wechatpay-apiv3:wechatpay-apache-httpclient:0.4.7'
+
+	// https://mvnrepository.com/artifact/org.springframework.boot/spring-boot-configuration-processor
+	implementation group: 'org.springframework.boot', name: 'spring-boot-configuration-processor', version: '2.6.8'
+
+	// https://mvnrepository.com/artifact/com.google.code.gson/gson
+	implementation group: 'com.google.code.gson', name: 'gson', version: '2.8.6'
+
+	// https://mvnrepository.com/artifact/cn.hutool/hutool-all
+	implementation group: 'cn.hutool', name: 'hutool-all', version: '5.7.18'
+
+	//redis
+	// https://mvnrepository.com/artifact/org.springframework.boot/spring-boot-starter-data-redis
+	implementation group: 'org.springframework.boot', name: 'spring-boot-starter-data-redis', version: '2.6.3'
+
+
+
+}
+
+test {
+	useJUnitPlatform()
+}
+
+def getNewVersion(){
+	return new Date().format("yyyyMMddHHmmss",TimeZone.getTimeZone("GMT+08:00"))
+}

+ 234 - 0
gradlew

@@ -0,0 +1,234 @@
+#!/bin/sh
+
+#
+# Copyright © 2015-2021 the original authors.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#      https://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+##############################################################################
+#
+#   Gradle start up script for POSIX generated by Gradle.
+#
+#   Important for running:
+#
+#   (1) You need a POSIX-compliant shell to run this script. If your /bin/sh is
+#       noncompliant, but you have some other compliant shell such as ksh or
+#       bash, then to run this script, type that shell name before the whole
+#       command line, like:
+#
+#           ksh Gradle
+#
+#       Busybox and similar reduced shells will NOT work, because this script
+#       requires all of these POSIX shell features:
+#         * functions;
+#         * expansions «$var», «${var}», «${var:-default}», «${var+SET}»,
+#           «${var#prefix}», «${var%suffix}», and «$( cmd )»;
+#         * compound commands having a testable exit status, especially «case»;
+#         * various built-in commands including «command», «set», and «ulimit».
+#
+#   Important for patching:
+#
+#   (2) This script targets any POSIX shell, so it avoids extensions provided
+#       by Bash, Ksh, etc; in particular arrays are avoided.
+#
+#       The "traditional" practice of packing multiple parameters into a
+#       space-separated string is a well documented source of bugs and security
+#       problems, so this is (mostly) avoided, by progressively accumulating
+#       options in "$@", and eventually passing that to Java.
+#
+#       Where the inherited environment variables (DEFAULT_JVM_OPTS, JAVA_OPTS,
+#       and GRADLE_OPTS) rely on word-splitting, this is performed explicitly;
+#       see the in-line comments for details.
+#
+#       There are tweaks for specific operating systems such as AIX, CygWin,
+#       Darwin, MinGW, and NonStop.
+#
+#   (3) This script is generated from the Groovy template
+#       https://github.com/gradle/gradle/blob/master/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
+#       within the Gradle project.
+#
+#       You can find Gradle at https://github.com/gradle/gradle/.
+#
+##############################################################################
+
+# Attempt to set APP_HOME
+
+# Resolve links: $0 may be a link
+app_path=$0
+
+# Need this for daisy-chained symlinks.
+while
+    APP_HOME=${app_path%"${app_path##*/}"}  # leaves a trailing /; empty if no leading path
+    [ -h "$app_path" ]
+do
+    ls=$( ls -ld "$app_path" )
+    link=${ls#*' -> '}
+    case $link in             #(
+      /*)   app_path=$link ;; #(
+      *)    app_path=$APP_HOME$link ;;
+    esac
+done
+
+APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit
+
+APP_NAME="Gradle"
+APP_BASE_NAME=${0##*/}
+
+# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
+DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
+
+# Use the maximum available, or set MAX_FD != -1 to use that value.
+MAX_FD=maximum
+
+warn () {
+    echo "$*"
+} >&2
+
+die () {
+    echo
+    echo "$*"
+    echo
+    exit 1
+} >&2
+
+# OS specific support (must be 'true' or 'false').
+cygwin=false
+msys=false
+darwin=false
+nonstop=false
+case "$( uname )" in                #(
+  CYGWIN* )         cygwin=true  ;; #(
+  Darwin* )         darwin=true  ;; #(
+  MSYS* | MINGW* )  msys=true    ;; #(
+  NONSTOP* )        nonstop=true ;;
+esac
+
+CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
+
+
+# Determine the Java command to use to start the JVM.
+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
+    if [ ! -x "$JAVACMD" ] ; then
+        die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
+
+Please set the JAVA_HOME variable in your environment to match the
+location of your Java installation."
+    fi
+else
+    JAVACMD=java
+    which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
+
+Please set the JAVA_HOME variable in your environment to match the
+location of your Java installation."
+fi
+
+# Increase the maximum file descriptors if we can.
+if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then
+    case $MAX_FD in #(
+      max*)
+        MAX_FD=$( ulimit -H -n ) ||
+            warn "Could not query maximum file descriptor limit"
+    esac
+    case $MAX_FD in  #(
+      '' | soft) :;; #(
+      *)
+        ulimit -n "$MAX_FD" ||
+            warn "Could not set maximum file descriptor limit to $MAX_FD"
+    esac
+fi
+
+# Collect all arguments for the java command, stacking in reverse order:
+#   * args from the command line
+#   * the main class name
+#   * -classpath
+#   * -D...appname settings
+#   * --module-path (only if needed)
+#   * DEFAULT_JVM_OPTS, JAVA_OPTS, and GRADLE_OPTS environment variables.
+
+# For Cygwin or MSYS, switch paths to Windows format before running java
+if "$cygwin" || "$msys" ; then
+    APP_HOME=$( cygpath --path --mixed "$APP_HOME" )
+    CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" )
+
+    JAVACMD=$( cygpath --unix "$JAVACMD" )
+
+    # Now convert the arguments - kludge to limit ourselves to /bin/sh
+    for arg do
+        if
+            case $arg in                                #(
+              -*)   false ;;                            # don't mess with options #(
+              /?*)  t=${arg#/} t=/${t%%/*}              # looks like a POSIX filepath
+                    [ -e "$t" ] ;;                      #(
+              *)    false ;;
+            esac
+        then
+            arg=$( cygpath --path --ignore --mixed "$arg" )
+        fi
+        # Roll the args list around exactly as many times as the number of
+        # args, so each arg winds up back in the position where it started, but
+        # possibly modified.
+        #
+        # NB: a `for` loop captures its iteration list before it begins, so
+        # changing the positional parameters here affects neither the number of
+        # iterations, nor the values presented in `arg`.
+        shift                   # remove old arg
+        set -- "$@" "$arg"      # push replacement arg
+    done
+fi
+
+# Collect all arguments for the java command;
+#   * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of
+#     shell script including quotes and variable substitutions, so put them in
+#     double quotes to make sure that they get re-expanded; and
+#   * put everything else in single quotes, so that it's not re-expanded.
+
+set -- \
+        "-Dorg.gradle.appname=$APP_BASE_NAME" \
+        -classpath "$CLASSPATH" \
+        org.gradle.wrapper.GradleWrapperMain \
+        "$@"
+
+# Use "xargs" to parse quoted args.
+#
+# With -n1 it outputs one arg per line, with the quotes and backslashes removed.
+#
+# In Bash we could simply go:
+#
+#   readarray ARGS < <( xargs -n1 <<<"$var" ) &&
+#   set -- "${ARGS[@]}" "$@"
+#
+# but POSIX shell has neither arrays nor command substitution, so instead we
+# post-process each arg (as a line of input to sed) to backslash-escape any
+# character that might be a shell metacharacter, then use eval to reverse
+# that process (while maintaining the separation between arguments), and wrap
+# the whole thing up as a single "set" statement.
+#
+# This will of course break if any of these variables contains a newline or
+# an unmatched quote.
+#
+
+eval "set -- $(
+        printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" |
+        xargs -n1 |
+        sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' |
+        tr '\n' ' '
+    )" '"$@"'
+
+exec "$JAVACMD" "$@"

+ 89 - 0
gradlew.bat

@@ -0,0 +1,89 @@
+@rem
+@rem Copyright 2015 the original author or authors.
+@rem
+@rem Licensed under the Apache License, Version 2.0 (the "License");
+@rem you may not use this file except in compliance with the License.
+@rem 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, software
+@rem distributed under the License is distributed on an "AS IS" BASIS,
+@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+@rem See the License for the specific language governing permissions and
+@rem limitations under the License.
+@rem
+
+@if "%DEBUG%" == "" @echo off
+@rem ##########################################################################
+@rem
+@rem  Gradle startup script for Windows
+@rem
+@rem ##########################################################################
+
+@rem Set local scope for the variables with windows NT shell
+if "%OS%"=="Windows_NT" setlocal
+
+set DIRNAME=%~dp0
+if "%DIRNAME%" == "" set DIRNAME=.
+set APP_BASE_NAME=%~n0
+set APP_HOME=%DIRNAME%
+
+@rem Resolve any "." and ".." in APP_HOME to make it shorter.
+for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi
+
+@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
+set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m"
+
+@rem Find java.exe
+if defined JAVA_HOME goto findJavaFromJavaHome
+
+set JAVA_EXE=java.exe
+%JAVA_EXE% -version >NUL 2>&1
+if "%ERRORLEVEL%" == "0" goto execute
+
+echo.
+echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
+echo.
+echo Please set the JAVA_HOME variable in your environment to match the
+echo location of your Java installation.
+
+goto fail
+
+:findJavaFromJavaHome
+set JAVA_HOME=%JAVA_HOME:"=%
+set JAVA_EXE=%JAVA_HOME%/bin/java.exe
+
+if exist "%JAVA_EXE%" goto execute
+
+echo.
+echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
+echo.
+echo Please set the JAVA_HOME variable in your environment to match the
+echo location of your Java installation.
+
+goto fail
+
+:execute
+@rem Setup the command line
+
+set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
+
+
+@rem Execute Gradle
+"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %*
+
+:end
+@rem End local scope for the variables with windows NT shell
+if "%ERRORLEVEL%"=="0" goto mainEnd
+
+:fail
+rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
+rem the _cmd.exe /c_ return code!
+if  not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
+exit /b 1
+
+:mainEnd
+if "%OS%"=="Windows_NT" endlocal
+
+:omega

+ 5 - 0
h2p/export_pdf/.idea/.gitignore

@@ -0,0 +1,5 @@
+# Default ignored files
+/shelf/
+/workspace.xml
+# Editor-based HTTP Client requests
+/httpRequests/

+ 12 - 0
h2p/export_pdf/.idea/export_pdf.iml

@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<module type="WEB_MODULE" version="4">
+  <component name="NewModuleRootManager">
+    <content url="file://$MODULE_DIR$">
+      <excludeFolder url="file://$MODULE_DIR$/temp" />
+      <excludeFolder url="file://$MODULE_DIR$/.tmp" />
+      <excludeFolder url="file://$MODULE_DIR$/tmp" />
+    </content>
+    <orderEntry type="inheritedJdk" />
+    <orderEntry type="sourceFolder" forTests="false" />
+  </component>
+</module>

+ 8 - 0
h2p/export_pdf/.idea/modules.xml

@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project version="4">
+  <component name="ProjectModuleManager">
+    <modules>
+      <module fileurl="file://$PROJECT_DIR$/.idea/export_pdf.iml" filepath="$PROJECT_DIR$/.idea/export_pdf.iml" />
+    </modules>
+  </component>
+</project>

文件差异内容过多而无法显示
+ 0 - 0
h2p/export_pdf/css/index.css


+ 342 - 0
h2p/export_pdf/export-sh.html

@@ -0,0 +1,342 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+    <meta charset="UTF-8">
+    <meta http-equiv="X-UA-Compatible" content="IE=edge">
+    <meta name="viewport" content="width=device-width, initial-scale=1.0">
+    <title>测试报告</title>
+    <style>
+        * {
+            margin: 0;
+            padding: 0;
+        }
+        .resultReport {
+            width: 727px;
+            margin: 0 auto;
+        }
+        .head {
+            width: 727px;
+            height: 88px;
+            margin: 0 auto;
+        }
+        .head .title {
+            width: 251px;
+            line-height: 48px;
+            font-size: 22px;
+            font-family: PingFang SC;
+            font-weight: bold;
+            color: #000;
+            text-align: center;
+            margin: 0 auto;
+        }
+
+        .content {
+            box-sizing: border-box;
+            width: 730px;
+            padding: 15px 30px 40px;
+            background: #ffffff;
+            margin: 0 auto;
+        }
+
+        .base_info {
+            /*box-sizing: border-box;*/
+            width: 100%;
+            height: 30px;
+            text-align: left;
+            font-size: 14px;
+            font-weight: bold;
+            color: #000;
+            border-bottom: 1px solid #8c939d;
+        }
+
+        .base_info p {
+            width: 100%;
+            height: 100%;
+            line-height: 30px;
+            text-align: left;
+            /*padding-bottom: 5px;*/
+        }
+
+        .user_info {
+            width: 100%;
+            height: 30px;
+            font-size: 14px;
+            font-family: PingFang SC;
+            /*font-weight: 500;*/
+            color: #000;
+            border-bottom: 1px solid #8c939d;
+            display: flex;
+            flex-direction: row;
+            justify-content: flex-start;
+            align-items: center;
+            margin-top: 20px;
+        }
+
+        .user_info_item {
+            text-align: left;
+            /*padding-bottom: 5px;*/
+        }
+
+        .user_info_item_second {
+            margin: 0 150px;
+        }
+
+        .user_info_item span:first-child {
+            font-weight: bold;
+            color: #000;
+            margin-right: 10px;
+        }
+
+        .test_content {
+            width: 100%;
+            margin-top: 30px;
+
+        }
+
+        .test_result_first,
+        .test_result_second {
+            width: 100%;
+        }
+
+        .test_result_first_title,
+        .test_result_second_title {
+            width: 100%;
+            height: 30px;
+            text-align: left;
+            font-size: 14px;
+            font-weight: bold;
+            color: #000;
+        }
+
+        .table_content {
+            width: 100%;
+        }
+
+        .table_content table {
+            width: 100%;
+            border-left: 1px solid #000;
+            border-top: 1px solid #000;
+            margin: 0;
+            padding: 0;
+            border-spacing: unset;
+        }
+
+        .table_content table th {
+            background: #e4e4e4;
+        }
+
+        .table_content table th,
+        .table_content table td {
+            border-right: 1px solid #000;
+            border-bottom: 1px solid #000;
+            width: 50%;
+            line-height: 35px;
+            text-align: left;
+            font-size: 14px;
+        }
+
+        .table_content table tr td:first-child {
+            font-weight: bold;
+        }
+
+        .desc_content {
+            width: 100%;
+            margin-top: 30px;
+        }
+
+        .desc_content_item {
+            width: 100%;
+            margin-bottom: 20px;
+        }
+
+        .desc_content_list {
+            width: 100%;
+            line-height: 22px;
+            text-align: left;
+            font-size: 14px;
+            margin-bottom: 10px;
+        }
+
+        .desc_content_list span:first-child {
+            font-weight: bold;
+        }
+
+        .pl {
+            padding-left: 10px;
+        }
+
+        .mr {
+            margin-right: 10px;
+        }
+        .footer {
+            width: 100%;
+            margin: 50px 0 20px;
+            font-size: 14px;
+            font-family: PingFang SC;
+            box-sizing: border-box;
+            padding: 0 30px;
+        }
+        .footer_info {
+            width: 100%;
+            border-bottom: 1px solid #8c939d;
+            padding: 10px 0 50px;
+            text-align: right;
+        }
+        .footer_info_title {
+            font-weight: bold;
+        }
+        .footer_info_title span {
+            color: #666666;
+            font-weight: 500;
+            margin: 0 10px 0 0;
+        }
+        .footer_info_sign {
+            margin-top: 16px;
+            font-size: 14px;
+            font-weight: bold;
+            color: #000;
+        }
+        .footer_desc {
+            text-align: center;
+            margin-top: 10px;
+        }
+    </style>
+    <!--    <script src="./js/echarts.js"></script>-->
+    <script src="./js/vue@2"></script>
+    <!-- 引入样式 -->
+    <link rel="stylesheet" href="./css/index.css">
+    <!-- 引入组件库 -->
+    <script src="./js/index.js"></script>
+</head>
+<body>
+    <div class="resultReport" id="app">
+        <div class="head">
+            <div class="title">三河市儿童医院</div>
+            <div class="title">{{testResult.subject.type == '0' ? '量表评估报告单' : '认知评估报告单'}}</div>
+        </div>
+        <div class="content">
+            <div class="base_info">
+                <p><span>【基本信息】</span><span style="margin-left: 10px;">{{testResult.name}}</span></p>
+            </div>
+            <div class="user_info">
+                <div class="user_info_item user_info_item_first">
+                    <span>姓名:</span><span>{{testResult.userEntity.petName}}</span>
+                </div>
+                <div class="user_info_item user_info_item_second"><span>性别:</span><span>{{testResult.userEntity.gender
+                        == 0 ? '男' : '女'}}</span></div>
+                <div class="user_info_item user_info_item_third">
+                    <span>出生日期:</span><span>{{testResult.userEntity.birthday}}</span>
+                </div>
+            </div>
+            <div class="test_content">
+                <div v-if="showTable" class="test_result_first">
+                    <p class="test_result_first_title">【测试结果】</p>
+                    <div class="table_content">
+                        <table>
+                            <tr>
+                                <th class="pl">项目</th>
+                                <th class="pl">结果</th>
+                            </tr>
+                            <tr v-for="(item ,index) in tableContext" :key="index">
+                                <td class="pl">{{ item.name }}</td>
+                                <td class="pl">{{ item.value[0] }}</td>
+                            </tr>
+                        </table>
+                    </div>
+                </div>
+                <div v-else class="test_result_second">
+                    <p class="test_result_second_title">【测试结果】</p>
+                    <div class="table_content">
+                        <table>
+                            <tr>
+                                <th class="pl">项目</th>
+                                <th class="pl">结果</th>
+                            </tr>
+                            <tr v-for="(item ,index) in result" :key="index">
+                                <td class="pl">{{ item.name }}</td>
+                                <td class="pl">{{ item.score }}</td>
+                            </tr>
+                        </table>
+                    </div>
+                    <div class="desc_content">
+                        <div class="desc_content_item" v-for="(item ,index) in result" :key="index">
+                            <div class="desc_content_list">
+                                <span class="desc_content_item_title">【维度名称】</span>
+                                <span class="desc_content_item_desc">{{ item.name }}</span>
+                            </div>
+                            <div class="desc_content_list">
+                                <span class="desc_content_item_title mr">得&ensp;&ensp;&ensp;&ensp;分:</span>
+                                <span class="desc_content_item_desc">{{ item.score }}</span>
+                            </div>
+                            <div v-if="item.symptom && item.symptom != '无'" class="desc_content_list">
+                                <span class="desc_content_item_title mr">症&ensp;&ensp;&ensp;&ensp;状:</span>
+                                <span class="desc_content_item_desc">{{ item.symptom }}</span>
+                            </div>
+                            <div v-if="item.improvementSuggestions && item.improvementSuggestions != '无'"
+                                class="desc_content_list">
+                                <span class="desc_content_item_title mr">维度说明:</span>
+                                <span class="desc_content_item_desc"> {{ item.improvementSuggestions }}</span>
+                            </div>
+                            <div v-if="item.nameExplain && item.nameExplain != '无'" class="desc_content_list">
+                                <span class="desc_content_item_title mr">维度解读:</span>
+                                <span class="desc_content_item_desc">{{ item.nameExplain }}</span>
+                            </div>
+                            <div v-if="item.suggestion && item.suggestion != '无'" class="desc_content_list">
+                                <span class="desc_content_item_title mr">建&ensp;&ensp;&ensp;&ensp;议:</span>
+                                <span class="desc_content_item_desc">{{ item.suggestion }}</span>
+                            </div>
+                        </div>
+                    </div>
+                </div>
+            </div>
+        </div>
+        <div class="footer">
+            <div class="footer_info">
+                <p class="footer_info_title">
+                    测试者:<span>{{testResult.userEntity.petName}}</span>日期:<span>{{testResult.reportTime}}</span></p>
+                <p class="footer_info_sign">儿童行为发育评定室</p>
+            </div>
+            <div class="footer_desc">注:评估结果仅供临床参考,需结合具体情况综合判断。</div>
+        </div>
+
+    </div>
+    <!--    <script src="./js/vue@2"></script>-->
+    <script>
+        var app = new Vue({
+            el: '#app',
+            data() {
+                return {
+                    id: "",
+                    userName: "",
+                    testDetail:ReplaceData,
+                    testResult: {},
+                    tableContext: [], //旧数据结构
+                    result: [], //新数据结构
+                    showTable: false, //显示旧数据还是新数据
+                };
+            },
+            created() {
+                this.getDetail();
+            },
+            computed: {
+
+            },
+            mounted() { },
+            methods: {
+
+                getDetail() {
+                    debugger
+                    this.testResult = this.testDetail;
+                    console.log(this.testResult, '数据')
+                    this.tableContext = this.testResult?.tableContext ? this.testResult.tableContext : [];
+                    this.showTable = this.testResult?.tableContext ? true : false;
+                    this.result = this.testResult?.result ? this.testResult.result : [];
+
+                },
+
+            }
+        })
+    </script>
+</body>
+
+</html>

+ 341 - 0
h2p/export_pdf/export-wlf.html

@@ -0,0 +1,341 @@
+<!DOCTYPE html>
+<html lang="en">
+
+<head>
+    <meta charset="UTF-8">
+    <meta http-equiv="X-UA-Compatible" content="IE=edge">
+    <meta name="viewport" content="width=device-width, initial-scale=1.0">
+    <title>测试报告</title>
+    <style>
+        * {
+            margin: 0;
+            padding: 0;
+        }
+
+        .resultReport {
+            width: 727px;
+            margin: 0 auto;
+        }
+
+        .head {
+            width: 727px;
+            height: 88px;
+            margin: 0 auto;
+        }
+
+        .head .title {
+            width: 251px;
+            line-height: 48px;
+            font-size: 22px;
+            font-family: PingFang SC;
+            font-weight: bold;
+            color: #000;
+            text-align: center;
+            margin: 0 auto;
+        }
+
+        .content {
+            box-sizing: border-box;
+            width: 730px;
+            padding: 15px 30px 40px;
+            background: #ffffff;
+            margin: 0 auto;
+        }
+
+        .base_info {
+            /*box-sizing: border-box;*/
+            width: 100%;
+            height: 30px;
+            text-align: left;
+            font-size: 14px;
+            font-weight: bold;
+            color: #000;
+            border-bottom: 1px solid #8c939d;
+        }
+        .base_info p {
+            width: 100%;
+            height: 100%;
+            line-height: 30px;
+            text-align: left;
+            /*padding-bottom: 5px;*/
+        }
+
+        .user_info {
+            width: 100%;
+            height: 30px;
+            font-size: 14px;
+            font-family: PingFang SC;
+            /*font-weight: 500;*/
+            color: #000;
+            border-bottom: 1px solid #8c939d;
+            display: flex;
+            flex-direction: row;
+            justify-content: flex-start;
+            align-items: center;
+            margin-top: 20px;
+        }
+        .user_info_item {
+            text-align: left;
+            /*padding-bottom: 5px;*/
+        }
+        .user_info_item_second {
+            margin: 0 150px;
+        }
+        .user_info_item span:first-child{
+            font-weight: bold;
+            color: #000;
+            margin-right: 10px;
+        }
+
+        .test_content {
+            width: 100%;
+            margin-top: 30px;
+
+        }
+        .test_result_first,.test_result_second {
+            width: 100%;
+        }
+        .test_result_first_title,.test_result_second_title {
+            width: 100%;
+            height: 30px;
+            text-align: left;
+            font-size: 14px;
+            font-weight: bold;
+            color: #000;
+        }
+        .table_content {
+            width: 100%;
+        }
+        .table_content table{
+            width: 100%;
+            border-left: 1px solid #000;
+            border-top: 1px solid #000;
+            margin: 0;
+            padding: 0;
+            border-spacing: unset;
+        }
+        .table_content table th {
+            background: #e4e4e4;
+        }
+        .table_content table th,.table_content table td{
+            border-right: 1px solid #000;
+            border-bottom: 1px solid #000;
+            width: 50%;
+            line-height: 35px;
+            text-align: left;
+            font-size: 14px;
+        }
+        .table_content table tr td:first-child {
+            font-weight: bold;
+        }
+
+        .desc_content {
+            width: 100%;
+            margin-top: 30px;
+        }
+        .desc_content_item {
+            width: 100%;
+            margin-bottom: 20px;
+        }
+        .desc_content_list {
+            width: 100%;
+            line-height: 22px;
+            text-align: left;
+            font-size: 14px;
+            margin-bottom: 10px;
+        }
+        .desc_content_list span:first-child {
+            font-weight: bold;
+        }
+
+        .pl {
+            padding-left: 10px;
+        }
+        .mr {
+            margin-right: 10px;
+        }
+
+        .footer {
+            width: 100%;
+            margin: 150px 0 20px;
+            font-size: 14px;
+            font-family: PingFang SC;
+            box-sizing: border-box;
+            padding: 0 30px;
+        }
+        .footer_info {
+            width: 100%;
+            display: flex;
+            flex-direction: row;
+            justify-content: flex-end;
+            align-items: center;
+            border-bottom: 1px solid #8c939d;
+            padding: 10px 0;
+        }
+        .footer_info_title {
+            font-weight: bold;
+        }
+        .footer_info_sign {
+            width: 150px;
+            height: 20px;
+            margin: 0 20px 0 10px;
+            border-bottom: 1px solid #000;
+        }
+        .footer_desc {
+            text-align: center;
+            margin-top: 10px;
+        }
+
+
+    </style>
+<!--    <script src="./js/echarts.js"></script>-->
+    <script src="./js/vue@2"></script>
+    <!-- 引入样式 -->
+    <link rel="stylesheet" href="./css/index.css">
+    <!-- 引入组件库 -->
+    <script src="./js/index.js"></script>
+</head>
+
+<body>
+
+    <div class="resultReport" id="app">
+
+        <div class="head">
+            <div class="title">心理认知评估系统</div>
+            <div class="title">{{testResult.name}}</div>
+        </div>
+
+        <div class="content">
+
+            <div class="base_info">
+                <p>【基本信息】</p>
+            </div>
+
+            <div class="user_info">
+                <div class="user_info_item user_info_item_first"><span>姓名:</span><span>{{testResult.userEntity.petName}}</span></div>
+                <div class="user_info_item user_info_item_second"><span>性别:</span><span>{{testResult.userEntity.gender == 0 ? '男' : '女'}}</span></div>
+                <div class="user_info_item user_info_item_third"><span>出生日期:</span><span>{{testResult.userEntity.birthday}}</span></div>
+            </div>
+
+            <div class="test_content">
+                <div v-if="showTable" class="test_result_first">
+                    <p class="test_result_first_title">【测试结果】</p>
+                    <div class="table_content">
+                        <table>
+                            <tr>
+                                <th class="pl">项目</th>
+                                <th class="pl">结果</th>
+                            </tr>
+                            <tr v-for="(item ,index) in tableContext" :key="index">
+                                <td class="pl">{{ item.name }}</td>
+                                <td class="pl">{{ item.value[0] }}</td>
+                            </tr>
+
+                        </table>
+                    </div>
+
+                </div>
+
+                <div v-else class="test_result_second">
+                    <p class="test_result_second_title">【测试结果】</p>
+                    <div class="table_content">
+                        <table>
+                            <tr>
+                                <th class="pl">项目</th>
+                                <th class="pl">结果</th>
+                            </tr>
+                            <tr v-for="(item ,index) in result" :key="index">
+                                <td class="pl">{{ item.name }}</td>
+                                <td class="pl">{{ item.score }}</td>
+                            </tr>
+
+                        </table>
+                    </div>
+                    <div class="desc_content">
+
+                        <div class="desc_content_item" v-for="(item ,index) in result" :key="index">
+                            <div class="desc_content_list">
+                                <span class="desc_content_item_title">【维度名称】</span>
+                                <span class="desc_content_item_desc">{{ item.name }}</span>
+                            </div>
+                            <div class="desc_content_list">
+                                <span class="desc_content_item_title mr">得&ensp;&ensp;&ensp;&ensp;分:</span>
+                                <span class="desc_content_item_desc">{{ item.score }}</span>
+                            </div>
+                            <div v-if="item.symptom && item.symptom != '无'" class="desc_content_list">
+                                <span class="desc_content_item_title mr">症&ensp;&ensp;&ensp;&ensp;状:</span>
+                                <span class="desc_content_item_desc">{{ item.symptom }}</span>
+                            </div>
+                            <div v-if="item.improvementSuggestions && item.improvementSuggestions != '无'" class="desc_content_list">
+                                <span class="desc_content_item_title mr">维度说明:</span>
+                                <span class="desc_content_item_desc"> {{ item.improvementSuggestions }}</span>
+                            </div>
+                            <div v-if="item.nameExplain && item.nameExplain != '无'" class="desc_content_list">
+                                <span class="desc_content_item_title mr">维度解读:</span>
+                                <span class="desc_content_item_desc">{{ item.nameExplain }}</span>
+                            </div>
+                            <div v-if="item.suggestion && item.suggestion != '无'" class="desc_content_list">
+                                <span class="desc_content_item_title mr">建&ensp;&ensp;&ensp;&ensp;议:</span>
+                                <span class="desc_content_item_desc">{{ item.suggestion }}</span>
+                            </div>
+
+                        </div>
+
+                    </div>
+
+                </div>
+
+            </div>
+
+        </div>
+
+        <div class="footer">
+            <div class="footer_info">
+                <p class="footer_info_title">签名:</p>
+                <p class="footer_info_sign"></p>
+                <p class="footer_info_title">报告日期:</p>
+                <p class="pl">{{testResult.reportTime}}</p>
+            </div>
+            <div class="footer_desc">(本报告仅供临床参考,不做诊断证明之用)</div>
+        </div>
+
+    </div>
+<!--    <script src="./js/vue@2"></script>-->
+    <script>
+        var app = new Vue({
+            el: '#app',
+            data() {
+                return {
+                    id: "",
+                    userName: "",
+                    testDetail: ReplaceData,
+                    testResult: {},
+                    tableContext: [], //旧数据结构
+                    result: [], //新数据结构
+                    showTable: false, //显示旧数据还是新数据
+                };
+            },
+            created() {
+                this.getDetail();
+            },
+            computed: {
+
+            },
+            mounted() { },
+            methods: {
+
+                getDetail() {
+                    this.testResult = this.testDetail;
+                    console.log(this.testResult,'数据')
+                    this.tableContext = this.testResult?.tableContext ? this.testResult.tableContext : [];
+                    this.showTable = this.testResult?.tableContext ? true : false;
+                    this.result = this.testResult?.result ? this.testResult.result : [];
+
+                },
+
+            }
+        })
+    </script>
+</body>
+
+</html>

+ 341 - 0
h2p/export_pdf/export.html

@@ -0,0 +1,341 @@
+<!DOCTYPE html>
+<html lang="en">
+
+<head>
+    <meta charset="UTF-8">
+    <meta http-equiv="X-UA-Compatible" content="IE=edge">
+    <meta name="viewport" content="width=device-width, initial-scale=1.0">
+    <title>测试报告</title>
+    <style>
+        * {
+            margin: 0;
+            padding: 0;
+        }
+
+        .resultReport {
+            width: 727px;
+            margin: 0 auto;
+        }
+
+        .head {
+            width: 727px;
+            height: 88px;
+            margin: 0 auto;
+        }
+
+        .head .title {
+            width: 251px;
+            line-height: 48px;
+            font-size: 22px;
+            font-family: PingFang SC;
+            font-weight: bold;
+            color: #000;
+            text-align: center;
+            margin: 0 auto;
+        }
+
+        .content {
+            box-sizing: border-box;
+            width: 730px;
+            padding: 15px 30px 40px;
+            background: #ffffff;
+            margin: 0 auto;
+        }
+
+        .base_info {
+            /*box-sizing: border-box;*/
+            width: 100%;
+            height: 30px;
+            text-align: left;
+            font-size: 14px;
+            font-weight: bold;
+            color: #000;
+            border-bottom: 1px solid #8c939d;
+        }
+        .base_info p {
+            width: 100%;
+            height: 100%;
+            line-height: 30px;
+            text-align: left;
+            /*padding-bottom: 5px;*/
+        }
+
+        .user_info {
+            width: 100%;
+            height: 30px;
+            font-size: 14px;
+            font-family: PingFang SC;
+            /*font-weight: 500;*/
+            color: #000;
+            border-bottom: 1px solid #8c939d;
+            display: flex;
+            flex-direction: row;
+            justify-content: flex-start;
+            align-items: center;
+            margin-top: 20px;
+        }
+        .user_info_item {
+            text-align: left;
+            /*padding-bottom: 5px;*/
+        }
+        .user_info_item_second {
+            margin: 0 150px;
+        }
+        .user_info_item span:first-child{
+            font-weight: bold;
+            color: #000;
+            margin-right: 10px;
+        }
+
+        .test_content {
+            width: 100%;
+            margin-top: 30px;
+
+        }
+        .test_result_first,.test_result_second {
+            width: 100%;
+        }
+        .test_result_first_title,.test_result_second_title {
+            width: 100%;
+            height: 30px;
+            text-align: left;
+            font-size: 14px;
+            font-weight: bold;
+            color: #000;
+        }
+        .table_content {
+            width: 100%;
+        }
+        .table_content table{
+            width: 100%;
+            border-left: 1px solid #000;
+            border-top: 1px solid #000;
+            margin: 0;
+            padding: 0;
+            border-spacing: unset;
+        }
+        .table_content table th {
+            background: #e4e4e4;
+        }
+        .table_content table th,.table_content table td{
+            border-right: 1px solid #000;
+            border-bottom: 1px solid #000;
+            width: 50%;
+            line-height: 35px;
+            text-align: left;
+            font-size: 14px;
+        }
+        .table_content table tr td:first-child {
+            font-weight: bold;
+        }
+
+        .desc_content {
+            width: 100%;
+            margin-top: 30px;
+        }
+        .desc_content_item {
+            width: 100%;
+            margin-bottom: 20px;
+        }
+        .desc_content_list {
+            width: 100%;
+            line-height: 22px;
+            text-align: left;
+            font-size: 14px;
+            margin-bottom: 10px;
+        }
+        .desc_content_list span:first-child {
+            font-weight: bold;
+        }
+
+        .pl {
+            padding-left: 10px;
+        }
+        .mr {
+            margin-right: 10px;
+        }
+
+        .footer {
+            width: 100%;
+            margin: 150px 0 20px;
+            font-size: 14px;
+            font-family: PingFang SC;
+            box-sizing: border-box;
+            padding: 0 30px;
+        }
+        .footer_info {
+            width: 100%;
+            display: flex;
+            flex-direction: row;
+            justify-content: flex-end;
+            align-items: center;
+            border-bottom: 1px solid #8c939d;
+            padding: 10px 0;
+        }
+        .footer_info_title {
+            font-weight: bold;
+        }
+        .footer_info_sign {
+            width: 150px;
+            height: 20px;
+            margin: 0 20px 0 10px;
+            border-bottom: 1px solid #000;
+        }
+        .footer_desc {
+            text-align: center;
+            margin-top: 10px;
+        }
+
+
+    </style>
+<!--    <script src="./js/echarts.js"></script>-->
+    <script src="./js/vue@2"></script>
+    <!-- 引入样式 -->
+    <link rel="stylesheet" href="./css/index.css">
+    <!-- 引入组件库 -->
+    <script src="./js/index.js"></script>
+</head>
+
+<body>
+
+    <div class="resultReport" id="app">
+
+        <div class="head">
+            <div class="title">心灵照相机</div>
+            <div class="title">{{testResult.name}}</div>
+        </div>
+
+        <div class="content">
+
+            <div class="base_info">
+                <p>【基本信息】</p>
+            </div>
+
+            <div class="user_info">
+                <div class="user_info_item user_info_item_first"><span>姓名:</span><span>{{testResult.userEntity.petName}}</span></div>
+                <div class="user_info_item user_info_item_second"><span>性别:</span><span>{{testResult.userEntity.gender == 0 ? '男' : '女'}}</span></div>
+                <div class="user_info_item user_info_item_third"><span>出生日期:</span><span>{{testResult.userEntity.birthday}}</span></div>
+            </div>
+
+            <div class="test_content">
+                <div v-if="showTable" class="test_result_first">
+                    <p class="test_result_first_title">【测试结果】</p>
+                    <div class="table_content">
+                        <table>
+                            <tr>
+                                <th class="pl">项目</th>
+                                <th class="pl">结果</th>
+                            </tr>
+                            <tr v-for="(item ,index) in tableContext" :key="index">
+                                <td class="pl">{{ item.name }}</td>
+                                <td class="pl">{{ item.value[0] }}</td>
+                            </tr>
+
+                        </table>
+                    </div>
+
+                </div>
+
+                <div v-else class="test_result_second">
+                    <p class="test_result_second_title">【测试结果】</p>
+                    <div class="table_content">
+                        <table>
+                            <tr>
+                                <th class="pl">项目</th>
+                                <th class="pl">结果</th>
+                            </tr>
+                            <tr v-for="(item ,index) in result" :key="index">
+                                <td class="pl">{{ item.name }}</td>
+                                <td class="pl">{{ item.score }}</td>
+                            </tr>
+
+                        </table>
+                    </div>
+                    <div class="desc_content">
+
+                        <div class="desc_content_item" v-for="(item ,index) in result" :key="index">
+                            <div class="desc_content_list">
+                                <span class="desc_content_item_title">【维度名称】</span>
+                                <span class="desc_content_item_desc">{{ item.name }}</span>
+                            </div>
+                            <div class="desc_content_list">
+                                <span class="desc_content_item_title mr">得&ensp;&ensp;&ensp;&ensp;分:</span>
+                                <span class="desc_content_item_desc">{{ item.score }}</span>
+                            </div>
+                            <div v-if="item.symptom && item.symptom != '无'" class="desc_content_list">
+                                <span class="desc_content_item_title mr">症&ensp;&ensp;&ensp;&ensp;状:</span>
+                                <span class="desc_content_item_desc">{{ item.symptom }}</span>
+                            </div>
+                            <div v-if="item.improvementSuggestions && item.improvementSuggestions != '无'" class="desc_content_list">
+                                <span class="desc_content_item_title mr">维度说明:</span>
+                                <span class="desc_content_item_desc"> {{ item.improvementSuggestions }}</span>
+                            </div>
+                            <div v-if="item.nameExplain && item.nameExplain != '无'" class="desc_content_list">
+                                <span class="desc_content_item_title mr">维度解读:</span>
+                                <span class="desc_content_item_desc">{{ item.nameExplain }}</span>
+                            </div>
+                            <div v-if="item.suggestion && item.suggestion != '无'" class="desc_content_list">
+                                <span class="desc_content_item_title mr">建&ensp;&ensp;&ensp;&ensp;议:</span>
+                                <span class="desc_content_item_desc">{{ item.suggestion }}</span>
+                            </div>
+
+                        </div>
+
+                    </div>
+
+                </div>
+
+            </div>
+
+        </div>
+
+        <div class="footer">
+            <div class="footer_info">
+                <p class="footer_info_title">签名:</p>
+                <p class="footer_info_sign"></p>
+                <p class="footer_info_title">报告日期:</p>
+                <p class="pl">{{testResult.reportTime}}</p>
+            </div>
+            <div class="footer_desc">(本报告仅供临床参考,不做诊断证明之用)</div>
+        </div>
+
+    </div>
+<!--    <script src="./js/vue@2"></script>-->
+    <script>
+        var app = new Vue({
+            el: '#app',
+            data() {
+                return {
+                    id: "",
+                    userName: "",
+                    testDetail: ReplaceData,
+                    testResult: {},
+                    tableContext: [], //旧数据结构
+                    result: [], //新数据结构
+                    showTable: false, //显示旧数据还是新数据
+                };
+            },
+            created() {
+                this.getDetail();
+            },
+            computed: {
+
+            },
+            mounted() { },
+            methods: {
+
+                getDetail() {
+                    this.testResult = this.testDetail;
+                    console.log(this.testResult,'数据')
+                    this.tableContext = this.testResult?.tableContext ? this.testResult.tableContext : [];
+                    this.showTable = this.testResult?.tableContext ? true : false;
+                    this.result = this.testResult?.result ? this.testResult.result : [];
+
+                },
+
+            }
+        })
+    </script>
+</body>
+
+</html>

文件差异内容过多而无法显示
+ 34 - 0
h2p/export_pdf/js/echarts.min.js


文件差异内容过多而无法显示
+ 0 - 0
h2p/export_pdf/js/index.js


文件差异内容过多而无法显示
+ 5 - 0
h2p/export_pdf/js/vue@2


+ 817 - 0
h2p/export_pdf/miniprogramReport.html

@@ -0,0 +1,817 @@
+<!DOCTYPE html>
+<html lang="en">
+
+<head>
+    <meta charset="UTF-8">
+    <meta http-equiv="X-UA-Compatible" content="IE=edge">
+    <meta name="divport" content="width=device-width, initial-scale=1.0">
+    <title>小程序测试报告</title>
+    <style>
+        * {
+            margin: 0;
+            padding: 0;
+        }
+
+        html,
+        body {
+            width: 800px;
+        }
+
+        .report_head {
+            width: 100%;
+            height: 308px;
+            background: url(https://test.jue-ming.com:8849/api/show?filePath=./images/report_head_bg.png) no-repeat center;
+            background-size: cover;
+        }
+
+        .logo {
+            width: 219px;
+            height: auto;
+            margin: 38px 0 0 20px;
+        }
+
+        .scaleInfo {
+            display: flex;
+            width: 760px;
+            height: 134px;
+            background: url(https://test.jue-ming.com:8849/api/show?filePath=./images/scaleinfo_bg.png) no-repeat center;
+            background-size: cover;
+            margin: -100px auto 0;
+            border-radius: 36px;
+            overflow: hidden;
+        }
+
+        .scaleInfo .head {
+            width: 91px;
+            height: 91px;
+            margin: 22px 0 0 14px;
+            border-radius: 36px;
+        }
+
+        .titleAndDesc {
+            flex: 1;
+            margin: 28px 0 0 11px;
+        }
+
+        .title {
+            font-size: 28px;
+            font-weight: 800;
+            color: #242424;
+        }
+
+        .desc {
+            width: 460px;
+            font-size: 26px;
+            color: rgba(65, 65, 65, 0.49);
+            margin-top: 10px;
+            overflow: hidden;
+            white-space: nowrap;
+            text-overflow: ellipsis;
+        }
+
+        .testNum {
+            font-size: 24px;
+            font-family: 'PingFang SC-Heavy, PingFang SC';
+            display: flex;
+            flex-direction: row;
+            margin: 32px 23px 0 0;
+        }
+
+        .mum_text {
+            font-size: 24px;
+            font-weight: 800;
+            color: #04919B;
+            text-align: right;
+        }
+
+        .unit {
+            font-size: 24px;
+            font-weight: 800;
+            color: rgba(65, 65, 65, 0.49);
+        }
+
+        .test-result-inner {
+            width: 100%;
+            height: calc(100vh - var(--status-bar-height) - 80px);
+            overflow: hidden;
+            box-sizing: border-box;
+            padding: 20px;
+            margin-top: 20px;
+            background-image: linear-gradient(#A9EBFF, #FFFFFF);
+            border-radius: 20px;
+        }
+
+        .test-result-content {
+            width: 100%;
+            background: #FFFFFF;
+            box-sizing: border-box;
+            padding: 30px 18px 0;
+            border-radius: 36px 36px 0 0;
+        }
+
+        .target-content {
+            margin-bottom: 35px;
+        }
+
+        .report-tip {
+            width: 100%;
+            margin-top: 20px;
+        }
+
+        .tip-title {
+            font-size: 28px;
+            font-family: PingFang SC;
+            font-weight: 500;
+            color: rgba(87, 87, 87, 1);
+            line-height: 50px;
+            text-align: left;
+        }
+
+        .tip-desc {
+            box-sizing: border-box;
+            font-size: 22px;
+            font-family: PingFang SC;
+            color: rgba(65, 65, 65, 0.49);
+            line-height: 50px;
+        }
+
+        .tip-content {
+            box-sizing: border-box;
+            font-size: 24px;
+            font-family: PingFang SC;
+            color: rgba(87, 87, 87, 1);
+            line-height: 50px;
+            display: list-item;
+            list-style-type: disc;
+            margin-left: 25px;
+        }
+
+        .total-score-progress-content {
+            margin-bottom: 20px;
+        }
+
+        .test-result-first-floor {
+            display: flex;
+            flex-direction: row;
+            justify-content: space-between;
+            align-items: center;
+
+
+        }
+
+        .avatar {
+            width: 136px;
+            height: 136px;
+            border-radius: 50%;
+        }
+
+        .scale-name {
+            font-size: 30px;
+            font-family: PingFang SC-Regular, PingFang SC;
+            font-weight: 600;
+            color: #FFAC41;
+            line-height: 50px;
+        }
+
+        .test-time {
+            font-size: 26px;
+            font-family: PingFang SC-Regular, PingFang SC;
+            color: rgba(65, 65, 65, 0.49);
+            line-height: 50px;
+        }
+
+        .table-title {
+            width: 176px;
+            height: 50px;
+            font-size: 30px;
+            font-family: PingFang SC;
+            font-weight: 500;
+            line-height: 50px;
+            text-indent: 12px;
+            color: #fff;
+            text-align: left;
+            background: #FF6A97;
+            border-radius: 0 36px 36px 0;
+            margin: 45px 0;
+        }
+
+        .score_table {
+            width: 656rpx;
+            border-radius: 16px;
+            opacity: 1;
+            overflow: hidden;
+        }
+
+        .score_table tr {
+            width: 100%;
+        }
+
+        .score_table th {
+            box-sizing: border-box;
+            width: 50%;
+            font-size: 28px;
+            font-family: PingFang SC-Regular, PingFang SC;
+            font-weight: 400;
+            color: #FFFFFF;
+            line-height: 71px;
+            background: rgba(83, 220, 230, 1);
+            padding: 6px 18px;
+            text-align: left;
+        }
+
+        .score_table td {
+            box-sizing: border-box;
+            width: 50%;
+            font-size: 28px;
+            font-family: PingFang SC-Regular, PingFang SC;
+            font-weight: 400;
+            color: rgba(80, 80, 80, 1);
+            line-height: 71px;
+            padding: 6px 8px;
+        }
+
+        .score_table tr.odd {
+            background: #BFF2FC;
+        }
+
+        .radar-title {
+            width: 176px;
+            height: 50px;
+            font-size: 30px;
+            font-family: PingFang SC;
+            font-weight: 500;
+            line-height: 50px;
+            text-indent: 12px;
+            color: #fff;
+            text-align: left;
+            background: #2CC5F2;
+            border-radius: 0 36px 36px 0;
+            margin: 45px 0;
+        }
+
+        .total-score-progress-width {
+            width: 80%;
+        }
+
+        .total-score-progress {
+            font-size: 40px;
+            font-weight: bold;
+            width: 120px
+        }
+
+        .total-score-progress-test {
+            font-size: 32px;
+        }
+
+        .demo-layout-bg-purple-light {
+            display: flex;
+            padding: 0 40px;
+        }
+
+        .demo-layout-bg-purple {
+            width: 200px;
+            height: 200px
+        }
+
+        .demo-layout-bg-purple img {
+            width: 100%;
+            height: 100%
+        }
+
+        .custom-style-list {
+            width: 100%;
+            margin: 0 auto;
+
+        }
+
+        .b-b {
+            border: 1px solid #f5f5f5;
+        }
+
+        .b-d {
+
+            border-right: 1px solid #f5f5f5;
+        }
+
+        .custom-style-list-left {
+            text-align: left
+        }
+
+        .custom-style-list-right {
+            text-align: center
+        }
+
+        .padding20 {
+            margin-top: 20px
+        }
+
+        .spanIndent {
+
+            text-indent: 33px;
+        }
+
+        .content_app11 {
+            width: 210px !important;
+            height: 91px !important;
+        }
+
+        ::v-deep .u-button--mini {
+            height: 90px !important;
+            width: 210px !important;
+
+        }
+
+        .over-style {
+            width: 176px;
+            height: 50px;
+            font-size: 30px;
+            font-family: PingFang SC;
+            font-weight: 500;
+            line-height: 50px;
+            text-indent: 12px;
+            color: #fff;
+            text-align: left;
+            background: #FF9B6E;
+            border-radius: 0 36px 36px 0;
+            margin: 45px 0;
+        }
+
+        .dimension-warp {
+            width: 100%;
+            margin-top: 20px;
+        }
+
+        .dimension-name {
+            height: 32px;
+            line-height: 32px;
+            font-size: 30px;
+            font-family: PingFang SC-Regular, PingFang SC;
+            color: #E8B643;
+            border-left: 6px solid #E8B643;
+            padding-left: 13px;
+        }
+
+        .dimension-content {
+            width: 100%;
+            box-sizing: border-box;
+            padding: 20px 12px;
+            background: #F6F5F5;
+            border-radius: 8px;
+            margin-top: 20px;
+            font-size: 26px;
+            font-family: PingFang SC-Regular, PingFang SC;
+            color: #505050;
+        }
+
+        .dimension-item {
+            display: flex;
+            flex-direction: row;
+            justify-content: flex-start;
+            line-height: 50px;
+        }
+
+        .dimension-item-title {
+            width: 19%;
+            height: 50px;
+            font-weight: bold;
+            text-align: justify;
+            text-justify: distribute-all-lines;
+        }
+
+        .dimension-item-title::after {
+            width: 100%;
+            display: inline-block;
+            content: '';
+        }
+
+        .dimension-item-mh {
+            width: 20px;
+            font-weight: bold;
+        }
+
+        .dimension-item-desc {
+            width: calc(81% - 20px);
+        }
+
+
+
+        .analysis-title {
+            font-size: 26px;
+            font-family: PingFang SC-Heavy, PingFang SC;
+            font-weight: 800;
+            color: #575757;
+            line-height: 50px;
+        }
+
+        .analysis-desc {
+            font-size: 24px;
+            font-family: PingFang SC-Regular, PingFang SC;
+            font-weight: 400;
+            color: #575757;
+            line-height: 45px;
+        }
+
+        .more_test {
+            width: 709px;
+            margin: 0 auto;
+            overflow: hidden;
+        }
+
+        .more_txt {
+            margin-top: 100px;
+            float: left;
+        }
+
+        .more_txt p {
+            font-size: 26px;
+            font-family: PingFang SC-Regular, PingFang SC;
+            font-weight: 400;
+            color: rgba(65, 65, 65, 0.49);
+        }
+
+        .more_txt h2 {
+            font-size: 30px;
+            font-family: PingFang SC-Heavy, PingFang SC;
+            font-weight: 800;
+            color: #04919B;
+        }
+
+        .qr_code {
+            width: 221px;
+            height: auto;
+            float: right;
+        }
+    </style>
+    <script src="./js/vue@2"></script>
+    <script src="./js/echarts.min.js"></script>
+</head>
+
+<body>
+    <div id="app" class="">
+        <div class="report_head">
+            <image src="https://test.jue-ming.com:8849/api/show?filePath=./images/camera_logo.png" class="logo" />
+        </div>
+        <div class="scaleInfo">
+            <img class="head" src="https://test.jue-ming.com:8849/api/show?filePath=./images/lbce_pic1.png" />
+            <div class="titleAndDesc">
+                <p class="title">{{name}}</p>
+                <p class="desc">{{scaleInfo.description}}</p>
+            </div>
+            <div class="testNum">
+                <span class="mum_text">{{scaleInfo.testNum}}</span>
+                <span class="unit">人已测评</span>
+            </div>
+        </div>
+        <div class="test-result-inner test-result-warp" v-show="showContent">
+            <div class="test-result-content">
+                <div class="target-content" ref="targetDom" id="targetDom">
+                    <div class="total-score-progress-content">
+                        <div class="test-result-first-floor">
+                            <div>
+                                <div class="scale-name" v-if="name">量表名称:{{ name }}</div>
+                                <div class="test-time" v-if="time">测试时间:{{ time }}</div>
+                            </div>
+                            <img class="avatar" :src="avatarUrl"></img>
+                        </div>
+                        <div class="report-tip">
+                            <div class="tip-title">报告阅读说明</div>
+                            <p class="tip-desc">谢谢您的参与,阅读本报告时,请注意以下内容:</p>
+                            <!--<p class="tip-content">测评图表可快速帮您掌握报告内容;</p>-->
+                            <p class="tip-content">本结果仅供参考,不可作为临床诊断的依据;</p>
+                            <p class="tip-content">如对报告有不理解的地方,建议向专业资质人员进行咨询;</p>
+                            <p class="tip-content">如结果与你自己或他人感知的有出入,可回忆在测试</br>时是否有事情影响到你,或自己答辩时是否有所顾虑。</p>
+                        </div>
+                    </div>
+                    <template v-if="scoresList">
+                        <div class="table-title">分值</div>
+                        <table width="100%" class="score_table" v-for="(items,index) in scoresList" :key="index">
+                            <tr>
+                                <th v-for="(itemTitle,i) in items.colNames" :key="i">{{itemTitle}}</th>
+                            </tr>
+                            <tr v-for="(c,p) in  testResult == 2 ?items.newTableContext.result : items.tableContext"
+                                :class="{'odd': p % 2 == 0}" :key="p">
+                                <td>{{c.name != undefined?c.name:'总分'}}</td>
+                                <td v-if="c.name != undefined">{{testResult == 2?c.score:c.value[0]}}</td>
+                            </tr>
+                        </table>
+                    </template>
+                    <template v-if="scoreList && scoreList.length > 0">
+                        <div class="radar-title">你的分数</div>
+                        <div id="main" class="canvas" style="width: 724px;height:400px;"></div>
+                        <!-- <lei-da-cognitive-tasks :dataList="allData.chartModule.chartBody"></lei-da-cognitive-tasks> -->
+                    </template>
+                    <template v-if="showResultText">
+                        <div class="over-style">结果分析</div>
+                        <div class="dimension-warp" v-for="(list, j) in symptomDescription" :key="j">
+                            <div class="dimension-name">维度名称:{{ list.name }}</div>
+                            <div class="dimension-content">
+                                <div class="dimension-item" v-if="list.score && list.score != '无'">
+                                    <span class="dimension-item-title">得分</span>
+                                    <span class="dimension-item-mh">:</span>
+                                    <span class="dimension-item-desc">{{ list.score }}</span>
+                                </div>
+                                <div class="dimension-item" v-if="list.symptom && list.symptom != '无'">
+                                    <span class="dimension-item-title">症状</span>
+                                    <span class="dimension-item-mh">:</span>
+                                    <span class="dimension-item-desc">{{ list.symptom }}</span>
+                                </div>
+                                <div class="dimension-item"
+                                    v-if="list.improvementSuggestions && list.improvementSuggestions != '无'">
+                                    <span class="dimension-item-title">维度说明</span>
+                                    <span class="dimension-item-mh">:</span>
+                                    <span class="dimension-item-desc">{{ list.improvementSuggestions }}</span>
+                                </div>
+                                <div class="dimension-item" v-if="list.suggestion && list.suggestion != '无'">
+                                    <span class="dimension-item-title">建议</span>
+                                    <span class="dimension-item-mh">:</span>
+                                    <span class="dimension-item-desc">{{ list.suggestion }}</span>
+                                </div>
+                            </div>
+                        </div>
+                    </template>
+                    <div class="more_test">
+                        <div class="more_txt">
+                            <p>更多测评请在微信搜索</p>
+                            <h2>心灵照相机</h2>
+                        </div>
+                        <img class="qr_code" :src="`data:image/png;base64,${qrCodeImg}`" alt="">
+                    </div>
+                </div>
+            </div>
+        </div>
+    </div>
+    <script>
+        var app = new Vue({
+            el: '#app',
+            data() {
+                return {
+                    getBenDatas: null,
+                    avatarUrl: "",
+                    petName: "",
+                    showTestedPerson: false,
+                    baseUrl: 'https://test.jue-ming.com:8443/',
+                    name: "",
+                    time: "",
+                    totalScores: 0,
+                    symptomScore: [],
+                    symptomDescription: [],
+                    symptom: "",
+                    reference: [],
+                    scoreList: [],
+                    indicator: [],
+                    improvementSuggestions: "无",
+                    scoresList: [],
+                    resultId: "",
+                    subjectOrCognitiveId: "",
+                    testResult: 2,
+                    imgUrl: '',
+                    messageShare: 0,
+                    productList: [{
+                        name: '谢谢您的参与,阅读本报告时,请注意以下内容:'
+                    },
+                    {
+                        name: '. 本结果仅供参考,不可作为临床诊断的依据'
+                    },
+                    {
+                        name: '. 如结果与你自己或他人感知的有出入,可回忆在测试'
+                    },
+                    {
+                        name: '时是否有事情影响了你,或自己答题时是否有所顾虑'
+                    },
+                    {
+                        name: '. 如对报告有不理解的地方,建议向专业人员进行咨询'
+                    }
+                    ],
+                    showResultText: false,
+                    relevantList: [],
+                    scaleInfo: {},
+                    flag: '',
+                    showContent: false, //等接口返回数据初始化完成再
+                    tableData: [],
+                    allData: {}, //测试显示内容
+                    resultData: ReplaceData,
+                    qrCodeImg: base64img,
+                    color: ['#FCEF9A', '#D54039', '#56743E', '#FF917C'],
+                    radarIndicator: [],
+                    radarData: [],
+                    option: {},
+                    myChart: null
+                }
+            },
+            computed: {
+            },
+            created() {
+                this.getScaleTestResults();
+            },
+            mounted() {
+                this.myChart = echarts.init(document.getElementById("main"));
+                if (this.myChart) this.drawLine();
+            },
+            methods: {
+                getScaleTestResults(id) {
+                    let _this = this;
+                    this.avatarUrl = this.resultData.userInfo.avatarUrl ? `https://test.jue-ming.com:8849/api/show?filePath=${this.resultData.userInfo.avatarUrl}` : 'https://test.jue-ming.com:8849/api/show?filePath=./images/lbcs_pic2.png';
+                    this.testResult = parseInt(JSON.parse(this.resultData?.userRecordEntity?.testResult)[0].version);
+                    _this.testResult = parseInt(JSON.parse(this.resultData?.userRecordEntity?.testResult)[0].version);
+                    _this.name = this.resultData.userRecordEntity.name;
+                    _this.flag = this.resultData.subject.flag;
+                    _this.scaleInfo = this.resultData.subject;
+
+                    let testDateTime = this.resultData.userRecordEntity.testDate;
+                    let yearMonthDay = testDateTime
+                        .replace("年", "/")
+                        .replace("月", "/")
+                        .replace("日", " ")
+                        .replace("时", ":")
+                        .replace("分", ":")
+                        .replace("秒", "");
+                    _this.time = yearMonthDay;
+                    if (_this.testResult == 2) {
+                        _this.getDataList(this.resultData);
+                    } else {
+                        _this.scoresList = JSON.parse(this.resultData.userRecordEntity.testResult);
+                        _this.init(_this.scoresList[0].tableContext[0].value[0])
+                    }
+                    this.showContent = true;
+                },
+                init(v) {
+                    let _this = this;
+                    _this.totalScores = Number(v);
+                },
+                getDataList(data) {
+                    let _this = this;
+                    let v = JSON.parse(data.userRecordEntity.testResult);
+                    _this.scoresList = v;
+                    console.log("-----传入的参数----->", v);
+                    v.forEach((items) => {
+                        if (items.newTableContext.iconInfo != "") {
+                            let indicatorList = items?.newTableContext?.iconInfo?.indicator;
+                            if (indicatorList.length > 0) {
+                                indicatorList.forEach((data) => {
+                                    _this.indicator.push({
+                                        text: data.text,
+                                        max: Number(data.max)
+                                    });
+                                });
+                            }
+                            let referenceList = items?.newTableContext?.iconInfo?.reference || [];
+                            if (referenceList.length > 0) {
+                                referenceList.forEach((data) => {
+                                    _this.reference.push(Number(data));
+                                });
+                            }
+                            let scoreLists = items?.newTableContext?.iconInfo?.scoreList;
+                            if (scoreLists.length > 0) {
+                                scoreLists.forEach((data) => {
+                                    _this.scoreList.push(Number(data));
+                                });
+                            }
+                            console.log("==1111=====>", _this.indicator)
+                            console.log("==2222=====>", _this.reference)
+                            console.log("==3333=====>", _this.scoreList)
+                        }
+                        // _this.symptomDescription=[]
+                        items.newTableContext.result.forEach((item) => {
+                            if (!item) return;
+                            if (item.name === "总分" || item.name === "压力综合指数") {
+                                _this.init(item.score);
+                                _this.symptom = item.symptom;
+                            }
+                            if (item.isTotalScoreExplain === "是") {
+                                _this.improvementSuggestions = item.symptom;
+                            }
+
+                            _this.symptomScore.push({
+                                name: item.name,
+                                score: item.score
+                            });
+                            // _this.symptomDescription.push({
+                            // 	symptom: item.symptom,
+                            // 	name: item.name,
+                            // 	improvementSuggestions: item.improvementSuggestions,
+                            // });
+                            // if (item.improvementSuggestions && item.improvementSuggestions != '无') _this.showResultText = true;
+
+                            // 获取维度数据
+                            this.symptomDescription.push(item);
+
+                        });
+                        if (this.symptomDescription && this.symptomDescription.length > 0) {
+                            //判断维度显示
+                            this.showResultText = true;
+                        }
+                        console.log("0000-----000", _this.symptomDescription);
+                    });
+                },
+
+                drawLine() {
+                    let _this = this;
+                    console.log("_this.indicator", _this.indicator);
+                    console.log("_this.reference", _this.reference);
+                    console.log("_this.scoreList", _this.scoreList);
+                    let legendData = this.reference?.length > 0 ? ["你的分数", "参考值"] : ["你的分数"];
+                    let options = {
+                        color: ["#67F9D8", "#FFE434", "#56A3F1", "#FF917C"],
+                        title: {
+                            text: "",
+                        },
+                        legend: {
+                            data: legendData,
+                            orient: "vertical",
+                            left: "left",
+                        },
+                        radar: [
+                            {
+                                center: ["25%", "50%"],
+                                radius: 120,
+                                startAngle: 2,
+                                splitNumber: 1,
+                                shape: "circle",
+                                axisName: {
+                                    formatter: "【{value}】",
+                                    color: "#428BD4",
+                                },
+                                splitArea: {
+                                    areaStyle: {
+                                        color: ["#77EADF", "#26C3BE", "#64AFE9", "#428BD4"],
+                                        shadowColor: "rgba(0, 0, 0, 0.2)",
+                                        shadowBlur: 10,
+                                    },
+                                },
+                                axisLine: {
+                                    lineStyle: {
+                                        color: "rgba(211, 253, 250, 0.8)",
+                                    },
+                                },
+                                splitLine: {
+                                    lineStyle: {
+                                        color: "rgba(211, 253, 250, 0.8)",
+                                    },
+                                },
+                            },
+                            {
+                                indicator: _this.indicator,
+                                center: ["50%", "50%"],
+                                radius: "60%",
+                                axisName: {
+                                    color: "#fff",
+                                    backgroundColor: "#666",
+                                    borderRadius: 3,
+                                    padding: [3, 5],
+                                },
+                            },
+                        ],
+                        series: [
+                            {
+                                type: "radar",
+                                radarIndex: 1,
+                                data: [
+                                    {
+                                        value: _this.scoreList,
+                                        name: "你的分数",
+                                        symbol: "rect",
+                                        symbolSize: 12,
+                                        lineStyle: {
+                                            type: "dashed",
+                                        },
+                                        label: {
+                                            show: true,
+                                            formatter: function (params) {
+                                                return params.value;
+                                            },
+                                        },
+                                    },
+                                    {
+                                        value: _this.reference,
+                                        name: "参考值",
+                                        label: {
+                                            show: true,
+                                            formatter: function (params) {
+                                                return params.value;
+                                            },
+                                        },
+                                        areaStyle: {
+                                            color: new echarts.graphic.RadialGradient(0.1, 0.6, 1, [
+                                                {
+                                                    color: "rgba(255, 145, 124, 0.1)",
+                                                    offset: 0,
+                                                },
+                                                {
+                                                    color: "rgba(255, 145, 124, 0.9)",
+                                                    offset: 1,
+                                                },
+                                            ]),
+                                        },
+                                    },
+                                ],
+                            },
+                        ],
+                    }
+                    this.myChart.setOption(options);
+                }
+            }
+        })
+    </script>
+</body>
+
+</html>

+ 379 - 0
h2p/export_pdf/miniprogramScaleDetail.html

@@ -0,0 +1,379 @@
+<!DOCTYPE html>
+<html lang="en">
+
+<head>
+    <meta charset="UTF-8">
+    <meta http-equiv="X-UA-Compatible" content="IE=edge">
+    <meta name="viewport" content="width=device-width, initial-scale=1.0">
+    <title>量表详情</title>
+    <style>
+        * {
+            margin: 0;
+            padding: 0;
+        }
+
+        html,
+        body {
+            width: 800px;
+        }
+
+        .begin_test_content {
+            padding-bottom: 60px;
+        }
+
+        .title_bg {
+            width: 100%;
+            height: 545px;
+            background: url("https://test.jue-ming.com:8849/api/show?filePath=./images/desc_page_bg.png") no-repeat center;
+            background-size: cover;
+            position: relative;
+            overflow: hidden;
+        }
+
+        .logo_content {
+            width: 219px;
+            height: 64px;
+            margin: 38px 0 0 20px;
+        }
+
+        .logo_content img {
+            width: 100%;
+            height: 100%;
+        }
+
+        .logo_img {
+            width: 100%;
+            height: 100%;
+        }
+
+        .begin_test_content_title {
+            font-size: 50px;
+            font-family: sucaijishikufangti-Regular, sucaijishikufangti;
+            font-weight: 400;
+            color: #ffffff;
+            text-align: center;
+            text-shadow: 0px 3px 6px rgba(65, 65, 65, 0.49);
+        }
+
+        .begin_test_content_h {
+            width: 80%;
+            margin: 0 auto;
+            height: 100px;
+        }
+
+        .test_style {
+            width: 201px;
+            height: 201px;
+            margin: 10px auto 18px;
+            border-radius: 60px;
+            overflow: hidden;
+        }
+
+        .test_style_img {
+            width: 100%;
+            height: 100%;
+            vertical-align: middle;
+        }
+
+        .begin_test_content {
+            width: 100%;
+        }
+
+        .btn_center {
+            width: 700px;
+            margin: 0 auto;
+            position: fixed;
+            left: 50%;
+            bottom: 20px;
+            transform: translateX(-350px);
+        }
+
+        .w_h_15 {
+            width: 15px;
+            height: 15px;
+            display: block;
+            margin-right: 10px;
+        }
+
+        .btn_area {
+            width: 84%;
+            display: flex;
+            justify-content: center;
+            align-items: center;
+            margin: 57px auto 0;
+        }
+
+        .u-reset-button {
+            display: flex;
+            justify-content: center;
+            align-items: center;
+            width: 265px;
+            line-height: 76px;
+            background: linear-gradient(180deg, #ffffff 0%, #87dfff 100%);
+            border-radius: 50px 50px 50px 50px;
+            opacity: 1;
+            font-size: 30px;
+            font-family: PingFang SC-Regular, PingFang SC;
+            font-weight: 400;
+            color: #1b90b2;
+        }
+
+        .u-reset-button text {
+            margin-left: 20px;
+        }
+
+
+        .rowAround {
+            border-radius: 10px 10px;
+        }
+
+        .test_detail {
+            width: 100%;
+            background: url("https://test.jue-ming.com:8849/api/show?filePath=./images/report_bg.png") no-repeat top;
+            background-size: 100% auto;
+            border-radius: 50px 50px 0px 0px;
+            opacity: 1;
+            overflow: hidden;
+            margin-top: -120px;
+            position: relative;
+            z-index: 2;
+        }
+
+        .tongji {
+            display: flex;
+            justify-content: space-around;
+            margin-top: 37px;
+        }
+
+        .tongji .disRowcCenter {
+            display: block;
+            width: 219px;
+            height: 67px;
+            background: linear-gradient(180deg, #fbffef 0%, #eefeff 100%);
+            padding: 14px 0;
+            border-radius: 36px 36px 36px 36px;
+            opacity: 1;
+            text-align: center;
+        }
+
+        .quota_name {
+            font-size: 22px;
+            font-family: PingFang SC-Regular, PingFang SC;
+            font-weight: 400;
+            color: #242424;
+        }
+
+        .quota_data {
+            font-size: 26px;
+            font-family: PingFang SC-Heavy, PingFang SC;
+            font-weight: 800;
+            color: #1b90b2;
+        }
+
+        .introduce {
+            width: 709px;
+            margin: 30px auto 0;
+        }
+
+        .introduce_title {
+            font-size: 32px;
+            color: #ffffff;
+            line-height: 64px;
+            display: flex;
+            align-items: center;
+            margin-left: 10px;
+        }
+
+        .introduce_title img {
+            width: 30px;
+            height: 30px;
+        }
+
+        .introduce_title span {
+            font-size: 30px;
+            font-family: PingFang SC-Heavy, PingFang SC;
+            font-weight: 800;
+            color: #1b90b2;
+            margin-left: 10px;
+        }
+
+        .introduce_content {
+            box-sizing: border-box;
+            min-height: 160px;
+            background: #ffffff;
+            border-radius: 36px 36px 36px 36px;
+            opacity: 1;
+            padding: 30px 16px 50px;
+            font-size: 26px;
+            font-family: PingFang SC-Regular, PingFang SC;
+            font-weight: 400;
+            color: #575757;
+            line-height: 48px;
+            letter-spacing: 3px;
+            position: relative;
+        }
+
+        .literature {
+            width: 709px;
+            margin: 30px auto 0;
+        }
+
+
+        .literature_title {
+            font-size: 30px;
+            font-family: PingFang SC-Heavy, PingFang SC;
+            font-weight: 800;
+            color: #1b90b2;
+            margin-left: 6px;
+            line-height: 64px;
+        }
+
+        .literature_content {
+            box-sizing: border-box;
+            min-height: 160px;
+            background: #ffffff;
+            border-radius: 36px 36px 36px 36px;
+            opacity: 1;
+            padding: 30px 16px 50px;
+            font-size: 26px;
+            font-family: PingFang SC-Regular, PingFang SC;
+            font-weight: 400;
+            color: #575757;
+            line-height: 48px;
+            letter-spacing: 3px;
+            position: relative;
+        }
+
+        .literature_item {
+            display: flex;
+            flex-direction: row;
+            justify-content: flex-start;
+        }
+
+        .more_test {
+            width: 709px;
+            margin: 0 auto;
+            overflow: hidden;
+        }
+
+        .more_txt {
+            margin-top: 100px;
+            float: left;
+        }
+
+        .more_txt p {
+            font-size: 26px;
+            font-family: PingFang SC-Regular, PingFang SC;
+            font-weight: 400;
+            color: rgba(65, 65, 65, 0.49);
+        }
+
+        .more_txt h2 {
+            font-size: 30px;
+            font-family: PingFang SC-Heavy, PingFang SC;
+            font-weight: 800;
+            color: #04919B;
+        }
+
+        .qr_code {
+            width: 221px;
+            height: auto;
+            float: right;
+        }
+    </style>
+    <script src="./js/vue@2"></script>
+</head>
+
+<body>
+    <div id="app" class="begin_test_content minHeight100" style="position: relative;">
+        <div class="title_bg">
+            <div class="logo_content">
+                <img class="logo_img" src="https://test.jue-ming.com:8849/api/show?filePath=./images/camera_logo.png" />
+            </div>
+            <div class="test_style">
+                <img :src="`https://test.jue-ming.com:8849/api/show?filePath=${beginTestContent.imageUrl}`"
+                    class="test_style_img" />
+            </div>
+            <div class="begin_test_content_title">
+                {{ beginTestContent.name }}
+            </div>
+        </div>
+        <div class="test_detail">
+            <div class="tongji">
+                <div class="disRowcCenter">
+                    <div class="quota_name">测评次数</div>
+                    <div class="quota_data"> {{ beginTestContent.testNum }}次 </div>
+                </div>
+                <div class="disRowcCenter">
+                    <!-- <image :src="bao2" mode="" class="w_h_15"></image> -->
+                    <div class="quota_name">预计用时</div>
+                    <div class="quota_data">
+                        {{ beginTestContent.estimatedTime }}分钟
+                    </div>
+                </div>
+                <div class="disRowcCenter">
+                    <div class="quota_name">题数</div>
+                    <div class="quota_data"> {{ beginTestContent.titleNum }}题 </div>
+                </div>
+            </div>
+            <div class="introduce">
+                <div class="introduce_title">
+                    <img
+                        src="https://test.jue-ming.com:8849/api/show?filePath=./images/icon_edit_20230608.png" /><span>量表介绍</span>
+                </div>
+                <div class="introduce_content">
+                    {{ beginTestContent.description }}
+                </div>
+            </div>
+            <div class="literature" v-if="beginTestContent.reference != null">
+                <div class="literature_title"> 参考文献 </div>
+                <div class="literature_content">
+                    <div class="literature_item" v-for="(item,index) in replaceTxt(beginTestContent.reference)"
+                        :key="index">
+                        <span style="margin-right:14px">[{{index+1}}]</span>
+                        <span>{{ item }}</span>
+                    </div>
+                </div>
+            </div>
+            <div class="more_test">
+                <div class="more_txt">
+                    <p>更多测评请在微信搜索</p>
+                    <h2>心灵照相机</h2>
+                </div>
+                <img class="qr_code" :src="`data:image/png;base64,${qrCodeImg}`" alt="">
+            </div>
+        </div>
+    </div>
+    <script>
+        var app = new Vue({
+            el: '#app',
+            data() {
+                return {
+                    beginTestContent: scaleDetail,
+                    qrCodeImg:base64img
+                }
+            },
+            created() {
+
+            },
+            computed: {
+
+            },
+            mounted() { },
+            methods: {
+                dealLongTxt(str, num) {
+                    if (str.length > num) {
+                        return `${str.slice(0, num)}...`;
+                    } else {
+                        return str;
+                    }
+                },
+                replaceTxt(str) {
+                    return str.split("//");
+                }
+            }
+        })
+    </script>
+</body>
+
+</html>

+ 24 - 0
h2p/export_pdf/promptResource.html

@@ -0,0 +1,24 @@
+<!DOCTYPE html>
+<html lang="en">
+
+<head>
+    <meta charset="UTF-8">
+    <meta http-equiv="X-UA-Compatible" content="IE=edge">
+    <meta name="viewport" content="width=device-width, initial-scale=1.0">
+    <title>测试报告</title>
+    <style>
+        #myChart {
+            width: 500px;
+            height: 500px;
+        }
+    </style>
+    <script src="https://cdn.bootcdn.net/ajax/libs/echarts/5.3.3-rc.1/echarts.js"></script>
+</head>
+
+<body>
+    <h2>
+        生理数据缺失,无法查看测试结果。
+    </h2>
+</body>
+
+</html>

+ 1 - 0
settings.gradle

@@ -0,0 +1 @@
+rootProject.name = 'psychological_camera'

+ 168 - 0
src/main/java/com/rf/psychological/PsychologicalApplication.java

@@ -0,0 +1,168 @@
+package com.rf.psychological;
+
+import com.querydsl.jpa.impl.JPAQueryFactory;
+import com.rf.psychological.config.SystemExcludeFilter;
+import com.rf.psychological.utils.CPUSerial;
+import com.rf.psychological.utils.Constant;
+import lombok.extern.slf4j.Slf4j;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.annotation.Value;
+import org.springframework.boot.SpringApplication;
+import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
+import org.springframework.boot.autoconfigure.SpringBootApplication;
+import org.springframework.cache.annotation.EnableCaching;
+import org.springframework.context.annotation.Bean;
+import org.springframework.context.annotation.ComponentScan;
+import org.springframework.context.annotation.FilterType;
+import org.springframework.context.annotation.Profile;
+import org.springframework.core.env.Environment;
+import org.springframework.data.jpa.repository.config.EnableJpaAuditing;
+import org.springframework.data.jpa.repository.config.EnableJpaRepositories;
+import org.springframework.scheduling.annotation.EnableScheduling;
+import org.springframework.transaction.annotation.EnableTransactionManagement;
+import springfox.documentation.swagger2.annotations.EnableSwagger2;
+
+import javax.persistence.EntityManager;
+import java.io.IOException;
+
+/**
+ * @author zzf
+ */
+//@EnableCaching
+@EnableJpaRepositories(basePackages = {"com.rf.psychological"})
+@SpringBootApplication(scanBasePackages = {"com.rf.psychological"})
+//@ComponentScan(basePackages = {"com.rf.psychological"},excludeFilters = {@ComponentScan.Filter(type = FilterType.CUSTOM,classes ={ SystemExcludeFilter.class})})
+//@ComponentScan(excludeFilters = {@ComponentScan.Filter(type = FilterType.REGEX,pattern = "com.rf.psychological.wxpay.*")})
+
+@EnableJpaAuditing
+@EnableTransactionManagement
+@EnableScheduling
+@Slf4j
+//@EnableSwagger2
+public class PsychologicalApplication {
+
+    static Logger logger = LoggerFactory.getLogger(PsychologicalApplication.class);
+    @Autowired
+    static Environment environment;
+    @Value("${spring.profiles.active}")
+    static String profile;
+
+
+    public static void main(String[] args) throws Exception {
+        //检查环境
+        //System.out.println("profile--"+profile);
+        //System.out.println("env--"+environment.getActiveProfiles()[0]);
+
+        /*if (PsychologicalApplication.checkDog()){
+        }else {
+            return;
+        }*/
+
+            SpringApplication.run(PsychologicalApplication.class, args);
+		/*if (CPUSerial.getDiskdriveAndCsproductUUID().equals(Constant.DEFAULT_PZ_UUID)){
+		}else {
+			System.out.println("无权限启动");
+		}*/
+    }
+
+    private static boolean checkDog() {
+        System.out.println(System.getProperty("java.library.path"));
+        int ret;
+        SoftKey ytsoftkey = new SoftKey();
+        String DevicePath;
+        DevicePath = ytsoftkey.FindPort(0);
+        if(ytsoftkey.get_LastError()!=0)
+        {
+            System.out.println("未找到加密锁,请插入加密锁后,再进行操作。");
+            logger.error("未找到加密锁,请插入加密锁后,再进行操作。");
+            return false;
+        }
+        if (ytsoftkey.CheckKeyByFindort_2() == 0)
+        {
+            System.out.println("使用普通算法一来检查:找到指定的加密锁");
+            logger.info("使用普通算法一来检查:找到指定的加密锁");
+        }
+        else
+        {
+            logger.error("使用普通算法一来检查:未能找到指定的加密锁");
+            System.out.println("使用普通算法一来检查:未能找到指定的加密锁");
+            return false;
+        }
+        ret = ytsoftkey.CheckKeyByEncstring();
+        if (ret == 1)
+        {
+            logger.error("你生成加密代码时没有设置该函数");
+            System.out.println( "你生成加密代码时没有设置该函数");
+            return false;
+        }
+        if (ret == 0)
+        {
+            logger.info("使用增强算法一来检查:找到指定的加密锁");
+            System.out.println("使用增强算法一来检查:找到指定的加密锁");
+        }
+        else
+        {
+            logger.error("使用增强算法一来检查:未能找到指定的加密锁");
+            System.out.println("使用增强算法一来检查:未能找到指定的加密锁");
+            return false;
+        }
+        ret = ytsoftkey.CheckKeyByEncstring_New();
+        if (ret == 0)
+        {
+            logger.info("使用增强算法二来检查:找到指定的加密锁");
+            System.out.println("使用增强算法二来检查:找到指定的加密锁");
+        }
+        else
+        {
+            if (ret < 0)
+            {
+                log.error("使用增强算法二来检查:未能找到指定的加密锁");
+                System.out.println("使用增强算法二来检查:未能找到指定的加密锁");
+                return false;
+            }
+            else
+            {
+                if (ret == 2)
+                {
+                    log.error("当前锁不支持这个功能。");
+                    System.out.println("当前锁不支持这个功能。");
+                    return false;
+                }
+            }
+        }
+        ret = ytsoftkey.CheckKeyByReadEprom();
+        if (ret == 1)
+        {
+            logger.error("你生成加密代码时没有设置该函数");
+            System.out.println("你生成加密代码时没有设置该函数");
+            return false;
+        }
+        if (ret == 0)
+        {
+            logger.info("使用读写储存器来检查:找到指定的加密锁");
+            System.out.println("使用读写储存器来检查:找到指定的加密锁");
+        }
+        else
+        {
+            logger.error("使用读写储存器来检查:未能找到指定的加密锁");
+            System.out.println("使用读写储存器来检查:未能找到指定的加密锁");
+            return false;
+        }
+        return  true;
+    }
+
+    /**
+     * 让Spring管理JPAQueryFactory
+     *
+     * @param entityManager
+     * @return
+     */
+    @Bean
+    public JPAQueryFactory jpaQueryFactory(EntityManager entityManager) {
+        return new JPAQueryFactory(entityManager);
+    }
+
+
+}

+ 464 - 0
src/main/java/com/rf/psychological/SoftKey.java

@@ -0,0 +1,464 @@
+package com.rf.psychological;
+
+public class SoftKey {
+
+    com.softkey.jsyunew3 j9;
+    public SoftKey()
+    {
+        j9=new  com.softkey.jsyunew3();
+    }
+
+    private String myhex(byte indata)
+    {
+        String outString;
+        outString=String.format("%X",indata);
+        if(outString.length()<2)outString="0"+outString;
+        return outString;
+    }
+
+    //若某字节为负数则需将其转成无符号正数
+    private  long conver(byte temp){
+        long tempInt = (int)temp;
+        if(tempInt < 0){
+            tempInt += 256;
+        }
+        return tempInt;
+    }
+
+    //以下用于将16进制字符串转化为无符号长整型
+    private int HexToInt(String s)
+    {
+        String [] hexch = { "0", "1", "2", "3", "4", "5", "6", "7",
+                "8", "9", "A", "B", "C", "D", "E", "F"};
+        int i, j;
+        int r, n, k;
+        String ch;
+
+        k = 1; r = 0;
+        for (i = s.length(); i > 0; i--)
+        {
+            ch = s.substring(i - 1,  i-1+1);
+            n = 0;
+            for (j = 0; j < 16; j++)
+            {
+                if (ch.compareToIgnoreCase(hexch[j]) ==0 )
+                {
+                    n = j;
+                }
+            }
+            r += (n * k);
+            k *= 16;
+        }
+        return r;
+    }
+
+
+    public String  StrEnc(String InString , String Key)//使用增强算法,加密字符串
+    {
+
+        byte [] b,outb;
+        byte []temp_b=InString.getBytes();
+        byte [] temp=new byte[8],outtemp=new byte[8];
+        int n,i,nlen,outlen;
+        String outString;
+
+        nlen = temp_b.length;
+        nlen=nlen+1;
+        if( nlen < 8 )
+            outlen = 8;
+        else
+            outlen = nlen;
+        b=new byte[outlen];
+        outb=new byte[outlen];
+
+        for(n=0;n<nlen-1;n++)
+        {
+            b[n]=temp_b[n];
+        }
+
+        outb=b.clone();
+
+        for( n = 0; n<=outlen - 8 ;n=n+ 8)
+        {
+            for (i = 0; i < 8; i++) temp[i] = b[i + n];
+            EnCode(temp, outtemp, Key);
+            for( i = 0 ;i<8;i++) outb[i + n] = outtemp[i];
+        }
+
+        outString = "";
+        for (n = 0 ;n<= outlen - 1;n++)
+        {
+            outString = outString +myhex(outb[n]) ;
+        }
+        return outString;
+    }
+
+    public String  StrDec(String InString , String Key)//使用增强算法,解密字符串
+    {
+
+        byte [] b,outb;
+        byte [] temp=new byte[8],outtemp=new byte[8];
+        int n,i,nlen,outlen;
+        String outString,temp_String;
+
+
+        nlen = InString.length();
+        if( nlen < 16 ) outlen = 16;
+        outlen = nlen / 2;
+        b=new byte[outlen];
+        outb=new byte[outlen];
+
+        i = 0;
+        for (n = 1 ;n<= nlen ;n=n+2)
+        {
+            temp_String = InString.substring(n-1, n-1+2);
+            b[i] = (byte)HexToInt(temp_String);
+            i = i + 1;
+        }
+
+        outb=b.clone();
+
+        for( n = 0; n<=outlen - 8 ;n=n+ 8)
+        {
+            for (i = 0; i < 8; i++) temp[i] = b[i + n];
+            DeCode(temp, outtemp, Key);
+            for( i = 0 ;i<8;i++) outb[i + n] = outtemp[i];
+        }
+
+        outString=new String(outb);
+        outString=outString.trim();
+        return outString;
+    }
+
+    public void EnCode(byte[] inb, byte[] outb,  String Key )
+    {
+
+        long cnDelta,y,z,a,b,c,d,temp_2;
+        long [] buf=new long[16];
+        int n,i,nlen;
+        long sum;
+        long temp,temp_1;
+        long mask=4294967295L;
+
+        //UInt32 temp, temp_1;
+        String temp_String ;
+
+
+        cnDelta = 2654435769L;
+        sum = 0;
+
+        nlen = Key.length();
+        i = 0;
+        for( n = 1 ;n<= nlen ;n=n+2)
+        {
+            temp_String =Key.substring(n-1, n-1+2);
+            buf[i] =HexToInt(temp_String);
+            i = i + 1;
+        }
+        a = 0 ; b = 0 ; c = 0 ; d = 0;
+        for(n = 0;n<=3;n++)
+        {
+            a = (buf[n] << (n * 8)) | a;
+            b = (buf[n + 4] << (n * 8)) | b;
+            c = (buf[n + 4 + 4] << (n * 8)) | c;
+            d = (buf[n + 4 + 4 + 4] << (n * 8)) | d;
+        }
+
+
+        y = 0;
+        z = 0;
+        for(n = 0;n<=3;n++)
+        {
+            temp_2 = conver(inb[n]);
+            y = (temp_2 << (n * 8)) | y;
+            temp_2 = conver(inb[n + 4]);
+            z = (temp_2 << (n * 8)) | z;
+        }
+
+
+        n = 32;
+
+        while (n > 0)
+        {
+            sum = (cnDelta + sum)& mask;
+
+            temp = (z << 4) & mask;
+            temp = (temp + a) & mask;
+            temp_1 = (z + sum) & mask;
+            temp = (temp ^ temp_1) & mask;
+            temp_1 = (z >> 5) & mask;
+            temp_1 = (temp_1 + b) & mask;
+            temp = (temp ^ temp_1) & mask;
+            temp = (temp + y) & mask;
+            y = temp & mask;
+            /*y += ((z << 4) + a) ^ (z + sum) ^ ((z >> 5) + b); */
+
+            temp = (y << 4) & mask;
+            temp = (temp + c) & mask;
+            temp_1 = (y + sum) & mask;
+            temp = (temp ^ temp_1) & mask;
+            temp_1 = (y >> 5) & mask;
+            temp_1 = (temp_1 + d) & mask;
+            temp = (temp ^ temp_1) & mask;
+            temp = (z + temp) & mask;
+            z = temp & mask;
+            /* z += ((y << 4) + c) ^ (y + sum) ^ ((y >> 5) + d); */
+            n = n - 1;
+
+        }
+        for(n = 0;n<=3;n++)
+        {
+            outb[n] = (byte)((y >>> (n * 8)) & 255);
+            outb[n + 4] =(byte)((z >>> (n * 8)) & 255);
+        }
+    }
+
+    public void DeCode(byte[] inb, byte[] outb,  String Key )
+    {
+
+        long cnDelta,y,z,a,b,c,d,temp_2;
+        long [] buf=new long[16];
+        int n,i,nlen;
+        long sum;
+        long temp,temp_1;
+
+        long mask=4294967295L;
+
+        //UInt32 temp, temp_1;
+        String temp_String ;
+
+
+        cnDelta = 2654435769L;
+        sum = 3337565984L;
+
+        nlen = Key.length();
+        i = 0;
+        for( n = 1 ;n<= nlen ;n=n+2)
+        {
+            temp_String =Key.substring(n-1, n-1+2);
+            buf[i] =HexToInt(temp_String);
+            i = i + 1;
+        }
+        a = 0 ; b = 0 ; c = 0 ; d = 0;
+        for(n = 0;n<=3;n++)
+        {
+            a = (buf[n] << (n * 8)) | a;
+            b = (buf[n + 4] << (n * 8)) | b;
+            c = (buf[n + 4 + 4] << (n * 8)) | c;
+            d = (buf[n + 4 + 4 + 4] << (n * 8)) | d;
+        }
+
+
+        y = 0;
+        z = 0;
+        for(n = 0;n<=3;n++)
+        {
+            temp_2 = conver(inb[n]);
+            y = (temp_2 << (n * 8)) | y;
+            temp_2 = conver(inb[n + 4]);
+            z = (temp_2 << (n * 8)) | z;
+        }
+
+
+        n = 32;
+
+        while (n > 0)
+        {
+
+
+            temp = (y << 4) & mask;
+            temp = (temp + c) & mask;
+            temp_1 = (y + sum) & mask;
+            temp = (temp ^ temp_1) & mask;
+            temp_1 = (y >> 5) & mask;
+            temp_1 = (temp_1 + d) & mask;
+            temp = (temp ^ temp_1) & mask;
+            temp = (z - temp) & mask;
+            z = temp & mask;
+            /* z += ((y << 4) + c) ^ (y + sum) ^ ((y >> 5) + d); */
+
+            temp = (z << 4) & mask;
+            temp = (temp + a) & mask;
+            temp_1 = (z + sum) & mask;
+            temp = (temp ^ temp_1) & mask;
+            temp_1 = (z >> 5) & mask;
+            temp_1 = (temp_1 + b) & mask;
+            temp = (temp ^ temp_1) & mask;
+            temp = (y - temp ) & mask;
+            y = temp & mask;
+            /*y += ((z << 4) + a) ^ (z + sum) ^ ((z >> 5) + b); */
+
+            sum = (sum-cnDelta)& mask;
+            n = n - 1;
+
+        }
+        for(n = 0;n<=3;n++)
+        {
+            outb[n] = (byte)((y >>> (n * 8)) & 255);
+            outb[n + 4] =(byte)((z >>> (n * 8)) & 255);
+        }
+    }
+
+    public  long get_LastError()
+    {
+        return j9.get_LastError();
+    }
+
+    public String FindPort(int start)
+    {
+        return j9.FindPort(start);
+    }
+
+    public int CheckKeyByFindort_2()
+    {
+        //使用普通算法一查找指定的加密锁
+        String DevicePath = ""; //用于储存加密锁所在的路径
+        DevicePath = j9.FindPort_2(0, 1, -34188227);
+        int ret = (int)j9.get_LastError();
+        j9.CloseUsbHandle(DevicePath);
+        return ret;
+    }
+
+
+    //使用带长度的方法从指定的地址读取字符串
+    private String ReadStringEx(int addr, String DevicePath)
+    {
+        int nlen, ret;
+        byte[] buf = new byte[1];
+        //先从地址0读到以前写入的字符串的长度
+        ret = j9.YReadEx((short)addr, (short)1, "11790F59", "8DB2D29F", DevicePath);
+        if (ret != 0) return "";
+        nlen = j9.GetBuf(0);
+        //再读取相应长度的字符串
+        return j9.NewReadString(addr + 1, nlen, "11790F59", "8DB2D29F", DevicePath);
+
+    }
+    //使用从储存器读取相应数据的方式检查是否存在指定的加密锁
+    public int CheckKeyByReadEprom()
+    {
+        int n, ret;
+        String DevicePath = "";//用于储存加密锁所在的路径
+        String outString = "";
+        //@NoUseCode_data return 1;//如果没有使用这个功能,直接返回1
+        for (n = 0; n < 255; n++)
+        {
+            DevicePath= j9.FindPort(n );
+            if (j9.get_LastError() != 0) return (int)j9.get_LastError();
+            outString = ReadStringEx(15, DevicePath);
+            j9.CloseUsbHandle(DevicePath);
+            if ((j9.get_LastError() == 0) && (outString.compareTo("juemingtechpsychological") == 0))
+            {
+                return 0;
+            }
+        }
+        return -92;
+    }
+    //使用增强算法一检查加密锁,这个方法可以有效地防止仿真
+    public int CheckKeyByEncstring()
+    {
+        //推荐加密方案:生成随机数,让锁做加密运算,同时在程序中端使用代码做同样的加密运算,然后进行比较判断。
+
+        int n, ret;
+        String DevicePath = "";//用于储存加密锁所在的路径
+        String InString;
+
+        //@NoUseKeyEx return 1;//如果没有使用这个功能,直接返回1
+        int number1=(int)(Math.random()*65535)+1;
+        int number2=(int)(Math.random()*65535)+1;
+
+        InString = (new   Integer(number1)).toString() + (new   Integer(number2)).toString();
+
+        for (n = 0; n < 255; n++)
+        {
+            DevicePath= j9.FindPort(n );
+            if (j9.get_LastError() != 0) return (int)j9.get_LastError();
+            if (Sub_CheckKeyByEncString(InString, DevicePath) == 0)
+            {
+                return 0;
+            }
+        }
+        return -92;
+    }
+
+    private int Sub_CheckKeyByEncString(String InString, String DevicePath)
+    {
+        //使用增强算法一对字符串进行加密
+        int ret;
+        String outString = "";
+        String outString_2;
+        outString = j9.EncString(InString,DevicePath);
+        if (j9.get_LastError() != 0) return (int)j9.get_LastError();
+        outString_2 = StrEnc(InString, "8343E96580D6359E93936DC1C964CE16");
+        if (outString_2.compareTo(outString) == 0)//比较结果是否相符
+        {
+            ret = 0;
+        }
+        else
+        {
+            ret = -92;
+        }
+        j9.CloseUsbHandle(DevicePath);
+        return ret;
+    }
+
+    //使用增强算法二检查是否存在对应的加密锁
+    public int CheckKeyByEncstring_New()
+    {
+        int n, ret;
+        String DevicePath = "";//用于储存加密锁所在的路径
+        String outString = "";
+        int myrnd = (int)(Math.random() * 500);
+        String[] EncInString ={ "23822","31334","27821","28396","13549","29874","6159","15857","29799","20651","21741","13567","9800","5618","5219","26822","21624","20167","16297","1435","16899","23055","16923","12654","17682","23882","13105","3538","16624","22171",
+                "8328","23031","16389","20163","30678","13491","11740","11045","4345","32371","12576","8131","22504","23374","9625","16702","5823","21747","13875","14041","24501","7348","5879","3189","5929","28036","24335","9365","7568","3573",
+                "709","19035","6535","29240","28035","25480","25031","32287","15315","17023","1835","26398","5472","6210","32426","13894","9971","1650","27490","27207","15477","20817","2187","14710","31474","12739","13182","29634","14995","18248",
+                "5559","1217","163","10755","28367","5537","6538","7349","32383","20277","21203","24257","3748","15345","21800","7721","7478","18917","7764","2446","9806","27844","6976","563","3624","24543","25077","28153","11036","2090",
+                "2976","10595","28581","30260","11912","6547","13407","2098","30743","24138","8705","11251","26330","9195","15206","16620","9337","5496","1929","6701","32701","28306","23425","8297","1682","11644","17548","5105","16385","25879",
+                "4610","28344","1588","12006","32604","26191","117","15627","32310","3562","15662","3144","8266","6233","27625","13821","8560","14862","14161","25135","4515","11036","16174","22910","7934","18741","12908","14125","32696","22954",
+                "2324","15133","31791","27502","24144","15313","6364","22803","27242","14443","24662","27338","7373","2733","19802","6247","22017","14583","21697","27480","16817","26702","3974","180","20648","28242","1218","11050","21198","838",
+                "5038","13580","12591","5132","32165","16973","18420","13348","4131","21119","24679","12211","28350","25299","19187","15737","32051","12316","6432","20697","26971","6348","30617","3029","21808","7924","10281","20750","8397","2631",
+                "7097","30151","21610","10774","11347","5090","10851","14164","30496","31711","14641","22162","22125","18147","15726","14852","31649","2223","980","25465","10568","8612","29501","1638","3338","12484","13988","2523","14770","9650",
+                "1825","10891","16683","29360","5616","15559","28286","24223","5737","3715","8149","30466","26632","26957","16506","8699","24678","13404","25303","20555","13629","13951","31350","20309","1639","30760","13826","15131","2015","17771",
+                "31043","4159","19389","20471","30501","24065","11324","28960","27569","6214","21943","3033","30225","2446","28838","3762","4752","25851","27557","5597","13462","30800","25965","11565","174","32239","14041","12819","9859","3802",
+                "7393","21922","23261","13490","673","16012","29095","7098","27473","19234","6125","25811","31820","29527","11734","6017","9998","19133","16557","13283","29485","8837","9436","25789","26726","19330","12269","20849","6291","30757",
+                "4747","4098","18860","16002","21118","14094","16332","14920","25778","4060","10030","20172","26416","26697","7723","2302","31521","1244","24380","8561","16082","12979","2814","7766","26538","31122","4648","5504","31796","28123",
+                "16276","3680","11803","8848","25150","1034","21543","15186","5952","1837","1093","7781","13267","30","19835","18088","20304","4301","4599","13727","27955","5836","256","1388","18197","19790","12545","6864","14000","3878",
+                "22916","30509","16350","14531","11572","10887","15002","10809","21465","25982","7420","26937","1119","11093","25919","25367","16079","9198","9150","20163","9811","3530","9458","11984","31540","20491","15221","29550","13535","11381",
+                "10753","15475","15323","4456","11632","15181","17364","3047","9917","13584","17810","22930","25855","9326","6401","6831","3957","31672","12074","9244","12148","1762","27702","29020","23161","28027","8562","13972","31772","21687",
+                "10053","4738","16410","8553","5947","24714","7242","23040","9724","10926","31399","10384","7508","15247","844","31946","30251","20591","1650","19970" };
+        String[] EncOutString ={ "C14D9A649A6E436F","1751A70F0F2F4627","AF0BF7D0ADC5DC73","D816027CEF875B16","A361EC998FAE9026","ED9875DDEDEC80E9","C111BBC7C03F3382","AE81764B46DB0BC1","6D49D7104BC7F826","7E9BCB45CCCC6002","820871EE6294CF27","E1A5C2790C2EBC63","738C19933986751D","54960B0D8B9FB754","322680EB5D440844","7C3C5ACBCA417629","C8A2367B1B169B45","CDA39FE8BA399765","ACC7E8C2A9D227E5","C8E1AE7155277527","E498C3BF75E341CD","2BB96F28D4CF71B5","F0B69D7522C49C69","92037759C529EBE5","B73355BAD405313E","F390894800459802","44C041DE623A1407","AE4FDBEAA188AD10","6673C6BE5D1D3861","8A164109349A2E22",
+                "F86068BEFFE37A9E","D29670AEF3AE3516","27304796C52B795C","A6661586C837E360","7567F5D0E98078CB","D4367BFC70566321","3F34458321A4917C","B4A9926835218825","09B552B83C7EBCCC","9D2BDCACCBF161D5","C392E3985AAACE97","0EFE930F2066EFDE","7662CE657A1DD59F","8E91C5249CC8BB44","55C20D3CF7CDF9FF","55E53B7C4D44F50C","F3DBBF8D02032B50","76B95DB691BE446A","D49B40C7A195A18B","36B51B99AD21FE58","EBD76FFFAFFB0576","4C292A0ADEF3585F","3F48DE03AD44BE64","B53608126466A8A3","EA31CB4916AC0B8E","300D90098A6BA9BA","0643C89F2EE5016F","5B405CE71B74C94F","0E18ED65865A03C0","7C27C3DB0B60A6D9",
+                "099C255FB2A1923B","D12BD94241BB65F8","A44236E9586F1AFA","73B53B344EDB8EB8","5788944C4D831068","94B7E75A2C47AB69","025076E5452A012F","898C4E8508687F9C","F9021E9A022FCEC7","8A49D9BC1D47691A","C45A94055241281B","C2F1105AA4402527","C0AA82128A213954","35CCB5410B042E84","810208F42260B23A","93BE995BEC4EA1F5","2815A8A8D4893837","DCB10ADB7069BF58","9FA176EF87B135C4","A3453545A32A3C32","941C78F0A44B39A2","0BC87C385538F25B","A56DF9159791CB9C","B9B417BA82611946","270530D3E973029D","37EAC7CB6DAB2F04","5CD93EE6017FACD7","1B6DC15F622ED730","CCE531D4A2B482BC","D9C2EF8EEF62C3C9",
+                "E9E6193594F1E160","F2B8F327EFED715D","EEF59B76303DA44B","D80F7509688E03EF","110A6CD5DEC7C33B","E87B371BB04AA804","CB9E93E5751FF2E9","4ED76F0AF89C582D","2C00E18665BD6883","595F8F7E2B0695FD","3E3A64C2F665957D","20C4273569630DEE","90FC777C93F89A7A","3891E064165233EE","EB9BF8AE62299E42","C2D4B13D25EC7BD8","69621465168BFA59","885A36FEF1EA6E6E","055FEBCFE3910550","1A950FBD59A1DC68","1A5DD4FC624D377B","72AB1F21FF168252","493EFC3ABDB8691B","9C5889D18F862AD0","2AD78996007AD6DB","3F708D302C3CBF72","01002C85E03704CC","78790481320C14BD","EC38DB6DFA287401","D7ECEF0412F359CC",
+                "36DA90327105251E","2F8B04D43CBA8DC1","3D2D31A76D8209DD","17E9D955349A6637","A4A70B01657AFD42","59ED648564933638","00F1A7786E08B6EE","D2447D08070CEE36","C0978E7D1C2836D0","ABE6C18CB4AC3AB0","8D8DCE2419131431","5AE96A1AC68ABFA1","E3A3FF248D1CF4B9","82B4F7ADDDDBBDA7","5DE6983CB1400D6D","5517FD198BDBB6F0","3FB15A9D71685C05","36957F333A1572A7","48D36BDA89501935","3AF8DA84B75B50E0","69B7084A1B6E4CDC","0D325EA33E81BBEC","96BE19F2C6C9F6C2","0E6B2D6BE587ADE4","ABEAD4583A9F83E1","D0DD0C7E9DE3F135","E67B4FA14220B832","7EB6949F96B6C3FC","17EE7239229A9564","80370F14175E1AF9",
+                "FED302CE1E32A5BD","02A11325B5A856EA","8B1C362FD8630083","214137B07681A260","6FCF503C341E9AE0","7CD8B7691D7F53A2","68A9B6988D84FA00","405B0030DEF07ACE","0666AF9E05CCEEB0","BCC2413DC8402350","E0955EB04E0DE034","FB1C5D9B372C4147","FF3C8AF69B9D75C0","E68E77BCB98C319E","F4AE5011D6049864","382CDFCE03EFA36E","43F92EEB41577C8E","C6D420F8ED853FD9","F4C2D6517ED4EFD9","5762352682D5B44C","639861D04DDB0D6A","EC38DB6DFA287401","D82ED891AEB4BB75","F3129CDDEE6712A9","65F538844151E224","4B4A4C9B44D0C1A7","188C7016F177B5D8","936D888D73B0B803","C4EDBD40C1ED33B5","B806B0E1F150A5AF",
+                "DACFFC33C2076E93","6C0B9AFDC28D608A","5463CFBD821642FF","376AA7579CDA4380","ACB7A29D74C8C087","C8B414624B50CD43","F33B975D21E6A8D2","C950FD88EE487432","89E7D1F10314C75F","24D3175585D084FD","9F26AE958645D3D8","0E3D331B01DC6E12","0307650BF2A59C1E","4A309B5BAAFC5520","A04F10FDF1B99515","5162937422D87F13","597A68B7D0F4FAEB","2FA15C7F78892AE8","FB4E840E78452B5C","68FF0144A6435F5A","6CD62816584818A3","A47BB037DA71C6F5","77C428F796A42931","49FD082207BDBC08","29A21DCCADD22658","B07F793231DA1327","BF23B96EFB6A8CBE","9691C6E6551D5A52","673B908963C96E33","2FB6BC0079AA9C10",
+                "2083D6F6BB762F84","0FABB4EB33236A5C","9A41634272B09BFF","AE0F181168C96E33","86A312E02685A003","AE10E6E4FC39C435","972B795B24970546","C026032755D8FD28","376E1C26FDFDB138","D97CD69CE1C9E3B6","0E533B4586A474EF","7E03ABD5D740B3D5","642874AC0AF3D866","64BCD2354929473F","2E3AE59A07F8FB63","37E9F596505E8E00","11ED8F8D0C904AB8","5FFD7D992D362615","2F4A4E1FA649FC4A","0713406E57FF0645","03A56FC0994D316A","8C95F9EA68564F64","9719864CE8E2E129","B7CAA0888F24C4CC","9851BFD3F0B76165","44C1019CB9A2D26E","64DDEC76D7E732CE","375570A3E26B1566","CAEA1FE4A7025EED","6052DF100F9918AE",
+                "13D670C89966E692","0DDAADC99FF4DF52","A6132E2A7E36B1CC","93D2C244C9ACE10D","05C836599C615938","D85F5F71FCA5687F","B9A3DFE76A7A746A","5A31D0994B24EADD","4B4C02F20C147421","CE35662C55DBDF12","5FE739E86CF0D609","2D3C77412A7B22E2","0A4E1CA456DFF88F","676773667BF106CB","A96AF26C1FB76126","869A2F5401D280CD","1D81F93D32505083","46A8186D97195245","E5486D7C2AF3FFC7","963DA087724A7C26","EA9E87DCF19596EA","D39D8B5F05BFFA1D","6B668363E5DBBBBA","8B70ACB09109893D","F8DA0CC36AD88CF6","A5564812DE9EA08A","3DAC0B7F03D9A455","0937455274B56677","DEF2C59D2420D582","B699A8C4AD5FF618",
+                "2C31FAB8A9A8DFF0","7A31A7BD8B32D315","1B612D0FF33F7F4B","4664237E0B3F725F","C02F7ABA0E2D1936","6C8ABAA9EF871581","FEDE485FC0D5FCBA","049836F1612FBEA9","A027D048EF0D9F98","774E716D8C0D551D","E8A28A61B7A31926","D012B69B32C2D125","CE2A458E346C7F32","02828D27F7C7C206","C6ECE741E1102749","D520C1223EC9CA5D","A7E9D59509B38F8C","76CEA81681077126","EC6BCBF0264F61A9","092FBE784BC2D474","30CD94C0D8406A6C","E7A892A264CAA4EB","5EC880D36A385CE5","008F18C30F1721D6","B4C37F4EE5BC4878","7DD9851D2A83C0DA","123E31BC0E938534","8C2F61B5A3466E28","7D80C911E461B296","E3901CE8FCF1B6FC",
+                "E17BA6852322449B","60CA19FEE65F4904","C81E325AF17F41F2","00C2C1ACAAE93147","707843DBC3F81EC6","5B73505DCA19E5C6","457FA1A90E2EC558","87197EC76FCC2FF6","484B673F3325E146","C8D17BCDF3FADC06","D8B48245A236EDF3","24567AFBBAE32328","BC48CBF41E4BAAAD","1A950FBD59A1DC68","49D7814AD4B8D1C2","819E821F6B8FF16F","2AE096363420C1E9","77AB57FC7F1103E8","77B1A5537999015D","3A01EA2D6F28B004","13E470D5FF85963F","6F23A38DDE7DD286","D8B7642860042493","FDF591F01A701213","49DA590B8FE01ACE","8EA3A1F070D6B03D","36B51B99AD21FE58","B1B600384E842DC2","3DC4EBDBAEE53101","FFDEBDB72E9AFF39",
+                "78C4B82041E9AF13","40A8F6321C94B088","07E3103A0482FB5C","72BE8FE3ADF1C0CE","769A892BD81C820B","174D92255F17A4BE","4CD7CDCEB62417BC","AE45D0D5E0C0FF50","B540BC9D3638D041","0D64389334975B38","96B8E38AC274C90A","680DDFFE58CB1974","3984D553D426B24F","29C8603BDFACC4D6","82EEAB04E991B256","E6565D221E98CADA","7EA2B0370DF41761","9C83CA0A591E3B42","727709BA78C7E959","C897F4E27B905692","6E8568646D11F603","94C4E59582FC4135","83FDEA0845F94BF9","CFAB16048D8AFA77","A6CAF394096AA86C","F20D90222F631D5A","5051E45B9CC8ADF3","9073BA60EACD5A25","82117FDB2AD4B4DD","42F38F313A336D91",
+                "62031F179E85000B","40E77BC84C574717","35BE3EEF1DD9014F","B3427702BCAB1312","F11A909D7639AD81","4B583552D35617F3","64197505C226AB8A","FFFE595F16FEA809","5AB909C601B25C44","3004154E36B40D8C","270DAD7B6DDAAD0A","5E08D6BE2DE14DC2","D50B9E52FBD4A055","40CB508EBCACDB9C","E3CDE4EC99B97461","D75D2356E8FF5619","2FCC73297654DC9B","38204298823B8A49","5BF4ED8C60CBFEDF","3CC8E9B5A941CA6D","EECC5006F9355520","ED4B5E029068C0F4","9F682DE38C783489","C3CFA99F0512632E","4A1F8E5CE771196E","E0BEA4ACE67461B4","211812299599AF4E","500DECA5CB262BEE","FCF7E392B263F05C","640810F1E2F7B9BD",
+                "CB81068987F033E6","AE2FCA80DA9CF288","28185E26E56B4B4F","9E652D29C1DB6A31","D4CF02F3EB444DE1","AFCE4CD458ABF73A","A5FBDDAA726BA8E7","A3B1D7B272C5BF0E","5653289649514DCC","B9A38B67D6C442C6","99670A2C888CC1DB","B344F4B7A3298837","8E1CADF2F0CEBC48","FEEC3B9C9B5E7CD9","C2F7A3AF940C50F0","9190443BD06429C9","C98963DD947E5CEE","3C4102F7192805B6","272EA933A9A17199","51771BE70545C20F","E9BF2DD8FE6758CE","87D154859A8C4C3D","C1EA1D0C3B89671C","8A8405542274B5D3","DBF18D33B68EE1B5","19BB00BC3148C3BB","1B31C73DFC28975B","D3299E9AD394BCC4","012A9B3B33E28F9F","6723C9821B810E38",
+                "7B04F551CEF196FA","C804D30FCDA21141","85BEE049ED922516","447C9A00620E9FFC","ADE533BFE80EAC05","E1AD4C07548D8C42","570440C3379802D1","ABAAC1EB01101C9A","0823A21EA43F35EF","873841CB5B467F1A","CC86892EE1BACF50","45172CD2DB368756","DD4A32DFEA5C252A","3F18F36DBD1D8885","389A82E7328721B3","A24273E613DD321D","3A8EE9D88ACF1184","CF35CAC3FD8EE094","75B6CD826222D6B1","A6661586C837E360","24AAB18A9AF0E7D4","384FE0947B231BBE","AE4CA7B0A735C3C7","3B25B6C31260D8BF","AA371A1F1B8E38DB","60D0A5BD3B9DF2F5","EBE96367161431AE","73E11549E59B3482","97925CF0E34C0CF5","3D984F6E531EEC9F",
+                "D5B3293E8A429927","5B0881B098ED5FD6","2712D047588D45D6","ADDFC8D2EEDB9793","2027736B90A4AC82","8083C37F583B2891","5365EA23823AAC47","F395FAD548AA1623","1B34B3E546BD1C4B","04EC35D03322CE73","7CB5DC2265EAF2D9","4E8592ECF6C90E1D","715B104BB06A5531","D9DC5FA8FB79E5B9","DB9392AAFF36166C","DC5C09D5FE5BC6A1","EC2890C1D71CB357","7E42F8B5BC157DB4","BABF40F32F343A6A","6542ACE148329410","FFC7E3B2311C58C1","1F36C758A391372C","463EA36ABA17C548","497D7CF25C4C9D47","5A8D1703254B3FE6","58D2F18018D14258","5E703A66E1911E1B","4E5F7680830648C6","77E27F0084619C42","879B10AE265E8E2B",
+                "8BFAC246F896CDC0","9D69F790F8A4453F","DA49B8FF6E8EC507","74D5641729671D8A","D7F0C705873CF0B0","144AF8E019E6E28F","2D6C236882CDCB62","B0389602BA472AF3","2D33F251A30ED1A1","4784948D569D3AB6","FC8B119A9AD202AC","8D3C7C1D447F027A","31520EA506EA2948","32A83A1C176B9D26","D367963DF93E5884","05D87902D7A3EC62","FBF5F8BF33B2F712","E4B64AF2FB337D46","DCB10ADB7069BF58","13FB695ED1E0D9E9" };
+        //@NoUseNewKeyEx return 1;//如果没有使用这个功能,直接返回1
+        //@NoSupNewKeyEx  return 2;//如果该锁不支持这个功能,直接返回2
+
+
+        for (n = 0; n < 255; n++)
+        {
+            DevicePath = j9.FindPort(n);
+            if (j9.get_LastError() != 0) return (int)j9.get_LastError();
+            outString = j9.EncString_New(EncInString[myrnd], DevicePath);
+            j9.CloseUsbHandle(DevicePath);
+            if ((j9.get_LastError() == 0) && (outString.compareTo(EncOutString[myrnd]) == 0))
+            {
+                return 0;
+            }
+        }
+        return -92;
+    }
+
+
+}

+ 196 - 0
src/main/java/com/rf/psychological/TestPush.java

@@ -0,0 +1,196 @@
+package com.rf.psychological;
+
+import java.io.*;
+import java.net.HttpURLConnection;
+import java.net.URL;
+import java.util.ArrayList;
+import java.util.List;
+
+import com.rf.psychological.security.AesEncryptUtils;
+import com.rf.psychological.utils.ExcelUtil;
+import lombok.SneakyThrows;
+import org.apache.http.HttpResponse;
+import org.apache.http.HttpStatus;
+import org.apache.http.client.methods.HttpPost;
+import org.apache.http.entity.StringEntity;
+import org.apache.http.impl.client.CloseableHttpClient;
+import org.apache.http.impl.client.HttpClients;
+import org.apache.http.message.BasicHeader;
+import org.apache.http.protocol.HTTP;
+
+import com.alibaba.fastjson.JSONObject;
+
+/**
+ * 压力测试
+ * @author Administrator
+ *
+ */
+public class TestPush {
+	
+	
+	public static void main(String[] args)throws Exception {
+		
+		File file = new File("C:/Users/Administrator/Desktop/弹型导入模板.xlsx");
+		String fileName = "弹型导入模板.xlsx";
+        FileInputStream fileInputStream = new FileInputStream(file);
+		List<List<List<Object>>> datas = ExcelUtil.getBankListByExcelSheet(fileInputStream, fileName);
+        //获取题目信息并入库
+        List<List<Object>> sheet0 = datas.get(0);
+        List<JSONObject> jsonObjects = new ArrayList<>();
+        for (int i = 0;i <sheet0.size();i++){
+            List<Object> scales = sheet0.get(i);
+            JSONObject jsonObject = new JSONObject();
+            jsonObject.put("institutionNo",scales.get(0));
+            jsonObject.put("phone",scales.get(1));
+            jsonObject.put("password", "205db300b8a350ba594747ff58fa94f1");
+            JSONObject jsonObject2 = new JSONObject();
+            jsonObject2.put("data", AesEncryptUtils.encrypt(jsonObject.toJSONString()));
+            jsonObjects.add(jsonObject2);
+        }
+
+        /*for (JSONObject obj:jsonObjects) {
+        //创建线程登录
+            MyThread t = new MyThread(obj);
+            t.start();
+        }*/
+		//登录
+    	/*String loginUrl = "https://www.jue-ming.com:8848/user/login";
+    	JSONObject jsonObject = new JSONObject();
+    	//{"phone":"test","password":"e10adc3949ba59abbe56e057f20f883e","institutionNo":"10000"}
+    	jsonObject.put("phone", "test");
+    	jsonObject.put("password", "96e79218965eb72c92a549dd5a330112");
+    	jsonObject.put("institutionNo", "10000");
+    	JSONObject jsonObject2 = new JSONObject();
+    	jsonObject2.put("data",AesEncryptUtils.encrypt(jsonObject.toJSONString()));
+
+
+
+		String response = sendPost(jsonObject2, loginUrl);
+		System.out.println(response);
+		String respStringDecrypt = AesEncryptUtils.decrypt(response.substring(1, response.length()-2));
+		System.out.println(respStringDecrypt);
+		JSONObject jsonObject3 = JSONObject.parseObject(respStringDecrypt);
+		String token = jsonObject3.getJSONObject("data").getString("token");
+		System.out.println(token);
+		System.out.println("-------------------------------------------------");
+		String url = "https://www.jue-ming.com:8848/category/getCategoryList?institutionNo=10000&gId=0";
+		String getResponse = sendRequest("Bearer "+token,url,"GET");
+		System.out.println(getResponse);*/
+	}
+	
+	
+	
+	/**
+	 * 发送POST请求
+	 * @param json
+	 * @param URL
+	 * @return
+	 */
+    public static String sendPost(JSONObject json,String URL) {
+        CloseableHttpClient client = HttpClients.createDefault();
+        HttpPost post = new HttpPost(URL);
+        post.setHeader("Content-Type", "application/json");
+        post.addHeader("Authorization", "Basic YWRtaW46");
+        String result = "";
+        try {
+            StringEntity s = new StringEntity(json.toString(), "utf-8");
+            s.setContentType(new BasicHeader(HTTP.CONTENT_TYPE,
+                    "application/json"));
+            post.setEntity(s);
+            // ��������
+            HttpResponse httpResponse = client.execute(post);
+            // ��ȡ��Ӧ������
+            InputStream inStream = httpResponse.getEntity().getContent();
+            BufferedReader reader = new BufferedReader(new InputStreamReader(
+                    inStream, "utf-8"));
+            StringBuilder strber = new StringBuilder();
+            String line;
+            while ((line = reader.readLine()) != null) {
+                strber.append(line + "\n");
+            }
+            inStream.close();
+            result = strber.toString();
+            if (httpResponse.getStatusLine().getStatusCode() == HttpStatus.SC_OK) {
+                System.out.println("---------------------");
+            } else {
+                System.out.println("---------------------------");
+            }
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+        return result;
+    }
+    /**
+     * 发送GET请求
+     * @param urlParam
+     * @param requestType
+     * @return
+     */
+    public static String sendRequest(String cookie ,String urlParam,String requestType) {
+
+        HttpURLConnection con = null;  
+
+        BufferedReader buffer = null; 
+        StringBuffer resultBuffer = null;  
+//        String cookie = "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJwZXROYW1lIjoi5rWL6K-V5Lq65ZGYIiwidXNlclBob25lIjoidGVzdCIsImdyb3VwSWQiOiIwIiwidHlwZSI6InVzZXIiLCJleHAiOjE2NTMyODUyMzMsInVzZXJJZCI6ImZmODA4MTgxN2M2ZDNkODYwMTdjNmQ0NzE2YjMwMDAxIiwiaW5zdGl0dXRpb25ObyI6IjEwMDAwIn0.xyNl0_6VTB6d7edTFPwHucK7VQiHwxx20kpbgG2MWRM";
+        try {
+            URL url = new URL(urlParam); 
+            //�õ����Ӷ���
+            con = (HttpURLConnection) url.openConnection();
+            con.addRequestProperty("Authorization", cookie);
+            //������������
+            con.setRequestMethod(requestType);  
+            //����������Ҫ���ص��������ͺ��ַ�������
+            con.setRequestProperty("Content-Type", "application/json;charset=utf-8");  
+            //�����
+            con.setDoOutput(true);
+            //�������
+            con.setDoInput(true);
+            //��ʹ�û���
+            con.setUseCaches(false);
+            //�õ���Ӧ��
+            int responseCode = con.getResponseCode();
+
+            if(responseCode == HttpURLConnection.HTTP_OK){
+                //�õ���Ӧ��
+                InputStream inputStream = con.getInputStream();
+                //����Ӧ��ת�����ַ���
+                resultBuffer = new StringBuffer();
+                String line;
+                buffer = new BufferedReader(new InputStreamReader(inputStream, "utf-8"));
+                while ((line = buffer.readLine()) != null) {
+                    resultBuffer.append(line);
+                }
+                return resultBuffer.toString();
+            }
+
+        }catch(Exception e) {
+            e.printStackTrace();
+        }
+        return "";
+    }
+    
+    static class MyThread extends Thread{
+        JSONObject jsonObject2;
+        public MyThread(JSONObject jsonObject2){
+            this.jsonObject2 = jsonObject2;
+        }
+    	@SneakyThrows
+        @Override
+    	public void run() {
+    		// TODO Auto-generated method stub
+    		super.run();
+            String loginUrl = "https://www.jue-ming.com:8848/user/login";
+            String response = sendPost(jsonObject2, loginUrl);
+            String respStringDecrypt = AesEncryptUtils.decrypt(response.substring(1, response.length()-2));
+            JSONObject jsonObject3 = JSONObject.parseObject(respStringDecrypt);
+            String token = jsonObject3.getJSONObject("data").getString("token");
+            System.out.println(token);
+            System.out.println("-------------------------------------------------");
+            String url = "https://www.jue-ming.com:8848/category/getCategoryList?institutionNo=10000&gId=0";
+            String getResponse = sendRequest("Bearer "+token,url,"GET");
+            System.out.println(AesEncryptUtils.decrypt(getResponse));
+    	}
+    }
+
+}

+ 669 - 0
src/main/java/com/rf/psychological/api/SubjectApi.java

@@ -0,0 +1,669 @@
+package com.rf.psychological.api;
+
+import com.alibaba.fastjson.JSON;
+import com.alibaba.fastjson.JSONArray;
+import com.alibaba.fastjson.JSONObject;
+import com.alibaba.fastjson.serializer.SerializerFeature;
+import com.fasterxml.jackson.databind.ObjectMapper;
+import com.rf.psychological.api.key.dao.model.KeyEntity;
+import com.rf.psychological.api.key.service.KeyService;
+import com.rf.psychological.base.rest.BaseController;
+import com.rf.psychological.dao.dto.*;
+import com.rf.psychological.dao.model.AnswerEntity;
+import com.rf.psychological.dao.model.DimensionEntity;
+import com.rf.psychological.file.excel.ExcelClass;
+import com.rf.psychological.group.dao.model.GroupEntity;
+import com.rf.psychological.group.service.GroupInfoService;
+import com.rf.psychological.institution.model.InstitutionEntity;
+import com.rf.psychological.institution.service.InstitutionAuthService;
+import com.rf.psychological.institution.service.InstitutionService;
+import com.rf.psychological.plan.dao.model.TestPlanEntity;
+import com.rf.psychological.scale.dao.model.*;
+import com.rf.psychological.scale.service.*;
+import com.rf.psychological.security.RSAUtils;
+import com.rf.psychological.security.SafetyProcess;
+import com.rf.psychological.user.dao.model.UserEntity;
+import com.rf.psychological.user.service.UserService;
+import com.rf.psychological.utils.*;
+import com.rf.psychological.wxpay.model.PromotionInfo;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import lombok.extern.slf4j.Slf4j;
+import org.apache.commons.lang.StringUtils;
+import org.springframework.beans.BeanUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.data.domain.Page;
+import org.springframework.web.bind.annotation.*;
+
+import java.lang.reflect.Constructor;
+import java.lang.reflect.InvocationTargetException;
+import java.lang.reflect.Method;
+import java.text.ParseException;
+import java.text.SimpleDateFormat;
+import java.util.*;
+
+@Slf4j
+@RestController
+@RequestMapping("/v1/subject")
+@Api(tags = "外部系统量表操作")
+public class SubjectApi extends BaseController {
+
+    @Autowired
+    private InstitutionService institutionService;
+
+    @Autowired
+    private InstitutionAuthService institutionAuthService;
+
+    @Autowired
+    private ScaleService scaleService;
+
+    @Autowired
+    private UserRecordService userRecordService;
+
+    @Autowired
+    private UserService userService;
+
+    @Autowired
+    private SubjectService subjectService;
+
+    @Autowired
+    private AnswerService answerService;
+
+    @Autowired
+    private ScaleMarksService scaleMarksService;
+
+    @Autowired
+    private DimensionService dimensionService;
+
+    @Autowired
+    private DimensionOrgService dimensionOrgService;
+
+    @Autowired
+    private ScaleScoringVersion scaleScoringVersion;
+
+    @Autowired
+    private ScaleConfigService scaleConfigService;
+
+    @Autowired
+    private KeyService keyService;
+
+    @Autowired
+    private GroupInfoService groupInfoService;
+
+    @ApiOperation(value = "外部系统获取量表列表接口",notes = "data参数包括:pageNum:页码, pageSize:条数,institutionNo:机构编号,subjectName:量表名称")
+    @PostMapping("/getSubjectList")
+    public Result getSubjectList(@RequestBody String params){
+        try {
+            String jsonParams = RSAUtils.decryptByPrivateKey3(params,RSAUtils.privateKeyStr);
+            log.info("getSubjectList===="+jsonParams);
+            JSONObject jsonObject =JSONObject.parseObject( jsonParams);
+            if (!jsonObject.containsKey("institutionNo") ||  StringUtils.isEmpty(jsonObject.getString("institutionNo")) ) {
+                return fail("", "机构编号不能为空");
+            }
+            String institutionNo = jsonObject.getString("institutionNo");
+            if (!jsonObject.containsKey("subjectName")) {
+                return fail("", "入参量表名称不存在");
+            }
+            String subjectName = jsonObject.getString("subjectName");
+            if (!jsonObject.containsKey("pageNum") ||  StringUtils.isEmpty(jsonObject.getString("pageNum")) ) {
+                return fail("", "页码不能为空");
+            }
+            int pageNum = jsonObject.getInteger("pageNum");
+            if (!jsonObject.containsKey("pageSize") ||  StringUtils.isEmpty(jsonObject.getString("pageSize")) ) {
+                return fail("", "条数不能为空");
+            }
+            int pageSize = jsonObject.getInteger("pageSize");
+            //判断机构编号是否存在
+            InstitutionEntity institutionEntity = this.institutionService.findByInstitutionNo(institutionNo);
+            if (institutionEntity == null) {
+                return fail("", "机构编号不存在!");
+            }
+            // 创建返回的json对象
+            JSONObject resultJson = new JSONObject();
+            // 创建量表信息json对象
+            JSONArray resultData = new JSONArray();
+            List<InstitutionAuthSubjectNameDto> byInstitutionNoAndName = this.institutionAuthService.getByInstitutionNoAndName(pageNum, pageSize, institutionNo, "0", subjectName,null);
+            for (InstitutionAuthSubjectNameDto institutionAuthSubject : byInstitutionNoAndName) {
+                JSONObject subjectObject = new JSONObject(true);
+                subjectObject.put("flag",institutionAuthSubject.getFlag());
+                subjectObject.put("name",institutionAuthSubject.getName());
+                subjectObject.put("description",institutionAuthSubject.getDescription());
+                resultData.add(subjectObject);
+            }
+            int num = this.institutionAuthService.getAllByTableInAuthAndSubInfoNum(institutionNo, "0", subjectName,null);
+            resultJson.put("allNum",num);
+            resultJson.put("resultData",resultData);
+            log.info("resultJson===="+resultJson);
+            //获取该机构编号下公钥
+            KeyEntity keyEntity = keyService.find(institutionNo);
+            if (keyEntity == null){
+                return fail(null,"未获取到该机构下秘钥信息");
+            }
+            if(StringUtils.isEmpty(keyEntity.getPubKey())){
+                return fail(null,"未获取到该机构下秘钥信息");
+            }
+            String encryptStr = RSAUtils.encryptByPublicKey3(resultJson.toJSONString(),keyEntity.getPubKey());
+            return success(encryptStr);
+        }catch (Exception e){
+            e.printStackTrace();
+            return fail();
+        }
+    }
+
+    @ApiOperation(value = "外部系统获取量表详情接口",notes = "data参数包括:flag:量表唯一标识, institutionNo:机构编号")
+    @PostMapping("/getSubject")
+    public Result getSubject(@RequestBody String params){
+        try {
+            String jsonParams = RSAUtils.decryptByPrivateKey3(params,RSAUtils.privateKeyStr);
+            log.info("getSubject===="+jsonParams);
+            JSONObject jsonObject =JSONObject.parseObject( jsonParams);
+            if (!jsonObject.containsKey("institutionNo") ||  StringUtils.isEmpty(jsonObject.getString("institutionNo")) ) {
+                return fail("", "机构编号不能为空");
+            }
+            String institutionNo = jsonObject.getString("institutionNo");
+            if (!jsonObject.containsKey("flag") ||  StringUtils.isEmpty(jsonObject.getString("flag")) ) {
+                return fail("", "量表唯一标识不能为空");
+            }
+            String flag = jsonObject.getString("flag");
+            //判断机构编号是否存在
+            InstitutionEntity institutionEntity = this.institutionService.findByInstitutionNo(institutionNo);
+            if (institutionEntity == null) {
+                return fail("", "机构编号不存在!");
+            }
+            // 创建返回的json对象
+            JSONArray resultJson = new JSONArray();
+            List<ScaleEntity> scaleEntityList = this.scaleService.getScaleByFlagAndInstitutionNo(institutionNo, flag);
+            for (ScaleEntity scaleEntity : scaleEntityList) {
+                JSONObject scaleObject = new JSONObject(true);
+                scaleObject.put("questionNo",scaleEntity.getQuestionNo());
+                scaleObject.put("answer",scaleEntity.getAnswer());
+                scaleObject.put("checkItems",scaleEntity.getCheckItems());
+                scaleObject.put("questionType",scaleEntity.getQuestionType());
+                resultJson.add(scaleObject);
+            }
+            log.info("resultJson===="+resultJson);
+            //获取该机构编号下公钥
+            KeyEntity keyEntity = keyService.find(institutionNo);
+            if (keyEntity == null){
+                return fail(null,"未获取到该机构下秘钥信息");
+            }
+            if(StringUtils.isEmpty(keyEntity.getPubKey())){
+                return fail(null,"未获取到该机构下秘钥信息");
+            }
+            String encryptStr = RSAUtils.encryptByPublicKey3(resultJson.toJSONString(),keyEntity.getPubKey());
+            return success(encryptStr);
+        }catch (Exception e){
+            e.printStackTrace();
+            return fail();
+        }
+    }
+
+    @ApiOperation(value = "外部系统量表测试分析接口",notes = "data参数包括:flag:量表唯一标识, userName:用户名, userId:外部用户唯一标识, institutionNo:机构编号, subjectResult:答题详情")
+    @PostMapping("/analysis")
+    public Result analysis(@RequestBody String params){
+        try {
+            String jsonParams = RSAUtils.decryptByPrivateKey3(params,RSAUtils.privateKeyStr);
+            log.info("getSubject===="+jsonParams);
+            JSONObject jsonObject =JSONObject.parseObject( jsonParams);
+            if (!jsonObject.containsKey("institutionNo") ||  StringUtils.isEmpty(jsonObject.getString("institutionNo")) ) {
+                return fail("", "机构编号不能为空");
+            }
+            String institutionNo = jsonObject.getString("institutionNo");
+            if (!jsonObject.containsKey("userId") ||  StringUtils.isEmpty(jsonObject.getString("userId")) ) {
+                return fail("", "外部用户唯一标识不能为空");
+            }
+            String userId = jsonObject.getString("userId");
+            if (!jsonObject.containsKey("flag") ||  StringUtils.isEmpty(jsonObject.getString("flag")) ) {
+                return fail("", "量表唯一标识不能为空");
+            }
+            String flag = jsonObject.getString("flag");
+            if (!jsonObject.containsKey("userName") ||  StringUtils.isEmpty(jsonObject.getString("userName")) ) {
+                return fail("", "用户名不能为空");
+            }
+            String phone = jsonObject.getString("userName");
+            //判断机构编号是否存在
+            InstitutionEntity institutionEntity = this.institutionService.findByInstitutionNo(institutionNo);
+            if (institutionEntity == null) {
+                return fail("", "机构编号不存在!");
+            }
+            //判断用户是否存在
+            UserEntity userEntity = this.userService.findPhoneAndInstitutionNoAndRoleType(phone,institutionNo,Constant.DEFAULT_VALUE_ONE);
+            if(userEntity == null){
+                return fail("用户不存在");
+            }
+            String userName = userEntity.getPetName();
+            String userBirthday = userEntity.getBirthday();
+            String userSex = userEntity.getGender();
+            if (userSex.equals("0")) {
+                userSex = "男";
+            } else {
+                userSex = "女";
+            }
+
+            String testTime = new SimpleDateFormat("yyyy年MM月dd日HH时mm分ss秒").format(new Date());
+            String fileName = userName + Constant.SPLIT_CHAR + userBirthday + Constant.SPLIT_CHAR + userSex + Constant.SPLIT_CHAR + testTime;
+            String testResult = "";
+            JSONArray jsonArray = jsonObject.getJSONArray("subjectResult");
+
+            // 创建返回的json对象
+            JSONObject resultJson = new JSONObject(true);
+            //根据flag获取全部选项
+            List<ScaleEntity> scaleEntities = this.scaleService.getScaleByFlag(flag);
+            //根据flag获取全部答案
+            List<AnswerEntity> answerEntities = this.answerService.getAnswerByFlag(flag);
+            //根据flag获取全部评分规则
+            List<ScaleMarksEntity> scaleMarksEntities = this.scaleMarksService.getScaleMarksByFlag(flag);
+            //根据flag获取全部维度信息
+            List<DimensionEntity> dimensionEntities = this.dimensionService.getDimensionByFlag(flag);
+            //根据flag获取量表名称
+            List<SubjectEntity> subjectEntities = this.subjectService.getSubjectByFlag(flag);
+            resultJson.put("scaleEntities", scaleEntities);
+            resultJson.put("answerEntities", answerEntities);
+            resultJson.put("scaleMarksEntities", scaleMarksEntities);
+            resultJson.put("dimensionEntities", dimensionEntities);
+            //机构编号,用于预警信息判断
+            resultJson.put("institutionNo",institutionNo);
+            //用户id用于预警信息保存
+            resultJson.put("userId",userEntity.getId());
+            resultJson.put("dimensionOrgService",dimensionOrgService);
+            //答题结果列表
+            List<ScaleEntity> dataList = jsonArray.toJavaList(ScaleEntity.class);
+            ScaleConfigEntity scaleConfigByFlag = scaleConfigService.findScaleConfigByFlag(flag);
+            String className = (scaleConfigByFlag== null ?"com.rf.psychological.scale.resultBusiness.scaleResult.COMMONScale":scaleConfigByFlag.getResultConfig());
+            Class<?> cls; // 取得Class对象
+            try {
+                cls = Class.forName(className);
+                Constructor<?> cons = cls.getConstructor(JSONArray.class, JSONObject.class);
+//            Object obj = cons.newInstance(); // 为构造方法传递参数
+                Object obj = cons.newInstance(jsonArray, resultJson);
+                //System.out.println(obj);
+                //cls.getDeclaredMethods();
+                Method method = null;
+                //通过配置文件获取量表计分规则使用的版本
+                ObjectMapper objectMapper = new ObjectMapper();
+                String str = objectMapper.writeValueAsString(scaleScoringVersion.getVersionmap());
+                HashMap mapScale = JSON.parseObject(str, HashMap.class);
+                System.out.println(mapScale);
+                Set<Map.Entry<String, String>> en = mapScale.entrySet();
+                for(Map.Entry<String, String> entry : en) {
+                    String[] flags = entry.getValue().split(", ");
+                    for (String obtainFlag:flags){
+                        System.out.println("flag:"+obtainFlag);
+                        if (obtainFlag.equals(flag)){
+                            method = cls.getDeclaredMethod(entry.getKey());
+                            break;
+                        }
+                    }
+                }
+                if ( method == null){
+                    method = cls.getDeclaredMethod("scaleCalculate");
+                }
+                //method = cls.getDeclaredMethod("scaleCalculate");
+                resultJson = (JSONObject) method.invoke(obj);
+            } catch (ClassNotFoundException | NoSuchMethodException | IllegalAccessException | InstantiationException |
+                    InvocationTargetException e) {
+                e.printStackTrace();
+            }
+            resultJson.getJSONObject("resultJson").remove("scaleEntities");
+            resultJson.getJSONObject("resultJson").remove("answerEntities");
+            resultJson.getJSONObject("resultJson").remove("scaleMarksEntities");
+            resultJson.getJSONObject("resultJson").remove("dimensionEntities");
+
+            resultJson.getJSONObject("resultJson").remove("institutionNo");
+            resultJson.getJSONObject("resultJson").remove("userId");
+            resultJson.getJSONObject("resultJson").remove("dimensionOrgService");
+
+            if (resultJson.getJSONObject("resultJson").containsKey("resultJson") && resultJson.getJSONObject("resultJson").get("测试结果指导").equals("请认真按照实际情况如实回答")) {
+                resultJson = resultJson.getJSONObject("resultJson");
+                return success(resultJson, "完成");
+            }
+            fileName = fileName + "-" + subjectEntities.get(0).getName() + ".xlsx";
+            //导出文件
+            ExcelUtil.createExcelFile(ScaleEntity.class, dataList, (List<Map<String, String>>) resultJson.get("resultMapList"), new ExcelClass().contentExcel(), fileName, subjectEntities.get(0).getName());
+
+            //计算结果
+            JSONArray dbJsonList = new JSONArray();
+            JSONObject dbJson = new JSONObject(true);
+            boolean versionFlag = false;
+            Map<String, Object> newResultJson = null;
+            if (!resultJson.containsKey("newResultJson")) {
+                dbJson.put("version", 1.0);
+                dbJson.put("newTableContext", "");
+            } else {
+                newResultJson = (Map<String, Object>) resultJson.get("newResultJson");
+                dbJson.put("version", 2.0);
+                dbJson.put("newTableContext", newResultJson);
+                versionFlag = true;
+            }
+
+            resultJson = resultJson.getJSONObject("resultJson");
+            List<WarnEntity> warnEntityList = new ArrayList<WarnEntity>();
+            if(resultJson.containsKey("warnEntityList")) {
+                warnEntityList = resultJson.getJSONArray("warnEntityList").toJavaList(WarnEntity.class);
+                resultJson.remove("warnEntityList");
+            }
+            // 获取JSON第一层所有的key
+            Set<String> keys = resultJson.keySet();
+
+            //列名
+            List colNames = new ArrayList();
+            colNames.add("项目");
+            colNames.add("内容");
+            dbJson.put("colNames", colNames);
+            JSONArray tableContext = new JSONArray();
+
+            // 获取第一层每个key对应的值 的类型
+            for (String key : keys) {
+                //列值
+                List colValue = new ArrayList();
+                colValue.add(resultJson.get(key));
+                JSONObject row = new JSONObject();
+                row.put("name", key);
+                row.put("value", colValue);
+                tableContext.add(row);
+            }
+
+            dbJson.put("tableContext", tableContext);
+
+            dbJsonList.add(dbJson);
+
+            //测试记录
+            int i = 1;
+            // 获取第一层每个key对应的值 的类型
+            for (String key : keys) {
+                if (i == keys.size()) {
+                    testResult += key + ":" + resultJson.get(key);
+                } else {
+                    testResult += key + ":" + resultJson.get(key) + ";";
+                }
+                i++;
+            }
+            String filePath;
+            filePath = "./心理检测/检测结果/" + new SimpleDateFormat("yyyy-MM-dd").format(new Date()) + "/" + subjectEntities.get(0).getName() + "/" + fileName;
+            UserRecordEntity userRecordEntity = testRecord(flag, userId, institutionNo, testTime, filePath, JSON.toJSONString(dbJsonList, SerializerFeature.DisableCircularReferenceDetect), subjectEntities.get(0).getName(), JSON.toJSONString(dataList, SerializerFeature.DisableCircularReferenceDetect), testResult, Constant.DEFAULT_VALUE_ZERO);
+
+            // 创建返回的json对象
+            JSONObject resultJsonObject = new JSONObject();
+            resultJsonObject.put("resultId",userRecordEntity.getId());
+            log.info("resultJsonObject===="+resultJsonObject);
+            //获取该机构编号下公钥
+            KeyEntity keyEntity = keyService.find(institutionNo);
+            if (keyEntity == null){
+                return fail(null,"未获取到该机构下秘钥信息");
+            }
+            if(StringUtils.isEmpty(keyEntity.getPubKey())){
+                return fail(null,"未获取到该机构下秘钥信息");
+            }
+            String encryptStr = RSAUtils.encryptByPublicKey3(resultJsonObject.toJSONString(),keyEntity.getPubKey());
+            return success(encryptStr);
+        }catch (Exception e){
+            e.printStackTrace();
+            return fail();
+        }
+    }
+
+    private UserRecordEntity testRecord(String flag, String phone, String institutionNo, String testTime, String fileName, String testResult, String name, String dataList, String testResults, String testPlanId) {
+        //根据flag记录测试数
+        this.subjectService.addTestNum(flag);
+        //添加用户测试记录
+        UserRecordEntity userRecordEntity = new UserRecordEntity();
+        userRecordEntity.setFlag(flag);
+        userRecordEntity.setPhone(phone);
+        userRecordEntity.setInstitutionNo(institutionNo);
+        userRecordEntity.setTestDate(testTime);
+        userRecordEntity.setTestResult(testResult);
+        userRecordEntity.setType("0");
+        userRecordEntity.setFileName(fileName);
+        userRecordEntity.setName(name);
+        userRecordEntity.setTestRecord(dataList);
+        userRecordEntity.setTestResults(testResults);
+        if (testPlanId == null || testPlanId.equals("")) {
+            userRecordEntity.setTestPlanId("0");
+        } else {
+            userRecordEntity.setTestPlanId(testPlanId);
+        }
+        this.userRecordService.save(userRecordEntity);
+        return userRecordEntity;
+    }
+
+    @ApiOperation(value = "外部系统获取量表测试分析结果接口",notes = "data参数包括:resultId:测试结果唯一标识,userId:外部用户唯一标识, institutionNo:机构编号")
+    @PostMapping("/getSubjectResult")
+    public Result getSubjectResult(@RequestBody String params){
+        try {
+            String jsonParams = RSAUtils.decryptByPrivateKey3(params,RSAUtils.privateKeyStr);
+            JSONObject jsonObject =JSONObject.parseObject(jsonParams);
+            log.info("getSubject===="+jsonParams);
+            if (!jsonObject.containsKey("institutionNo") ||  StringUtils.isEmpty(jsonObject.getString("institutionNo")) ) {
+                return fail("", "机构编号不能为空");
+            }
+            String institutionNo = jsonObject.getString("institutionNo");
+            if (!jsonObject.containsKey("userId") ||  StringUtils.isEmpty(jsonObject.getString("userId")) ) {
+                return fail("", "外部用户唯一标识不能为空");
+            }
+            String userId = jsonObject.getString("userId");
+            if (!jsonObject.containsKey("resultId") ||  StringUtils.isEmpty(jsonObject.getString("resultId")) ) {
+                return fail("", "测试结果唯一标识不能为空");
+            }
+            String resultId = jsonObject.getString("resultId");
+            //判断机构编号是否存在
+            InstitutionEntity institutionEntity = this.institutionService.findByInstitutionNo(institutionNo);
+            if (institutionEntity == null) {
+                return fail("", "机构编号不存在!");
+            }
+            // 创建返回的json对象
+            JSONObject resultJson = new JSONObject();
+            UserRecordEntity userRecordEntity = this.userRecordService.getuserRecordByIdAndInstitutionNoAndPhone(resultId,userId,institutionNo);
+            if (userRecordEntity != null){
+                resultJson.put("name",userRecordEntity.getName());
+                resultJson.put("testDate",userRecordEntity.getTestDate());
+                resultJson.put("testResult",userRecordEntity.getTestResult());
+            }
+            log.info("resultJson===="+resultJson);
+            //获取该机构编号下公钥
+            KeyEntity keyEntity = keyService.find(institutionNo);
+            if (keyEntity == null){
+                return fail(null,"未获取到该机构下秘钥信息");
+            }
+            if(StringUtils.isEmpty(keyEntity.getPubKey())){
+                return fail(null,"未获取到该机构下秘钥信息");
+            }
+            String encryptStr = RSAUtils.encryptByPublicKey3(resultJson.toJSONString(),keyEntity.getPubKey());
+            return success(encryptStr);
+        }catch (Exception e){
+            e.printStackTrace();
+            return fail();
+        }
+    }
+
+    @ApiOperation(value = "外部系统查询机构下所有用户已经做的测试记录",notes = "data参数包括:pageNum:页码, pageSize:条数,institutionNo:机构编号,type:类型(0量表;1认知任务),searchKey:查询参数")
+    @PostMapping("/getUserRecording")
+    public Result getUserRecording(@RequestBody String params) {
+        try {
+            String jsonParams = RSAUtils.decryptByPrivateKey3(params,RSAUtils.privateKeyStr);
+            JSONObject jsonObject =JSONObject.parseObject(jsonParams);
+            log.info("getUserRecording===="+jsonParams);
+            if (!jsonObject.containsKey("institutionNo") ||  StringUtils.isEmpty(jsonObject.getString("institutionNo")) ) {
+                return fail("", "机构编号不能为空");
+            }
+            String institutionNo = jsonObject.getString("institutionNo");
+            if (!jsonObject.containsKey("type") ||  StringUtils.isEmpty(jsonObject.getString("type")) ) {
+                return fail("", "类型不能为空");
+            }
+            String type = jsonObject.getString("type");
+            if (!jsonObject.containsKey("pageNum") ||  StringUtils.isEmpty(jsonObject.getString("pageNum")) ) {
+                return fail("", "页码不能为空");
+            }
+            int pageNum = jsonObject.getInteger("pageNum");
+            if (!jsonObject.containsKey("pageSize") ||  StringUtils.isEmpty(jsonObject.getString("pageSize")) ) {
+                return fail("", "条数不能为空");
+            }
+            int pageSize = jsonObject.getInteger("pageSize");
+            String searchKey = "";
+            if (jsonObject.containsKey("searchKey") && !StringUtils.isEmpty(jsonObject.getString("searchKey")) ) {
+                searchKey = jsonObject.getString("searchKey");
+            }
+            if (pageSize == 0) {
+                pageSize = 20;
+            }
+            String beginFormat = "", endFormat = "";
+            int num;
+            List<InstitutionRecordingDTO> institutionUserRecordingList = this.userRecordService.getInstitutionUserRecording(pageNum, pageSize, type, institutionNo, searchKey, beginFormat, endFormat);
+            num = this.userRecordService.allCountByInstitutionNo(institutionNo, type, searchKey, "", "");
+            log.info("institutionUserRecordingList:" + JSONObject.toJSONString(institutionUserRecordingList));
+            JSONObject returnJsonObject = new JSONObject();
+            returnJsonObject.put("institutionUserRecordingList", institutionUserRecordingList);
+            returnJsonObject.put("allNum", num);
+            //获取该机构编号下公钥
+            KeyEntity keyEntity = keyService.find(institutionNo);
+            if (keyEntity == null){
+                return fail(null,"未获取到该机构下秘钥信息");
+            }
+            if(StringUtils.isEmpty(keyEntity.getPubKey())){
+                return fail(null,"未获取到该机构下秘钥信息");
+            }
+            String encryptStr = RSAUtils.encryptByPublicKey3(returnJsonObject.toJSONString(),keyEntity.getPubKey());
+            return success(encryptStr);
+        }catch (Exception e){
+            e.printStackTrace();
+            return fail();
+        }
+    }
+
+    @ApiOperation(value = "外部系统查询机构下测试量表下的用户",notes = "data参数包括:pageNum:页码, pageSize:条数,institutionNo:机构编号,name:量表或认知任务名称,searchKey:查询参数")
+    @PostMapping("/getTestUser")
+    public Result getTestUser(@RequestBody String params) {
+        try {
+            String jsonParams = RSAUtils.decryptByPrivateKey3(params,RSAUtils.privateKeyStr);
+            JSONObject jsonObject =JSONObject.parseObject( jsonParams);
+            log.info("getTestUser===="+jsonParams);
+            if (!jsonObject.containsKey("institutionNo") ||  StringUtils.isEmpty(jsonObject.getString("institutionNo")) ) {
+                return fail("", "机构编号不能为空");
+            }
+            String institutionNo = jsonObject.getString("institutionNo");
+            if (!jsonObject.containsKey("name") ||  StringUtils.isEmpty(jsonObject.getString("name")) ) {
+                return fail("", "量表或认知任务名称不能为空");
+            }
+            String name = jsonObject.getString("name");
+            if (!jsonObject.containsKey("pageNum") ||  StringUtils.isEmpty(jsonObject.getString("pageNum")) ) {
+                return fail("", "页码不能为空");
+            }
+            int pageNum = jsonObject.getInteger("pageNum");
+            if (!jsonObject.containsKey("pageSize") ||  StringUtils.isEmpty(jsonObject.getString("pageSize")) ) {
+                return fail("", "条数不能为空");
+            }
+            int pageSize = jsonObject.getInteger("pageSize");
+            String searchKey = "";
+            if (jsonObject.containsKey("searchKey") && !StringUtils.isEmpty(jsonObject.getString("searchKey")) ) {
+                searchKey = jsonObject.getString("searchKey");
+            }
+            if (pageSize == 0) {
+                pageSize = 20;
+            }
+            GroupEntity entity =this.groupInfoService.findGroupByInstitutionNoAndName(Constant.LAN_INSTITUTION_CODE,Constant.DEFAULT_GROUP_NAME);
+            if (entity == null ){
+                return fail("", "机构下无默认分组!");
+            }
+            String groupId = entity.getId();
+            String beginFormat = "", endFormat = "";
+            int num;
+            //添加分组过滤
+            List<InstitutionRecordingUserDTO> institutionUserRecordingList = this.userRecordService.getInstitutionRecording(pageNum, pageSize, institutionNo, name, searchKey, beginFormat, endFormat, groupId);
+            num = this.userRecordService.allCountInstitutionRecording(institutionNo, name, searchKey, beginFormat, endFormat, groupId);
+            List<InstitutionRecordingUserApiDTO> institutionRecordingUserApiDTOList = new ArrayList<>();
+            for (InstitutionRecordingUserDTO institutionRecordingUserDTO : institutionUserRecordingList) {
+                InstitutionRecordingUserApiDTO institutionRecordingUserApiDTO = new InstitutionRecordingUserApiDTO();
+                institutionRecordingUserApiDTO.setPhone(institutionRecordingUserDTO.getPhone());
+                institutionRecordingUserApiDTO.setPetName(institutionRecordingUserDTO.getPetName());
+                institutionRecordingUserApiDTO.setGender(institutionRecordingUserDTO.getGender());
+                institutionRecordingUserApiDTO.setBirthday(institutionRecordingUserDTO.getBirthday());
+                institutionRecordingUserApiDTO.setTestDate(institutionRecordingUserDTO.getTestDate());
+                institutionRecordingUserApiDTO.setInstitutionNo(institutionRecordingUserDTO.getInstitutionNo());
+                institutionRecordingUserApiDTO.setId(institutionRecordingUserDTO.getId());
+                institutionRecordingUserApiDTOList.add(institutionRecordingUserApiDTO);
+            }
+            JSONObject returnJsonObject = new JSONObject();
+            returnJsonObject.put("institutionUserRecordingList", institutionRecordingUserApiDTOList);
+            returnJsonObject.put("allNum", num);
+            //获取该机构编号下公钥
+            KeyEntity keyEntity = keyService.find(institutionNo);
+            if (keyEntity == null){
+                return fail(null,"未获取到该机构下秘钥信息");
+            }
+            if(StringUtils.isEmpty(keyEntity.getPubKey())){
+                return fail(null,"未获取到该机构下秘钥信息");
+            }
+            String encryptStr = RSAUtils.encryptByPublicKey3(returnJsonObject.toJSONString(),keyEntity.getPubKey());
+            return success(encryptStr);
+        }catch (Exception e){
+            e.printStackTrace();
+            return fail();
+        }
+    }
+
+    /**
+     * 查询某用户所有测试记录
+     * @param params
+     * @return
+     */
+    @PostMapping("/getUserAllResult")
+    @ApiOperation(value = "外部系统查询某用户所有测试记录接口",notes = "json字符串形式传参(加密),data参数包括:phone:账号或电话,institutionNo:机构编号,pageNum:页码, pageSize:条数,searchKey:查询参数")
+    public Result getUserAllResult(@RequestBody String params){
+        try {
+            String jsonParams = RSAUtils.decryptByPrivateKey3(params,RSAUtils.privateKeyStr);
+            JSONObject jsonObject =JSONObject.parseObject(jsonParams);
+            log.info("getUserAllResult===="+jsonParams);
+            if (!jsonObject.containsKey("phone") ||  StringUtils.isEmpty(jsonObject.getString("phone")) ) {
+                return fail("", "账号不能为空");
+            }
+            String phone = jsonObject.getString("phone");
+            log.info("phone: " + phone);
+            if (!jsonObject.containsKey("institutionNo") || StringUtils.isEmpty(jsonObject.getString("institutionNo")) ) {
+                return fail("", "机构编号");
+            }
+            String institutionNo = jsonObject.getString("institutionNo");
+            log.info("institutionNo: " + institutionNo);
+            if (!jsonObject.containsKey("pageNum") ||  StringUtils.isEmpty(jsonObject.getString("pageNum")) ) {
+                return fail("", "页码不能为空");
+            }
+            int pageNum = jsonObject.getInteger("pageNum");
+            if (!jsonObject.containsKey("pageSize") ||  StringUtils.isEmpty(jsonObject.getString("pageSize")) ) {
+                return fail("", "条数不能为空");
+            }
+            int pageSize = jsonObject.getInteger("pageSize");
+            String searchKey = "";
+            if (jsonObject.containsKey("searchKey") && !StringUtils.isEmpty(jsonObject.getString("searchKey")) ) {
+                searchKey = jsonObject.getString("searchKey");
+            }
+            if (pageSize == 0) {
+                pageSize = 20;
+            }
+
+            Page<UserRecordsDto> userRecording = userRecordService.getUserRecording(pageNum, pageSize, phone, institutionNo, searchKey);
+            JSONArray jsonArray = new JSONArray();
+            for (UserRecordsDto userRecord : userRecording){
+                JSONObject object = new JSONObject(true);
+                object.put("name",userRecord.getName());
+                object.put("testDate",userRecord.getTestDate());
+                object.put("testResult",userRecord.getTestResult());
+                jsonArray.add(object);
+            }
+            JSONObject returnJsonObject = new JSONObject();
+            returnJsonObject.put("testResultList", jsonArray);
+            returnJsonObject.put("allNum", userRecording.getTotalElements());
+            //获取该机构编号下公钥
+            KeyEntity keyEntity = keyService.find(institutionNo);
+            if (keyEntity == null){
+                return fail(null,"未获取到该机构下秘钥信息");
+            }
+            if(StringUtils.isEmpty(keyEntity.getPubKey())){
+                return fail(null,"未获取到该机构下秘钥信息");
+            }
+            String encryptStr = RSAUtils.encryptByPublicKey3(returnJsonObject.toJSONString(),keyEntity.getPubKey());
+            return success(encryptStr);
+        }catch (Exception e){
+            e.printStackTrace();
+            return fail();
+        }
+    }
+
+}

+ 208 - 0
src/main/java/com/rf/psychological/api/UserApi.java

@@ -0,0 +1,208 @@
+package com.rf.psychological.api;
+
+import com.alibaba.fastjson.JSONObject;
+import com.rf.psychological.api.key.dao.model.KeyEntity;
+import com.rf.psychological.api.key.service.KeyService;
+import com.rf.psychological.base.rest.BaseController;
+import com.rf.psychological.enums.UserRole;
+import com.rf.psychological.enums.UserStatus;
+import com.rf.psychological.group.dao.model.GroupEntity;
+import com.rf.psychological.group.service.GroupInfoService;
+import com.rf.psychological.institution.model.InstitutionEntity;
+import com.rf.psychological.institution.service.InstitutionService;
+import com.rf.psychological.security.AesEncryptUtils;
+import com.rf.psychological.security.RSAUtils;
+import com.rf.psychological.security.SafetyProcess;
+import com.rf.psychological.user.dao.model.UserEntity;
+import com.rf.psychological.user.service.UserService;
+import com.rf.psychological.utils.Constant;
+import com.rf.psychological.utils.JWTUtil;
+import com.rf.psychological.utils.Result;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import lombok.extern.slf4j.Slf4j;
+import org.apache.commons.lang.StringUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.util.DigestUtils;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+/**
+ * @author Administrator
+ */
+@Slf4j
+@RestController
+@RequestMapping("/v1")
+@Api(tags = "外部系统认证操作")
+public class UserApi extends BaseController {
+
+    @Autowired
+    private InstitutionService institutionService;
+
+    @Autowired
+    private KeyService keyService;
+
+    @Autowired
+    private UserService userService;
+
+    @Autowired
+    private GroupInfoService groupInfoService;
+
+    @ApiOperation(value = "外部系统获取token接口",notes = "data参数包括:userName:账号, password:密码,institutionNo:机构编号")
+    @PostMapping("/getToken")
+    public Result getToken(@RequestBody String params){
+        try {
+            String jsonParams = RSAUtils.decryptByPrivateKey3(params,RSAUtils.privateKeyStr);
+            JSONObject jsonObject =JSONObject.parseObject( jsonParams);
+            log.info("getToken===="+jsonParams);
+            if (!jsonObject.containsKey("institutionNo") ||  StringUtils.isEmpty(jsonObject.getString("institutionNo")) ) {
+                return fail("", "机构编号不能为空");
+            }
+            String institutionNo = jsonObject.getString("institutionNo");
+            if (!jsonObject.containsKey("userName") || StringUtils.isEmpty(jsonObject.getString("userName")) ) {
+                return fail("", "账号不能为空");
+            }
+            String phone = jsonObject.getString("userName");
+            log.info("phone: " + phone);
+            //判断机构编号是否存在
+            InstitutionEntity institutionEntity = this.institutionService.findByInstitutionNo(institutionNo);
+            log.info("institutionEntity: " + institutionEntity);
+            if (institutionEntity == null) {
+                return fail("", "机构编号不存在!");
+            }
+            UserEntity userEntity = this.userService.findPhoneAndInstitutionNoAndRoleType(phone, institutionNo, Constant.DEFAULT_VALUE_ONE );
+            log.info("userEntity: " + userEntity);
+            if (!jsonObject.containsKey("password") || StringUtils.isEmpty(  jsonObject.getString("password") )) {
+                return fail("", "密码不能为空");
+            }
+            String password = jsonObject.getString("password");
+            if (userEntity == null) {
+
+                return fail(null, "机构编号或账号错误");
+            }
+            if (userEntity.getPassword().equals(password)) {
+                //生成token
+                userEntity.setPassword(null);
+                String token = JWTUtil.generateToken(userEntity);
+                // 创建返回的json对象
+                JSONObject resultJson = new JSONObject();
+                resultJson.put("token", token);
+                //获取该机构编号下公钥
+                KeyEntity keyEntity = keyService.find(institutionNo);
+                if (keyEntity == null){
+                    return fail(null,"未获取到该机构下秘钥信息");
+                }
+                if(StringUtils.isEmpty(keyEntity.getPubKey())){
+                    return fail(null,"未获取到该机构下秘钥信息");
+                }
+                String encryptStr = RSAUtils.encryptByPublicKey3(resultJson.toJSONString(),keyEntity.getPubKey());
+                 return success(encryptStr);
+            } else {
+                return fail(null, "账号或密码错误");
+            }
+        }catch (Exception e){
+            e.printStackTrace();
+            return fail();
+        }
+    }
+
+    /**
+     * 注册用户
+     * @param params
+     * @return
+     */
+    @PostMapping("/registerUser")
+    @ApiOperation(value = "外部系统普通用户注册接口",notes = "json字符串形式传参(加密),data参数包括:birthday:生日,gender:性别,password:密码,phone:账号或电话,petName:姓名")
+    public Result registerUser(@RequestBody String params){
+        try {
+            String jsonParams = RSAUtils.decryptByPrivateKey3(params,RSAUtils.privateKeyStr);
+            JSONObject jsonObject =JSONObject.parseObject(jsonParams);
+            log.info("registerUser===="+jsonParams);
+            if (!jsonObject.containsKey("phone") ||  StringUtils.isEmpty(jsonObject.getString("phone")) ) {
+                return fail("", "账号不能为空");
+            }
+            String phone = jsonObject.getString("phone");
+            log.info("phone: " + phone);
+            if (!jsonObject.containsKey("petName") || StringUtils.isEmpty(jsonObject.getString("petName")) ) {
+                return fail("", "姓名不能为空");
+            }
+            String petName = jsonObject.getString("petName");
+            log.info("petName: " + petName);
+            if (!jsonObject.containsKey("birthday") ||  StringUtils.isEmpty(jsonObject.getString("birthday")) ) {
+                return fail("", "出生日期不能为空");
+            }
+            String birthday = jsonObject.getString("birthday");
+            log.info("birthday: " + birthday);
+            if (!jsonObject.containsKey("gender") || StringUtils.isEmpty(jsonObject.getString("gender")) ) {
+                return fail("", "性别不能为空");
+            }
+            String gender = jsonObject.getString("gender");
+            log.info("gender: " + gender);
+            if (!jsonObject.containsKey("password") || StringUtils.isEmpty(jsonObject.getString("password")) ) {
+                return fail("", "密码不能为空");
+            }
+            String password = jsonObject.getString("password");
+            log.info("password: " + password);
+
+            UserEntity userEntity = jsonObject.toJavaObject(UserEntity.class);
+            userEntity.setModelPhone(Constant.DEFAULT_VALUE_ZERO);
+            userEntity.setInstitutionNo(Constant.LAN_INSTITUTION_CODE);
+            userEntity.setInstitutionName(Constant.LAN_INSTITUTION_NAME);
+            userEntity.setRoleType(UserRole.COMMON.getType());
+            userEntity.setUserStatus(UserStatus.PASS.getType());
+            GroupEntity entity =this.groupInfoService.findGroupByInstitutionNoAndName(Constant.LAN_INSTITUTION_CODE,Constant.DEFAULT_GROUP_NAME);
+            if (entity == null ){
+                return fail("", "机构下无默认分组!");
+            }
+            userEntity.setGId(entity.getId());
+            UserEntity userInfo = this.userService.findPhoneAndInstitutionNoAndRoleType(userEntity.getPhone(), userEntity.getInstitutionNo(),userEntity.getRoleType());
+            if (userInfo == null) {
+                this.userService.save(userEntity);
+                return success();
+            } else {
+                return fail("", "账号已注册");
+            }
+        }catch (Exception e){
+            e.printStackTrace();
+            return fail();
+        }
+    }
+
+    /**
+     * 删除用户
+     * @param params
+     * @return
+     */
+    @PostMapping("/deleteUser")
+    @ApiOperation(value = "外部系统普通用户删除接口",notes = "json字符串形式传参(加密),data参数包括:phone:账号或电话,institutionNo:机构编号")
+    public Result deleteUser(@RequestBody String params){
+        try {
+            String jsonParams = RSAUtils.decryptByPrivateKey3(params,RSAUtils.privateKeyStr);
+            JSONObject jsonObject =JSONObject.parseObject( jsonParams);
+            log.info("deleteUser===="+jsonParams);
+            if (!jsonObject.containsKey("phone") ||  StringUtils.isEmpty(jsonObject.getString("phone")) ) {
+                return fail("", "账号不能为空");
+            }
+            String phone = jsonObject.getString("phone");
+            log.info("phone: " + phone);
+            if (!jsonObject.containsKey("institutionNo") || StringUtils.isEmpty(jsonObject.getString("institutionNo")) ) {
+                return fail("", "机构编号");
+            }
+            String institutionNo = jsonObject.getString("institutionNo");
+            log.info("institutionNo: " + institutionNo);
+            UserEntity user = this.userService.findPhoneAndInstitutionNoAndRoleType(phone,institutionNo,Constant.DEFAULT_VALUE_ONE);
+            if (user != null) {
+                this.userService.delete(user);
+                return success();
+            } else {
+                return fail("", "账号不存在");
+            }
+        }catch (Exception e){
+            e.printStackTrace();
+            return fail();
+        }
+    }
+
+}

+ 37 - 0
src/main/java/com/rf/psychological/api/key/dao/model/KeyEntity.java

@@ -0,0 +1,37 @@
+package com.rf.psychological.api.key.dao.model;
+
+import com.rf.psychological.base.model.BaseEntity;
+import lombok.*;
+import org.hibernate.annotations.DynamicUpdate;
+
+import javax.persistence.Column;
+import javax.persistence.Entity;
+import javax.persistence.Table;
+
+/**
+ * @Author:zzf
+ * @Date:2022/11/2:10:06
+ * @Description:
+ */
+@Entity
+@Data
+@Getter
+@Setter
+@NoArgsConstructor
+@AllArgsConstructor
+@EqualsAndHashCode(callSuper=false)
+@Table(name = "t_key_info")
+@org.hibernate.annotations.Table(appliesTo = "t_key_info", comment = "秘钥实体类")
+@DynamicUpdate
+public class KeyEntity extends BaseEntity {
+
+
+    @Column(name = "institution_no",columnDefinition = "varchar(36) not null comment '机构编号'")
+    private String institutionNo;
+    @Column(name = "pub_key",columnDefinition = "text not null comment '公钥'")
+    private String pubKey;
+    @Column(name = "pri_key",columnDefinition = "text  comment '秘钥'")
+    private String priKey;
+    @Column(name = "call_time",columnDefinition = "int default 0 comment '调用次数'")
+    private int callTime;
+}

+ 8 - 0
src/main/java/com/rf/psychological/api/key/dao/repository/KeyRepository.java

@@ -0,0 +1,8 @@
+package com.rf.psychological.api.key.dao.repository;
+
+import com.rf.psychological.api.key.dao.model.KeyEntity;
+import com.rf.psychological.base.repository.BaseRepository;
+
+public interface KeyRepository extends BaseRepository <KeyEntity,String>{
+    KeyEntity findByInstitutionNo(String institutionNo);
+}

+ 52 - 0
src/main/java/com/rf/psychological/api/key/rest/KeyApi.java

@@ -0,0 +1,52 @@
+package com.rf.psychological.api.key.rest;
+
+import com.alibaba.fastjson.JSONObject;
+import com.rf.psychological.api.key.dao.model.KeyEntity;
+import com.rf.psychological.api.key.service.KeyService;
+import com.rf.psychological.base.rest.BaseController;
+import com.rf.psychological.security.AesEncryptUtils;
+import com.rf.psychological.utils.Result;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.data.domain.Page;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+import java.util.List;
+
+/**
+ * @Author:zzf
+ * @Date:2022/11/2:10:00
+ * @Description:秘钥管理
+ */
+@Slf4j
+@RestController
+@RequestMapping("/v1/key")
+@Api(tags = "秘钥")
+public class KeyApi extends BaseController {
+
+    @Autowired
+    private KeyService keyService;
+
+    @ApiOperation("保存秘钥")
+    @PostMapping("/save")
+    public Result save(@RequestBody String json) throws Exception {
+        KeyEntity key = JSONObject.parseObject(AesEncryptUtils.decrypt(JSONObject.parseObject(json).getString("data"))).toJavaObject(KeyEntity.class);
+        this.keyService.save(key);
+        return success();
+    }
+
+    @ApiOperation(value = "查询",notes = "如果按照机构号查询,key为institutionNo")
+    @PostMapping("/find")
+    public Result find(@RequestBody String json) throws Exception {
+        JSONObject jsonObject = JSONObject.parseObject(AesEncryptUtils.decrypt(JSONObject.parseObject(json).getString("data")));
+        List<KeyEntity> keyEntityList = this.keyService.find(jsonObject);
+        return success(keyEntityList);
+    }
+
+
+}

+ 19 - 0
src/main/java/com/rf/psychological/api/key/service/KeyService.java

@@ -0,0 +1,19 @@
+package com.rf.psychological.api.key.service;
+
+import com.alibaba.fastjson.JSONObject;
+import com.rf.psychological.api.key.dao.model.KeyEntity;
+
+import java.util.List;
+
+public interface KeyService {
+    void save(KeyEntity key);
+
+    List<KeyEntity> find(JSONObject jsonObject);
+
+    /**
+     * 机构编号查询
+     * @param institutionNo
+     * @return
+     */
+    KeyEntity find(String institutionNo);
+}

+ 57 - 0
src/main/java/com/rf/psychological/api/key/service/impl/KeyServiceImpl.java

@@ -0,0 +1,57 @@
+package com.rf.psychological.api.key.service.impl;
+
+import com.alibaba.fastjson.JSONObject;
+import com.rf.psychological.api.key.dao.model.KeyEntity;
+import com.rf.psychological.api.key.dao.repository.KeyRepository;
+import com.rf.psychological.api.key.service.KeyService;
+import com.rf.psychological.dao.model.DimensionEntity;
+import org.apache.commons.lang.StringUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.data.domain.Page;
+import org.springframework.data.jpa.domain.Specification;
+import org.springframework.stereotype.Service;
+
+import javax.persistence.criteria.Predicate;
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * @Author:zzf
+ * @Date:2022/11/2:10:56
+ * @Description:
+ */
+@Service
+public class KeyServiceImpl implements KeyService {
+
+    @Autowired
+    private KeyRepository keyRepository;
+    @Override
+    public void save(KeyEntity key) {
+        this.keyRepository.save(key);
+    }
+
+    @Override
+    public List<KeyEntity> find(JSONObject jsonObject) {
+        Specification<KeyEntity> subspecification  = (root, criteriaQuery, criteriaBuilder) -> {
+            List<Predicate> predicateList =  new ArrayList<>();
+           if(jsonObject.containsKey("institutionNo") && StringUtils.isNotBlank(jsonObject.getString("institutionNo"))){
+                predicateList.add(criteriaBuilder.equal(root.get("institutionNo"),jsonObject.getString("institutionNo")));
+           }
+            criteriaQuery.where(criteriaBuilder.and(predicateList.toArray(new Predicate[0])));
+            return criteriaQuery.getRestriction();
+        };
+        return this.keyRepository.findAll(subspecification);
+    }
+
+    /**
+     * 机构编号查询
+     *
+     * @param institutionNo
+     * @return
+     */
+    @Override
+    public KeyEntity find(String institutionNo) {
+
+        return this.keyRepository.findByInstitutionNo(institutionNo);
+    }
+}

+ 37 - 0
src/main/java/com/rf/psychological/base/model/BaseEntity.java

@@ -0,0 +1,37 @@
+package com.rf.psychological.base.model;
+
+
+import lombok.AllArgsConstructor;
+import lombok.Getter;
+import lombok.NoArgsConstructor;
+import lombok.Setter;
+import org.hibernate.annotations.GenericGenerator;
+import org.springframework.data.jpa.domain.support.AuditingEntityListener;
+
+import javax.persistence.*;
+import javax.validation.constraints.NotNull;
+import java.io.Serializable;
+
+/**
+ * @author zzf
+ * @description:
+ * @date 2021/1/18 19:13
+ */
+@Getter
+@Setter
+@NoArgsConstructor
+@AllArgsConstructor
+@EntityListeners({AuditingEntityListener.class})
+@MappedSuperclass
+public class BaseEntity implements Serializable {
+    @Getter
+    @Id
+    @GenericGenerator(name = "jpa-uuid", strategy = "uuid")
+    @GeneratedValue(generator = "jpa-uuid")
+    @Column(name = "id", columnDefinition = "varchar(36) COMMENT '数据ID'")
+    @NotNull(groups = Update.class)
+    private String id;
+
+    public @interface Update {
+    }
+}

+ 4 - 0
src/main/java/com/rf/psychological/base/package-info.java

@@ -0,0 +1,4 @@
+package com.rf.psychological.base;
+/**
+ * 基础信息
+ */

+ 19 - 0
src/main/java/com/rf/psychological/base/repository/BaseRepository.java

@@ -0,0 +1,19 @@
+package com.rf.psychological.base.repository;
+
+import org.springframework.data.jpa.repository.JpaRepository;
+import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
+import org.springframework.data.querydsl.QuerydslPredicateExecutor;
+import org.springframework.data.repository.NoRepositoryBean;
+import org.springframework.transaction.annotation.Transactional;
+
+import java.io.Serializable;
+
+/**
+ * @author zzf
+ * @description:
+ * @date 2021/1/18 19:17
+ */
+@NoRepositoryBean
+public interface BaseRepository<T, PK extends Serializable> extends JpaRepository<T, PK>, JpaSpecificationExecutor, QuerydslPredicateExecutor<T> {
+
+}

+ 77 - 0
src/main/java/com/rf/psychological/base/rest/BaseController.java

@@ -0,0 +1,77 @@
+package com.rf.psychological.base.rest;
+
+import com.rf.psychological.utils.HttpStatus;
+import com.rf.psychological.utils.Result;
+import com.rf.psychological.utils.ScaleResultBusinessMap;
+
+
+/**
+ * @author zzf
+ * @description:
+ * @date 2021/1/18 19:20
+ */
+public class BaseController {
+    protected static final String PAGE_NUM = "pageNum";
+
+    protected static final String PAGE_SIZE = "pageSize";
+
+    protected Result success() {
+        return success(null, "成功");
+    }
+
+    protected static <T> Result<T> success(T data) {
+        return success(data, "成功");
+    }
+
+    protected static <T> Result<T> success(T data, String message) {
+        if (null == data) {
+            return new Result<>(HttpStatus.SUCCESS, message);
+        }
+        return new Result<>(HttpStatus.SUCCESS, message, data);
+    }
+
+    protected static <T> Result<T> success(String code,T data, String message) {
+        if (null == data) {
+            return new Result<>(code, message);
+        }
+        return new Result<>(code, message, data);
+    }
+
+    protected Result fail() {
+        return fail(null, "失败");
+    }
+
+    protected static <T> Result<T> fail(T data) {
+        return fail(data, "失败");
+    }
+
+    protected static <T> Result<T> fail(String message) {
+        return new Result<>(HttpStatus.RUNTIME_EXCEPTION, message);
+    }
+
+    protected static <T> Result<T> fail(String code ,T data ,String message){
+        if(data == null)
+            return new Result<>(code,message);
+        else
+            return new Result<>(code,message,data);
+    }
+
+    protected static <T> Result<T> fail(T data, String message) {
+        if (null == data) {
+            return new Result<>(HttpStatus.RUNTIME_EXCEPTION, message);
+        }
+        return new Result<>(HttpStatus.RUNTIME_EXCEPTION, message, data);
+    }
+
+    protected Result failBadRequest() {
+        return failBadRequest(null, "参数异常");
+    }
+
+    protected static <T> Result<T> failBadRequest(T data) {
+        return failBadRequest(null, "参数异常");
+    }
+
+    protected static <T> Result<T> failBadRequest(T data, String message) {
+        return new Result<>(org.springframework.http.HttpStatus.BAD_REQUEST.value() + "", message, data);
+    }
+}

+ 46 - 0
src/main/java/com/rf/psychological/config/CorsConfig.java

@@ -0,0 +1,46 @@
+package com.rf.psychological.config;
+
+import org.springframework.context.annotation.Bean;
+import org.springframework.context.annotation.Configuration;
+import org.springframework.web.cors.CorsConfiguration;
+import org.springframework.web.cors.UrlBasedCorsConfigurationSource;
+import org.springframework.web.filter.CorsFilter;
+
+@Configuration
+public class CorsConfig {
+
+    private CorsConfiguration buildConfig() {
+
+        CorsConfiguration corsConfiguration = new CorsConfiguration();
+        corsConfiguration.setAllowCredentials(true);
+        /*corsConfiguration.addAllowedOrigin("http://localhost:8080"); // 允许任何域名使用
+        corsConfiguration.addAllowedOrigin("http://10.113.233.26:8080");
+        corsConfiguration.addAllowedOrigin("http://192.168.42.21:8080");
+        corsConfiguration.addAllowedOrigin("http://cognitive.wistcm.com/");*/
+//        corsConfiguration.addAllowedOrigin("*");
+        corsConfiguration.addAllowedOriginPattern("*");
+        corsConfiguration.addAllowedHeader("*"); // 允许任何头
+        corsConfiguration.addAllowedMethod("*"); // 允许任何方法(post、get等)
+        return corsConfiguration;
+
+        /*CorsConfiguration corsConfiguration = new CorsConfiguration();
+        corsConfiguration.setAllowCredentials(true);
+        // 设置setAllowCredentials = true后就不能设置为*了,要设置具体的
+        corsConfiguration.addAllowedOrigin("http://10.113.233.26:8080");
+        corsConfiguration.addAllowedOrigin("http://localhost:8080");
+        // 允许任何头
+        corsConfiguration.addAllowedHeader("*");
+        // 允许任何方法(post、get等)
+        corsConfiguration.addAllowedMethod("*");
+        return corsConfiguration;*/
+    }
+
+    @Bean
+    public CorsFilter corsFilter() {
+        UrlBasedCorsConfigurationSource source = new UrlBasedCorsConfigurationSource();
+        // 对接口配置跨域设置
+        source.registerCorsConfiguration("/**", buildConfig());
+        return new CorsFilter(source);
+    }
+
+}

+ 24 - 0
src/main/java/com/rf/psychological/config/Properties.java

@@ -0,0 +1,24 @@
+package com.rf.psychological.config;
+
+import org.springframework.boot.context.properties.ConfigurationProperties;
+import org.springframework.stereotype.Component;
+
+import java.time.Duration;
+import java.util.HashMap;
+import java.util.Map;
+
+/**
+ * @Author:zzf
+ * @Date:2022/7/5:18:15
+ * @Description:
+ */
+@Component
+@ConfigurationProperties(prefix = "redis-config")
+
+public class Properties {
+    private final Map<String, Duration> initCaches = new HashMap<>();
+    public Map<String ,Duration> getInitCache(){
+
+        return initCaches;
+    }
+}

+ 109 - 0
src/main/java/com/rf/psychological/config/RedisConfig.java

@@ -0,0 +1,109 @@
+package com.rf.psychological.config;
+
+import com.fasterxml.jackson.annotation.JsonAutoDetect;
+import com.fasterxml.jackson.annotation.PropertyAccessor;
+import com.fasterxml.jackson.databind.ObjectMapper;
+import com.fasterxml.jackson.databind.jsontype.impl.LaissezFaireSubTypeValidator;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.cache.CacheManager;
+import org.springframework.cache.annotation.CachingConfigurerSupport;
+import org.springframework.cache.annotation.EnableCaching;
+import org.springframework.context.annotation.Bean;
+import org.springframework.context.annotation.Configuration;
+import org.springframework.context.annotation.Profile;
+import org.springframework.data.redis.cache.CacheKeyPrefix;
+import org.springframework.data.redis.cache.RedisCacheConfiguration;
+import org.springframework.data.redis.cache.RedisCacheManager;
+import org.springframework.data.redis.cache.RedisCacheWriter;
+import org.springframework.data.redis.connection.RedisConfiguration;
+import org.springframework.data.redis.connection.RedisConnectionFactory;
+import org.springframework.data.redis.core.RedisTemplate;
+import org.springframework.data.redis.serializer.Jackson2JsonRedisSerializer;
+import org.springframework.data.redis.serializer.RedisSerializationContext;
+import org.springframework.data.redis.serializer.StringRedisSerializer;
+
+import java.time.Duration;
+import java.util.HashSet;
+import java.util.Set;
+import java.util.concurrent.ConcurrentHashMap;
+
+/**
+ * @Description:Redis缓存时间、序列化、反序列化等配置
+ * @Author: zsf
+ * @Date: 2022/7/1
+ */
+@Configuration
+@EnableCaching
+@Slf4j
+@Profile("!lan")
+public class RedisConfig extends CachingConfigurerSupport {
+    @Autowired
+    private Properties properties;
+
+    @Bean
+    public CacheManager cacheManager(RedisConnectionFactory factory) {
+        RedisCacheConfiguration cacheConfiguration = RedisCacheConfiguration
+                .defaultCacheConfig()
+                .entryTtl(Duration.ofDays(1))
+                .disableCachingNullValues()//不允许缓存空值
+                .serializeValuesWith(RedisSerializationContext.SerializationPair.fromSerializer(jackson2JsonRedisSerializer()));
+        RedisCacheWriter redisCacheWriter = RedisCacheWriter.nonLockingRedisCacheWriter(factory);
+        Set<String> cacheNames = new HashSet<>();
+        ConcurrentHashMap<String, RedisCacheConfiguration> cacheConfig = new ConcurrentHashMap<>();
+
+        properties.getInitCache().forEach((key, value) -> {
+            cacheNames.add(key);
+            cacheConfig.put(key,cacheConfiguration.entryTtl(value));
+        });
+        /*return RedisCacheManager
+                .builder(RedisCacheWriter.nonLockingRedisCacheWriter(factory))
+                .cacheDefaults(cacheConfiguration)
+                .transactionAware()
+                .build();*/
+        return RedisCacheManager.builder(redisCacheWriter)
+                .cacheDefaults(cacheConfiguration)
+                .initialCacheNames(cacheNames)
+                .withInitialCacheConfigurations(cacheConfig)
+                .build();
+    }
+
+
+    @Bean
+    public RedisTemplate<String, Object> redisTemplate(RedisConnectionFactory redisConnectionFactory) {
+        RedisTemplate<String, Object> redisTemplate = new RedisTemplate<>();
+        redisTemplate.setConnectionFactory(redisConnectionFactory);
+        // 用Jackson2JsonRedisSerializer来序列化和反序列化redis的value值
+        redisTemplate.setValueSerializer(jackson2JsonRedisSerializer());
+
+        StringRedisSerializer stringRedisSerializer = new StringRedisSerializer();
+        // 使用StringRedisSerializer来序列化和反序列化redis的key值
+        redisTemplate.setKeySerializer(stringRedisSerializer);
+
+        // hash的key也采用String的序列化方式
+        redisTemplate.setHashKeySerializer(stringRedisSerializer);
+        // hash的value序列化方式采用jackson
+        redisTemplate.setHashValueSerializer(jackson2JsonRedisSerializer());
+        redisTemplate.afterPropertiesSet();
+        return redisTemplate;
+    }
+
+    /**
+     * 配置Jackson2JsonRedisSerializer序列化策略
+     */
+    @Bean
+    public Jackson2JsonRedisSerializer<Object> jackson2JsonRedisSerializer() {
+        // 使用Jackson2JsonRedisSerializer来序列化和反序列化redis的value值
+        Jackson2JsonRedisSerializer<Object> jackson2JsonRedisSerializer = new Jackson2JsonRedisSerializer<>(Object.class);
+        ObjectMapper objectMapper = new ObjectMapper();
+
+        // 指定要序列化的域,field,get和set,以及修饰符范围,ANY是都有包括private和public
+        objectMapper.setVisibility(PropertyAccessor.ALL, JsonAutoDetect.Visibility.ANY);
+
+        // 指定序列化输入的类型,类必须是非final修饰的,final修饰的类,比如String,Integer等会跑出异常
+        objectMapper.activateDefaultTyping(LaissezFaireSubTypeValidator.instance, ObjectMapper.DefaultTyping.NON_FINAL);
+
+        jackson2JsonRedisSerializer.setObjectMapper(objectMapper);
+        return jackson2JsonRedisSerializer;
+    }
+}

+ 54 - 0
src/main/java/com/rf/psychological/config/Swagger2Config.java

@@ -0,0 +1,54 @@
+package com.rf.psychological.config;
+
+import org.springframework.context.annotation.Bean;
+import org.springframework.context.annotation.Configuration;
+import org.springframework.context.annotation.Profile;
+import springfox.documentation.builders.ApiInfoBuilder;
+import springfox.documentation.builders.ParameterBuilder;
+import springfox.documentation.builders.PathSelectors;
+import springfox.documentation.builders.RequestHandlerSelectors;
+import springfox.documentation.schema.ModelRef;
+import springfox.documentation.service.ApiInfo;
+import springfox.documentation.service.Parameter;
+import springfox.documentation.spi.DocumentationType;
+import springfox.documentation.spring.web.plugins.Docket;
+import springfox.documentation.swagger2.annotations.EnableSwagger2;
+
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * @author lpf
+ * @description:swagger 配置
+ * @date 2022/3/14 19:25
+ */
+@Configuration
+@EnableSwagger2
+@Profile({"test","lan"})
+public class Swagger2Config {
+
+    @Bean
+    public Docket createRestApi() {
+        //添加head参数配置start
+        ParameterBuilder tokenPar = new ParameterBuilder();
+        List<Parameter> pars = new ArrayList<>();
+        // Authorization,可以自定义名称-->token
+        tokenPar.name("Authorization").description("token令牌,格式为Bearer Token(可从/test/token接口处获取临时测试token)").modelRef(new ModelRef("string")).parameterType("header").required(false).build();
+        pars.add(tokenPar.build());
+        //添加head参数配置end
+        return new Docket(DocumentationType.SWAGGER_2)
+                .apiInfo(apiInfo())
+                .select()
+                .apis(RequestHandlerSelectors.basePackage("com.rf.psychological"))
+                .paths(PathSelectors.any())
+                .build()
+                .globalOperationParameters(pars);//注意这里
+    }
+
+    private ApiInfo apiInfo() {
+        return new ApiInfoBuilder()
+                .title("机构版后台接口")
+                .version("1.1")
+                .build();
+    }
+}

+ 25 - 0
src/main/java/com/rf/psychological/config/SystemExcludeFilter.java

@@ -0,0 +1,25 @@
+package com.rf.psychological.config;
+
+import com.rf.psychological.utils.Constant;
+import org.springframework.core.type.ClassMetadata;
+import org.springframework.core.type.classreading.MetadataReader;
+import org.springframework.core.type.classreading.MetadataReaderFactory;
+import org.springframework.core.type.filter.TypeFilter;
+
+/**
+ * @Author:zzf
+ * @Date:2022/7/24:11:36
+ * @Description:
+ */
+@Deprecated
+//@Profile("lan")
+public class SystemExcludeFilter implements TypeFilter {
+
+    @Override
+    public boolean match(MetadataReader metadataReader, MetadataReaderFactory metadataReaderFactory) {
+        ClassMetadata classMetadata = metadataReader.getClassMetadata();
+        String name = classMetadata.getClassName();
+        System.out.println("package-"+name);
+        return name.contains(Constant.EXCLUDE_PACKAGE_NAME);
+    }
+}

+ 25 - 0
src/main/java/com/rf/psychological/dao/cognizeModel/BSNTaskEntity.java

@@ -0,0 +1,25 @@
+package com.rf.psychological.dao.cognizeModel;
+
+import lombok.AllArgsConstructor;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+
+/**
+ * @author lpf
+ * @description:
+ * @date 2022/3/31 9:46
+ */
+@Data
+@AllArgsConstructor
+@NoArgsConstructor
+public class BSNTaskEntity {
+
+    private String index;
+
+    //选项图片名称
+    private String picName;
+
+    //图片选项:1---正确 2--提示 3---辨认 4---错误
+    private String picChoice;
+
+}

+ 27 - 0
src/main/java/com/rf/psychological/dao/cognizeModel/ECATEntity.java

@@ -0,0 +1,27 @@
+package com.rf.psychological.dao.cognizeModel;
+
+import lombok.AllArgsConstructor;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+
+/**
+ * @author lpf
+ * @description: 情绪分类任务
+ * @date 2022/4/19 8:50
+ */
+@Data
+@AllArgsConstructor
+@NoArgsConstructor
+public class ECATEntity {
+
+    private String index;
+
+    // 情绪类型 Pos, Neg
+    private String wordType;
+
+    //用户选择的情绪类型 1,0
+    private String userSelectWordType;
+
+    private String responseTime;
+
+}

+ 31 - 0
src/main/java/com/rf/psychological/dao/cognizeModel/EMEMEntity.java

@@ -0,0 +1,31 @@
+package com.rf.psychological.dao.cognizeModel;
+
+import lombok.AllArgsConstructor;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+
+/**
+ * @author lpf
+ * @description: 情绪识别记忆任务
+ * @date 2022/4/19 8:50
+ */
+@Data
+@AllArgsConstructor
+@NoArgsConstructor
+public class EMEMEntity {
+
+    private String index;
+
+    // "positive/negtive",词语类型
+    private String wordType;
+
+    //是否出现过0(否) 1(是)
+    private String appearedOrNot;
+
+    private String responseTime;
+
+    //反应是否正确0(错误),1(正确)
+    private String correct;
+
+
+}

+ 30 - 0
src/main/java/com/rf/psychological/dao/cognizeModel/ETB01Entity.java

@@ -0,0 +1,30 @@
+package com.rf.psychological.dao.cognizeModel;
+
+import lombok.AllArgsConstructor;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+
+/**
+ * @author lpf
+ * @description:
+ * @date 2022/4/19 8:50
+ */
+@Data
+@AllArgsConstructor
+@NoArgsConstructor
+public class ETB01Entity {
+
+    private String index;
+
+    private String emoType;
+
+    private String emoAmp;
+
+    private String userSelectEmoType;
+
+    private String responseTime;
+
+    private String correct;
+
+    private String imgUrl;
+}

+ 32 - 0
src/main/java/com/rf/psychological/dao/cognizeModel/FDOTEntity.java

@@ -0,0 +1,32 @@
+package com.rf.psychological.dao.cognizeModel;
+
+import lombok.AllArgsConstructor;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+
+/**
+ * @author lpf
+ * @description:
+ * @date 2022/5/22 16:44
+ */
+@Data
+@AllArgsConstructor
+@NoArgsConstructor
+public class FDOTEntity {
+
+    private Integer index;
+
+    private String emoType;
+
+    private Integer dotPos;
+
+    private String responseTime;
+
+    private Integer correct;
+
+    private Integer type;
+
+    private String positiveBias;
+
+    private String negativeBias;
+}

+ 112 - 0
src/main/java/com/rf/psychological/dao/dto/CognitiveTaskEntityDto.java

@@ -0,0 +1,112 @@
+package com.rf.psychological.dao.dto;
+
+import com.rf.psychological.dao.model.CognitiveTaskEntity;
+import lombok.Getter;
+import lombok.Setter;
+
+import javax.persistence.Column;
+
+/**
+ * @Author:zzf
+ * @Date:2022/8/16:11:01
+ * @Description:
+ */
+@Setter
+@Getter
+public class CognitiveTaskEntityDto {
+    private String id;
+
+//    查询标志
+    private String taskCode;
+//    任务说明
+    private String description;
+//    认知任务名称
+    private String name;
+//    图片路径
+    private String imageUrl;
+//    图片名称
+    private String imageName;
+//    测试任务描述
+    private String testDescription;
+//    测试次数
+    private int testNum;
+//    类型:0-量表;1-认知任务
+    private String type;
+//    分页路径
+    private String pageUrl;
+//    任务解释
+    private String testExplain;
+//    状态:0-可用;9-不可用
+    private int status;
+//    认知任务权限:private 私密  public 公开
+    private String scaleLimit;
+//    编号,用于排序
+    private int no;
+
+//    移动端任务说明
+    private String mobileDescription;
+
+//    移动端前台页面路径
+    private String mobilePageUrl;
+
+//    移动端测试任务描述
+    private String mobileTestDescription;
+
+//    移动端任务状态:0-不可用;1-可用
+    private String mobileStatus;
+
+//    报告版本:1-老模板报告;2-新模板报告
+    private String reportVersion;
+
+//    类型:1-有练习测试;2-无练习测试
+    private String practice;
+
+//    价格
+    private double price;
+
+    //    报告页数
+    private int reportPages;
+
+    //    任务配图
+    private String illustratingPicture;
+
+    //    预计用时(分钟)
+    private String estimatedTime;
+
+    //    参考文献
+    private String reference;
+
+    //    1热门测试
+    private String isHot;
+
+    //    1最新测试
+    private String isNew;
+
+
+    public CognitiveTaskEntityDto(CognitiveTaskEntity cognitiveTaskEntity) {
+        this.id = cognitiveTaskEntity.getId();
+        this.taskCode = cognitiveTaskEntity.getTaskCode();
+        this.description = cognitiveTaskEntity.getDescription();
+        this.name = cognitiveTaskEntity.getName();
+        this.imageUrl = cognitiveTaskEntity.getImageUrl();
+        this.imageName = cognitiveTaskEntity.getImageName();
+        this.testDescription = cognitiveTaskEntity.getTestDescription();
+        this.testNum = cognitiveTaskEntity.getTestNum();
+        this.type = cognitiveTaskEntity.getType();
+        this.pageUrl = cognitiveTaskEntity.getPageUrl();
+        this.testExplain = cognitiveTaskEntity.getTestExplain();
+        this.status = cognitiveTaskEntity.getStatus();
+        this.scaleLimit = cognitiveTaskEntity.getScaleLimit();
+        this.no = cognitiveTaskEntity.getNo();
+        this.mobileDescription = cognitiveTaskEntity.getMobileDescription();
+        this.mobilePageUrl = cognitiveTaskEntity.getMobilePageUrl();
+        this.mobileTestDescription = cognitiveTaskEntity.getMobileTestDescription();
+        this.mobileStatus = cognitiveTaskEntity.getMobileStatus();
+        this.reportVersion = cognitiveTaskEntity.getReportVersion();
+        this.practice = cognitiveTaskEntity.getPractice();
+        this.reportPages = cognitiveTaskEntity.getReportPages();
+        this.illustratingPicture = cognitiveTaskEntity.getIllustratingPicture();
+        this.estimatedTime = cognitiveTaskEntity.getEstimatedTime();
+        this.reference = cognitiveTaskEntity.getReference();
+    }
+}

+ 64 - 0
src/main/java/com/rf/psychological/dao/dto/InstitutionAuthConTaskDto.java

@@ -0,0 +1,64 @@
+package com.rf.psychological.dao.dto;
+
+import lombok.AllArgsConstructor;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+
+/**
+ * @author lpf
+ * @description:
+ * @date 26/10/2021上午11:18
+ */
+@JpaDto
+@Data
+@AllArgsConstructor
+@NoArgsConstructor
+public class InstitutionAuthConTaskDto {
+
+    //机构权限id
+    private String id;
+
+    //认知任务id
+    private String bid;
+
+    private String institutionNo;
+
+    private String type;
+
+    private String taskCode;
+
+    private String description;
+
+    private String name;
+
+    private String imageUrl;
+
+    private String imageName;
+
+    private String testDescription;
+
+    private Integer testNum;
+
+    private String pageUrl;
+
+    private String testExplain;
+
+    private String status;
+
+    private String scaleLimit;
+
+    private Integer no;
+
+
+    private String mobileDescription;
+
+
+    private String mobilePageUrl;
+
+
+    private String mobileTestDescription;
+
+
+    private String mobileStatus;
+
+}

+ 253 - 0
src/main/java/com/rf/psychological/dao/dto/InstitutionAuthSubjectNameDto.java

@@ -0,0 +1,253 @@
+package com.rf.psychological.dao.dto;
+
+import com.rf.psychological.security.EncryptDecodeConverter;
+
+import javax.persistence.Convert;
+
+/**
+ * @author lpf
+ * @description:
+ * @date 26/10/2021上午11:18
+ */
+@JpaDto
+public class InstitutionAuthSubjectNameDto {
+
+    //机构权限id
+    private String id;
+
+    private String bid;
+
+    private String institutionNo;
+
+    @Convert(converter = EncryptDecodeConverter.class)
+    private String description;
+
+    private String ename;
+
+    private String flag;
+
+    private String imageUrl;
+
+    private String isHot;
+
+    private String isNew;
+
+    private String name;
+
+    private int testNum;
+
+    private String type;
+
+    private String uploader;
+
+    private String fileName;
+
+    private String scoringPrinciple;
+
+    private String status;
+
+    private String scaleLimit;
+
+    private int no;
+
+    private String men;
+
+    private String iconInfo;
+
+    private Integer reportVersion;
+
+    public InstitutionAuthSubjectNameDto(String id, String bid, String institutionNo, String description, String ename, String flag, String imageUrl, String isHot, String isNew, String name, int testNum, String type, String uploader, String fileName, String scoringPrinciple, String status, String scaleLimit, int no, String men, String iconInfo, Integer reportVersion) {
+        this.id = id;
+        this.bid = bid;
+        this.institutionNo = institutionNo;
+        this.description = description;
+        this.ename = ename;
+        this.flag = flag;
+        this.imageUrl = imageUrl;
+        this.isHot = isHot;
+        this.isNew = isNew;
+        this.name = name;
+        this.testNum = testNum;
+        this.type = type;
+        this.uploader = uploader;
+        this.fileName = fileName;
+        this.scoringPrinciple = scoringPrinciple;
+        this.status = status;
+        this.scaleLimit = scaleLimit;
+        this.no = no;
+        this.men = men;
+        this.iconInfo = iconInfo;
+        this.reportVersion = reportVersion;
+    }
+
+    public InstitutionAuthSubjectNameDto() {
+    }
+
+    public String getId() {
+        return id;
+    }
+
+    public void setId(String id) {
+        this.id = id;
+    }
+
+    public String getbid() {
+        return bid;
+    }
+
+    public void setbid(String bId) {
+        this.bid = bId;
+    }
+
+    public String getInstitutionNo() {
+        return institutionNo;
+    }
+
+    public void setInstitutionNo(String institutionNo) {
+        this.institutionNo = institutionNo;
+    }
+
+    public String getDescription() {
+        return description;
+    }
+
+    public void setDescription(String description) {
+        this.description = description;
+    }
+
+    public String getEname() {
+        return ename;
+    }
+
+    public void setEname(String ename) {
+        this.ename = ename;
+    }
+
+    public String getFlag() {
+        return flag;
+    }
+
+    public void setFlag(String flag) {
+        this.flag = flag;
+    }
+
+    public String getImageUrl() {
+        return imageUrl;
+    }
+
+    public void setImageUrl(String imageUrl) {
+        this.imageUrl = imageUrl;
+    }
+
+    public String getIsHot() {
+        return isHot;
+    }
+
+    public void setIsHot(String isHot) {
+        this.isHot = isHot;
+    }
+
+    public String getIsNew() {
+        return isNew;
+    }
+
+    public void setIsNew(String isNew) {
+        this.isNew = isNew;
+    }
+
+    public String getName() {
+        return name;
+    }
+
+    public void setName(String name) {
+        this.name = name;
+    }
+
+    public int getTestNum() {
+        return testNum;
+    }
+
+    public void setTestNum(int testNum) {
+        this.testNum = testNum;
+    }
+
+    public String getType() {
+        return type;
+    }
+
+    public void setType(String type) {
+        this.type = type;
+    }
+
+    public String getUploader() {
+        return uploader;
+    }
+
+    public void setUploader(String uploader) {
+        this.uploader = uploader;
+    }
+
+    public String getFileName() {
+        return fileName;
+    }
+
+    public void setFileName(String fileName) {
+        this.fileName = fileName;
+    }
+
+    public String getScoringPrinciple() {
+        return scoringPrinciple;
+    }
+
+    public void setScoringPrinciple(String scoringPrinciple) {
+        this.scoringPrinciple = scoringPrinciple;
+    }
+
+    public String getStatus() {
+        return status;
+    }
+
+    public void setStatus(String status) {
+        this.status = status;
+    }
+
+    public String getScaleLimit() {
+        return scaleLimit;
+    }
+
+    public void setScaleLimit(String scaleLimit) {
+        this.scaleLimit = scaleLimit;
+    }
+
+    public int getNo() {
+        return no;
+    }
+
+    public void setNo(int no) {
+        this.no = no;
+    }
+
+    public String getMen() {
+        return men;
+    }
+
+    public void setMen(String men) {
+        this.men = men;
+    }
+
+    public String getIconInfo() {
+        return iconInfo;
+    }
+
+    public void setIconInfo(String iconInfo) {
+        this.iconInfo = iconInfo;
+    }
+
+    public Integer getReportVersion() {
+        return reportVersion;
+    }
+
+    public void setReportVersion(Integer reportVersion) {
+        this.reportVersion = reportVersion;
+    }
+}

+ 16 - 0
src/main/java/com/rf/psychological/dao/dto/InstitutionRecordingDTO.java

@@ -0,0 +1,16 @@
+package com.rf.psychological.dao.dto;
+
+/**
+ * @author lpf
+ * @description: 机构下用户测试记录实体类
+ * @date 22/9/2021下午7:30
+ */
+public interface InstitutionRecordingDTO {
+
+    public String getName();
+
+    public String getFlag();
+
+    public String getType();
+
+}

+ 39 - 0
src/main/java/com/rf/psychological/dao/dto/InstitutionRecordingUserApiDTO.java

@@ -0,0 +1,39 @@
+package com.rf.psychological.dao.dto;
+
+
+import lombok.AllArgsConstructor;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+
+/**
+ * @author lpf
+ * @description:
+ * @date 23/9/2021上午10:30
+ */
+@JpaDto
+@Data
+@AllArgsConstructor
+@NoArgsConstructor
+public class InstitutionRecordingUserApiDTO {
+
+    private String Phone;
+
+    private String PetName;
+
+    private String Gender;
+
+    private String Birthday;
+
+    private String InstitutionNo;
+
+    /**
+     * 记录表id
+     *
+     * @return
+     */
+    private String Id;
+
+    private String TestDate;
+
+
+}

+ 50 - 0
src/main/java/com/rf/psychological/dao/dto/InstitutionRecordingUserDTO.java

@@ -0,0 +1,50 @@
+package com.rf.psychological.dao.dto;
+
+
+/**
+ * @author lpf
+ * @description:
+ * @date 23/9/2021上午10:30
+ */
+
+public interface InstitutionRecordingUserDTO {
+
+    public String getPhone();
+
+    public String getPetName();
+
+    public String getPassword();
+
+    public String getGender();
+
+    public String getBirthday();
+
+    public String getProfession();
+
+    public String getInstitutionName();
+
+    public String getInstitutionNo();
+
+    public String getUserStatus();
+
+    public String getAdditionInfo();
+
+    public String getTestResults();
+
+    public String getImg();
+
+    public String getGid();
+
+    /**
+     * 记录表id
+     *
+     * @return
+     */
+    public String getId();
+
+    public String getTestDate();
+
+    public String getTestResult();
+
+
+}

+ 66 - 0
src/main/java/com/rf/psychological/dao/dto/InstitutionRecordingUsersDTO.java

@@ -0,0 +1,66 @@
+package com.rf.psychological.dao.dto;
+
+import lombok.AllArgsConstructor;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+
+/**
+ * @author lpf
+ * @description: 与InstitutionRecordingUsersDTO相比多了用户表的参数
+ * @date 23/9/2021上午10:30
+ */
+@JpaDto
+@Data
+@AllArgsConstructor
+@NoArgsConstructor
+public class InstitutionRecordingUsersDTO {
+
+    private String userId;
+
+    private String recordingId;
+
+    private String phone;
+
+    private String modelPhone;
+
+    private String petName;
+
+    private String gender;
+
+    private String birthday;
+
+    private String profession;
+
+    private String institutionName;
+
+    private String institutionNo;
+
+    private String userStatus;
+
+    private String additionInfo;
+
+    private String groupId;
+
+    private String flag;
+
+    private String name;
+
+    private String testDate;
+
+    private String testResult;
+
+    private String testResults;
+
+    private String fileName;
+
+    private String img;
+
+    private String type;
+
+    private String testRecord;
+
+    private String testPlanId;
+
+
+
+}

+ 18 - 0
src/main/java/com/rf/psychological/dao/dto/JpaDto.java

@@ -0,0 +1,18 @@
+package com.rf.psychological.dao.dto;
+
+import org.springframework.stereotype.Component;
+
+import java.lang.annotation.*;
+
+/**
+ * @author lpf
+ * @description: 自定义注解类,加载dto上表示这是个JpaDto类,解决jpa原生不能返回dto的问题
+ * @date 2022/4/6 21:08
+ */
+
+@Documented
+@Component
+@Target(value = {ElementType.TYPE})
+@Retention(RetentionPolicy.RUNTIME)
+public @interface JpaDto {
+}

+ 99 - 0
src/main/java/com/rf/psychological/dao/dto/JpaDtoConfig.java

@@ -0,0 +1,99 @@
+package com.rf.psychological.dao.dto;
+
+import com.rf.psychological.security.DESede;
+import com.rf.psychological.security.EncryptDecodeConverter;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.beans.BeanUtils;
+import org.springframework.beans.FatalBeanException;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.context.ApplicationContext;
+import org.springframework.context.annotation.Configuration;
+import org.springframework.core.convert.support.DefaultConversionService;
+import org.springframework.core.convert.support.GenericConversionService;
+
+import javax.annotation.PostConstruct;
+import javax.persistence.Convert;
+import java.beans.PropertyDescriptor;
+import java.lang.reflect.Field;
+import java.lang.reflect.Method;
+import java.lang.reflect.Modifier;
+import java.util.Map;
+
+/**
+ * @author lpf
+ * @description: 对加有@JpaDto的类注解的类进行实现converter方法
+ * @date 2022/4/6 21:12
+ */
+@Slf4j
+@Configuration
+public class JpaDtoConfig {
+
+    @Autowired
+    private ApplicationContext applicationContext;
+
+    /**
+     * 初始化注入@JpaDto对应的Converter
+     */
+    @PostConstruct
+    public void init() {
+        Map<String, Object> map = applicationContext.getBeansWithAnnotation(JpaDto.class);
+        for (Object o : map.values()) {
+            Class c = o.getClass();
+            log.info("Jpa添加Converter,class={}", c.getName());
+            GenericConversionService genericConversionService = ((GenericConversionService) DefaultConversionService.getSharedInstance());
+            genericConversionService.addConverter(Map.class, c, m -> {
+                try {
+                    Object obj = c.newInstance();
+                    // 这里可以扩展,注入的converter,实现sql查询出的结果为数据库中带下划线的字段,通过程序转为驼峰命名再设置到实体中
+                    // 也可以做类型转换判断,这里未做类型判断,直接copy到dto中,类型不匹配的时候可能会出错
+                    return copyMapToObj(m, obj);
+                } catch (Exception e) {
+                    throw new FatalBeanException("Jpa结果转换出错,class=" + c.getName(), e);
+                }
+            });
+        }
+    }
+
+    /**
+     * 将map中的值copy到bean中对应的字段上
+     *
+     * @param map
+     * @param target
+     * @return
+     */
+    private Object copyMapToObj(Map<String, Object> map, Object target) {
+        if (map == null || target == null || map.isEmpty()) {
+            return target;
+        }
+        Class<?> actualEditable = target.getClass();
+        PropertyDescriptor[] targetPds = BeanUtils.getPropertyDescriptors(actualEditable);
+        for (PropertyDescriptor targetPd : targetPds) {
+            if (targetPd.getWriteMethod() == null) {
+                continue;
+            }
+            try {
+                String key = targetPd.getName();
+                Object value = map.get(key);
+                if (value == null) {
+                    continue;
+                }
+                //对需要进行解密的字段进行解密处理
+                Field field = actualEditable.getDeclaredField(key);
+                Convert annotation = field.getAnnotation(Convert.class);
+                if (annotation != null) {
+                    if (annotation.converter() == EncryptDecodeConverter.class) {
+                        value = DESede.decryptString((String) value);
+                    }
+                }
+                Method writeMethod = targetPd.getWriteMethod();
+                if (!Modifier.isPublic(writeMethod.getDeclaringClass().getModifiers())) {
+                    writeMethod.setAccessible(true);
+                }
+                writeMethod.invoke(target, value);
+            } catch (Exception ex) {
+                throw new FatalBeanException("Could not copy properties from source to target", ex);
+            }
+        }
+        return target;
+    }
+}

+ 21 - 0
src/main/java/com/rf/psychological/dao/dto/ProgressDto.java

@@ -0,0 +1,21 @@
+package com.rf.psychological.dao.dto;
+
+import lombok.AllArgsConstructor;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+
+/**
+ * @author lpf
+ * @description:
+ * @date 2022/5/5 18:02
+ */
+@Data
+@AllArgsConstructor
+@NoArgsConstructor
+public class ProgressDto {
+
+    private long maxNum;
+
+    private long havingDoNum;
+
+}

+ 74 - 0
src/main/java/com/rf/psychological/dao/dto/SubjectEntityDto.java

@@ -0,0 +1,74 @@
+package com.rf.psychological.dao.dto;
+
+import com.rf.psychological.dao.model.CategorySubjectEntity;
+import com.rf.psychological.scale.dao.model.SubjectEntity;
+import lombok.Getter;
+import lombok.Setter;
+
+import java.util.List;
+
+/**
+ * @author zzf
+ * @description:
+ * @date 2021/8/11 14:38
+ */
+@Getter
+@Setter
+public class SubjectEntityDto {
+
+
+    private final String people;
+
+    private int no;
+
+    private String flag;
+
+    private String name;
+
+    private String type;
+
+    private String description;
+
+    private String isHot;
+
+    private int testNum;
+
+    private int isNew;
+
+    private String imageUrl;
+
+    private String uploader;
+
+    private String eName;
+
+    private String fileName;
+
+    private String scoringPrinciple;
+
+    private String scaleLimit;
+
+    private String reportKeyboarder;
+
+    private List<CategorySubjectEntity> category;
+
+    //价格  add by zzf  2022-08-16
+    private double price;
+    public SubjectEntityDto(SubjectEntity subjectEntity) {
+        this.no = subjectEntity.getNo();
+        this.flag = subjectEntity.getFlag();
+        this.name = subjectEntity.getName();
+        this.type = subjectEntity.getType();
+        this.description = subjectEntity.getDescription();
+        this.isHot = subjectEntity.getIsHot();
+        this.testNum = subjectEntity.getTestNum();
+        this.isNew = subjectEntity.getIsNew();
+        this.imageUrl = subjectEntity.getImageUrl();
+        this.uploader = subjectEntity.getUploader();
+        this.eName = subjectEntity.getEName();
+        this.fileName = subjectEntity.getFileName();
+        this.scoringPrinciple = subjectEntity.getScoringPrinciple();
+        this.scaleLimit = subjectEntity.getScaleLimit();
+        this.people = subjectEntity.getMen();
+        this.reportKeyboarder = subjectEntity.getReportKeyboarder();
+    }
+}

+ 56 - 0
src/main/java/com/rf/psychological/dao/dto/UserRecordsDto.java

@@ -0,0 +1,56 @@
+package com.rf.psychological.dao.dto;
+
+import lombok.AllArgsConstructor;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+import org.springframework.beans.factory.annotation.Autowired;
+
+import javax.persistence.Column;
+
+/**
+ * @author lpf
+ * @description: 用户测试记录界面返回参数(去除返回参数中的答题参数testRecord,testResults(老的数据格式)减少传参大小)
+ * @date 2022/5/12 15:39
+ */
+@Data
+@AllArgsConstructor
+@NoArgsConstructor
+public class UserRecordsDto {
+
+    private String id;
+
+    private String subjectOrCognitiveId;
+
+    private String phone;
+
+
+    private String institutionNo;
+
+
+    private String flag;
+
+
+    private String name;
+
+
+    private String testDate;
+
+
+    private String testResult;
+
+
+
+    private String fileName;
+
+
+    private String img;
+
+
+    private String type;
+
+
+    private String testPlanId;
+
+    private String pay;//是否已支付(0--免费;1--未支付;2--已支付)
+
+}

+ 36 - 0
src/main/java/com/rf/psychological/dao/dto/scale/NewResultDto.java

@@ -0,0 +1,36 @@
+package com.rf.psychological.dao.dto.scale;
+
+import lombok.AllArgsConstructor;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+
+/**
+ * @author lpf
+ * @description:
+ * @date 2022/4/20 12:44
+ */
+@Data
+@NoArgsConstructor
+@AllArgsConstructor
+public class NewResultDto {
+
+    private String name;
+
+    private String score;
+
+    private String symptom;
+
+    private String improvementSuggestions;
+
+    private String flag;
+
+    private String reference;
+
+    private String nameExplain;
+
+    private String suggestion;
+
+    private String isTotalScoreExplain;
+
+
+}

+ 2 - 0
src/main/java/com/rf/psychological/dao/lombok.config

@@ -0,0 +1,2 @@
+config.stopbubbling=true
+lombok.equalsandhashcode.callsuper=call

+ 50 - 0
src/main/java/com/rf/psychological/dao/model/ANTEntity.java

@@ -0,0 +1,50 @@
+package com.rf.psychological.dao.model;
+
+import lombok.AllArgsConstructor;
+import lombok.Getter;
+import lombok.NoArgsConstructor;
+import lombok.Setter;
+
+/**
+ * @author zSY
+ * @description:ANT测试实体对象
+ * @date 2021/3/4 16:54
+ */
+@Getter
+@Setter
+@NoArgsConstructor
+@AllArgsConstructor
+public class ANTEntity {
+
+    /**
+     * 序号
+     */
+    private String index;
+
+    /**
+     * 展示类型,+/其他
+     */
+    private String type;
+
+    /**
+     * 当前展示箭头的方向,L-左/R右
+     */
+    private String currentDir;
+
+    /**
+     * 用户反馈的方向,L-左/R右
+     */
+    private String userClickDir;
+
+    /**
+     * 反应时间
+     */
+    private String responseTime;
+
+    /**
+     * 是否为一致性
+     */
+    private String consistency;
+
+
+}

+ 66 - 0
src/main/java/com/rf/psychological/dao/model/ANTFISHV2Entity.java

@@ -0,0 +1,66 @@
+package com.rf.psychological.dao.model;
+
+import lombok.AllArgsConstructor;
+import lombok.Getter;
+import lombok.NoArgsConstructor;
+import lombok.Setter;
+
+/**
+ * @author zSY
+ * @description:ANT儿童版V2实体对象
+ * @date 2021/3/4 16:54
+ */
+@Getter
+@Setter
+@NoArgsConstructor
+@AllArgsConstructor
+public class ANTFISHV2Entity {
+
+    /**
+     * 序号
+     */
+    private int id;
+
+    /**
+     * 箭头朝向
+     */
+    private String answer;
+
+    /**
+     * 展示类型
+     */
+    private String pattern;
+
+    /**
+     * cue类型
+     */
+    private String cue;
+
+    /**
+     * 箭头出现的位置
+     */
+    private String position;
+
+    /**
+     * 是否一致
+     */
+    private String consistency;
+
+    /**
+     * 用户反应方向
+     */
+    private String userClickFlag;
+
+    /**
+     * 用户反应是否正确
+     */
+    private String userResponse;
+
+    /**
+     * 反应时间
+     */
+    private String responseTime;
+
+    private String arrow;
+
+}

+ 55 - 0
src/main/java/com/rf/psychological/dao/model/ASKEntity.java

@@ -0,0 +1,55 @@
+package com.rf.psychological.dao.model;
+
+import com.rf.psychological.base.model.BaseEntity;
+import lombok.*;
+import org.hibernate.annotations.DynamicUpdate;
+
+import javax.persistence.Column;
+import javax.persistence.Entity;
+import javax.persistence.Table;
+
+/**
+ * @author zzf
+ * @description:
+ * @date 2021/1/20 17:38
+ */
+@Entity
+@Data
+@Getter
+@Setter
+@NoArgsConstructor
+@AllArgsConstructor
+@Table(name = "t_ask_info")
+@org.hibernate.annotations.Table(appliesTo = "t_ask_info", comment = "艾森克人格量表")
+@DynamicUpdate
+public class ASKEntity extends BaseEntity {
+
+    /**
+     * 编号
+     */
+    @Column(name = "no", columnDefinition = "int(10) comment '编号'")
+    private int no;
+
+    /**
+     * 内容
+     */
+    @Column(name = "content", columnDefinition = "text comment '内容'")
+    private String content;
+
+    /**
+     * 选项
+     */
+    @Column(name = "check_items", columnDefinition = "text comment '选项'")
+    private String checkItems;
+
+    /**
+     * 类型
+     * 1:是记1分
+     * 0:否记1分
+     */
+    @Column(name = "type", columnDefinition = "varchar(2) comment '类型:1正向,0反向'")
+    private String type;
+
+    @Column(name = "scale", columnDefinition = "varchar(2) comment '量表'")
+    private String scale;
+}

+ 68 - 0
src/main/java/com/rf/psychological/dao/model/AnswerEntity.java

@@ -0,0 +1,68 @@
+package com.rf.psychological.dao.model;
+
+import com.rf.psychological.base.model.BaseEntity;
+import com.rf.psychological.security.EncryptDecodeConverter;
+import lombok.*;
+import org.hibernate.annotations.DynamicUpdate;
+
+import javax.persistence.Column;
+import javax.persistence.Convert;
+import javax.persistence.Entity;
+import javax.persistence.Table;
+
+/**
+ * @author zzf
+ * @description:答案选项实体类
+ * @date 2021/5/13 11:02
+ */
+@Entity
+@Data
+@Getter
+@Setter
+@NoArgsConstructor
+@AllArgsConstructor
+@Table(name = "t_answer_info")
+@org.hibernate.annotations.Table(appliesTo = "t_answer_info", comment = "答案选项表")
+@DynamicUpdate
+public class AnswerEntity extends BaseEntity {
+
+    @Column(name = "question_no", columnDefinition = "varchar(10) comment '所属题号'")
+    private String questionNo;
+
+    @Convert(converter = EncryptDecodeConverter.class)
+    @Column(name = "name", columnDefinition = "varchar(500) comment '答案内容'")
+    private String name;
+
+    @Column(name = "options", columnDefinition = "varchar(10) comment '选项值'")
+    private String options;
+
+    @Column(name = "question_type", columnDefinition = "varchar(10) comment '类型:0-单选 1-多选 2-填空'")
+    private String questionType;
+
+    @Convert(converter = EncryptDecodeConverter.class)
+    @Column(name = "score", columnDefinition = "varchar(100) comment '分值'")
+    private String score;
+
+    @Column(name = "score_direction", columnDefinition = "varchar(10) comment '计分方向:1-正向;0-反向'")
+    private String scoreDirection;
+
+    @Column(name = "flag", columnDefinition = "varchar(50) comment '标识:所属量表'")
+    private String flag;
+
+    ///**
+    // * 加密
+    // */
+    //public void encrypt() {
+    //    this.score = DESede.encryptString(this.score);
+    //    this.name = DESede.encryptString(this.name);
+    //}
+    //
+    ///**
+    // * 进行解密
+    // */
+    //public void decrypt() {
+    //    this.score = DESede.decryptString(this.score);
+    //    this.name = DESede.decryptString(this.name);
+    //}
+
+}

+ 40 - 0
src/main/java/com/rf/psychological/dao/model/AviationEntity.java

@@ -0,0 +1,40 @@
+package com.rf.psychological.dao.model;
+
+import com.rf.psychological.base.model.BaseEntity;
+import lombok.*;
+import org.hibernate.annotations.DynamicUpdate;
+
+import javax.persistence.Column;
+import javax.persistence.Entity;
+import javax.persistence.Table;
+
+/**
+ * @author zzf
+ * @description:汉化版美国航空航天局任务负荷指数量表
+ * @date 2021/1/20 17:47
+ */
+@Entity
+@Data
+@Getter
+@Setter
+@NoArgsConstructor
+@AllArgsConstructor
+@Table(name = "t_aviation_info")
+@org.hibernate.annotations.Table(appliesTo = "t_aviation_info", comment = "汉化版美国航空航天局任务负荷指数量表")
+@DynamicUpdate
+public class AviationEntity extends BaseEntity {
+    /**
+     * 编号
+     */
+    @Column(name = "no", columnDefinition = "int(10) comment '编号'")
+    private int no;
+
+    /**
+     * 内容
+     */
+    @Column(name = "content", columnDefinition = "text comment '内容'")
+    private String content;
+
+    @Column(name = "checked", columnDefinition = "varchar(10) comment '得分'")
+    private String checked;
+}

+ 35 - 0
src/main/java/com/rf/psychological/dao/model/CategorySubjectEntity.java

@@ -0,0 +1,35 @@
+package com.rf.psychological.dao.model;
+
+import com.rf.psychological.base.model.BaseEntity;
+import lombok.*;
+
+import javax.persistence.Column;
+import javax.persistence.Entity;
+import javax.persistence.Index;
+import javax.persistence.Table;
+
+/**
+ * @author zsy
+ * @description:量表-类别关联表
+ * @date 2021/6/17 15:55
+ */
+@Entity
+@Data
+@Getter
+@Setter
+@NoArgsConstructor
+@AllArgsConstructor
+@Table(name = "t_category_subject" ,indexes ={
+        @Index(columnList = "flag"),
+        @Index(columnList = "ename")
+})
+@org.hibernate.annotations.Table(appliesTo = "t_category_subject", comment = "量表-类别关联表")
+public class CategorySubjectEntity extends BaseEntity {
+
+    @Column(name="flag" ,columnDefinition = "varchar(50) not null comment '量表查询标志'")
+    private String flag ;
+
+    @Column(name = "ename",columnDefinition = "varchar(10) not null comment '类别英文名称'")
+    private String ename;
+
+}

+ 56 - 0
src/main/java/com/rf/psychological/dao/model/CattellEntity.java

@@ -0,0 +1,56 @@
+package com.rf.psychological.dao.model;
+
+import com.rf.psychological.base.model.BaseEntity;
+import lombok.AllArgsConstructor;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+
+import javax.persistence.Column;
+import javax.persistence.Entity;
+import javax.persistence.Table;
+
+/**
+ * @author zzf
+ * @description:卡氏十六种人格因素量表 实体类
+ * @date 2021/2/2 15:01
+ */
+@Entity
+@Data
+@NoArgsConstructor
+@AllArgsConstructor
+@Table(name = "t_cattell_info")
+@org.hibernate.annotations.Table(appliesTo = "t_cattell_info", comment = "卡氏十六种人格因素量表")
+public class CattellEntity extends BaseEntity {
+
+    /**
+     * 编号
+     */
+    @Column(name = "no", columnDefinition = "int (10) comment '编号'")
+    private int no;
+
+    /**
+     * 内容
+     */
+    @Column(name = "content", columnDefinition = "text comment '内容'")
+    private String content;
+
+    /**
+     * 选项
+     */
+    @Column(name = "check_items", columnDefinition = "text comment '选项'")
+    private String checkItems;
+
+    /**
+     * 默认选项
+     */
+    @Column(name = "checked", columnDefinition = "text comment '默认选项'")
+    private String checked;
+
+    /**
+     * 人格因素
+     */
+    @Column(name = "type", columnDefinition = "varchar(2) comment '人格因素'")
+    private String type;
+
+
+}

+ 84 - 0
src/main/java/com/rf/psychological/dao/model/CognitiveTaskEntity.java

@@ -0,0 +1,84 @@
+package com.rf.psychological.dao.model;
+
+import com.rf.psychological.base.model.BaseEntity;
+import lombok.*;
+import org.hibernate.annotations.DynamicUpdate;
+
+import javax.persistence.Column;
+import javax.persistence.Entity;
+import javax.persistence.Table;
+
+/**
+ * @author zsy
+ * @description:认知任务列表
+ * @date 2021/5/17 9:25
+ */
+@Entity
+@Data
+@Getter
+@Setter
+@NoArgsConstructor
+@AllArgsConstructor
+@Table(name = "t_cognitive_task")
+@org.hibernate.annotations.Table(appliesTo = "t_cognitive_task", comment = "认知任务列表信息表")
+@DynamicUpdate
+public class CognitiveTaskEntity extends BaseEntity {
+    @Column(name = "task_code", columnDefinition = "varchar(50) comment '查询标志'")
+    private String taskCode;
+    @Column(name = "description", columnDefinition = "text comment '任务说明'")
+    private String description;
+    @Column(name = "name", columnDefinition = "varchar(100) comment '认知任务名称'")
+    private String name;
+    @Column(name = "image_url", columnDefinition = "varchar(255) comment '图片路径'")
+    private String imageUrl;
+    @Column(name = "image_name", columnDefinition = "varchar(100) comment '图片名称'")
+    private String imageName;
+    @Column(name = "test_description", columnDefinition = "text comment '测试任务描述'")
+    private String testDescription;
+    @Column(name = "test_num", columnDefinition = "int(10) comment '测试次数'")
+    private int testNum;
+    @Column(name = "type", columnDefinition = "varchar(10) comment '类型:0-量表;1-认知任务'")
+    private String type;
+    @Column(name = "page_url", columnDefinition = "varchar(200) comment '分页路径'")
+    private String pageUrl;
+    @Column(name = "test_explain", columnDefinition = "text comment '任务解释'")
+    private String testExplain;
+    @Column(name = "status", columnDefinition = "varchar(1) comment '状态:0-可用;9-不可用'")
+    private int status;
+    @Column(name = "scale_limit", columnDefinition = "varchar(10) comment '认知任务权限:private 私密  public 公开'")
+    private String scaleLimit;
+    @Column(name = "no", columnDefinition = "int(10) comment '编号,用于排序'")
+    private int no;
+
+    @Column(name = "mobile_description", columnDefinition = "text default '无' comment '移动端任务说明'")
+    private String mobileDescription;
+
+    @Column(name = "mobile_page_url", columnDefinition = "varchar(200) default '无' comment '移动端前台页面路径'")
+    private String mobilePageUrl;
+
+    @Column(name = "mobile_test_description", columnDefinition = "text default '无' comment '移动端测试任务描述'")
+    private String mobileTestDescription;
+
+    @Column(name = "mobile_status", columnDefinition = "varchar(1) default '0' comment '移动端任务状态:0-不可用;1-可用'")
+    private String mobileStatus;
+
+    @Column(name = "report_version", columnDefinition = "varchar(1) default '1' comment '报告版本:1-老模板报告;2-新模板报告'")
+    private String reportVersion;
+
+    @Column(name = "practice", columnDefinition = "varchar(10) default '2' comment '类型:1-有练习测试;2-无练习测试'")
+    private String practice;
+
+    @Column(name = "illustrating_picture", columnDefinition = "varchar(255) comment '任务配图'")
+    private String illustratingPicture;
+
+    @Column(name = "estimated_time", columnDefinition = "varchar(5) comment '预计用时(分钟)'")
+    private String estimatedTime;
+
+    @Column(name = "report_pages", columnDefinition = "int(5) default '3' comment '报告页数'")
+    private int reportPages;
+
+    @Column(name = "reference", columnDefinition = "varchar(1000) comment '参考文献'")
+    private String reference;
+
+
+}

+ 30 - 0
src/main/java/com/rf/psychological/dao/model/DSTEntity.java

@@ -0,0 +1,30 @@
+package com.rf.psychological.dao.model;
+
+import lombok.AllArgsConstructor;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+
+/**
+ * @author lpf
+ * @description:
+ * @date 2022/3/21 15:34
+ */
+@Data
+@AllArgsConstructor
+@NoArgsConstructor
+public class DSTEntity {
+
+    private String index;
+
+    private String diff;
+
+    private String type;
+
+    private String qNumberSequence;
+
+    private String userResponseSequence;
+
+    private String rightOrWrong;
+
+    private String responseTime;
+}

+ 53 - 0
src/main/java/com/rf/psychological/dao/model/DepressEntity.java

@@ -0,0 +1,53 @@
+package com.rf.psychological.dao.model;
+
+import com.rf.psychological.base.model.BaseEntity;
+import lombok.*;
+
+import javax.persistence.Column;
+import javax.persistence.Entity;
+import javax.persistence.Table;
+
+/**
+ * @author zzf
+ * @description:抑郁焦虑压力量表
+ * @date 2021/1/20 18:31
+ */
+@Entity
+@Data
+@Getter
+@Setter
+@NoArgsConstructor
+@AllArgsConstructor
+@Table(name = "t_depress_info")
+@org.hibernate.annotations.Table(appliesTo = "t_depress_info", comment = "抑郁焦虑压力量表")
+public class DepressEntity extends BaseEntity {
+    /**
+     * 编号
+     */
+    @Column(name = "no", columnDefinition = "int (10) comment '编号'")
+    private int no;
+
+    /**
+     * 内容
+     */
+    @Column(name = "content", columnDefinition = "text comment '内容'")
+    private String content;
+
+    /**
+     * 选项
+     */
+    @Column(name = "check_items", columnDefinition = "text comment '选项'")
+    private String checkItems;
+
+    /**
+     * 默认选项
+     */
+    @Column(name = "checked", columnDefinition = "text comment '默认选项'")
+    private String checked;
+
+    /**
+     * 类型
+     */
+    @Column(name = "type", columnDefinition = "varchar(2) comment '类型 1压力指数  2焦虑指数  3抑郁指数'")
+    private String type;
+}

+ 59 - 0
src/main/java/com/rf/psychological/dao/model/DimensionEntity.java

@@ -0,0 +1,59 @@
+package com.rf.psychological.dao.model;
+
+import com.rf.psychological.base.model.BaseEntity;
+import com.rf.psychological.security.EncryptDecodeConverter;
+import lombok.*;
+import org.hibernate.annotations.DynamicUpdate;
+
+import javax.persistence.Column;
+import javax.persistence.Convert;
+import javax.persistence.Entity;
+import javax.persistence.Table;
+
+/**
+ * @author zzf
+ * @description:量表维度实体类
+ * @date 2021/5/13 11:02
+ */
+@Entity
+@Data
+@Getter
+@Setter
+@NoArgsConstructor
+@AllArgsConstructor
+@Table(name = "t_dimension_info")
+@org.hibernate.annotations.Table(appliesTo = "t_dimension_info", comment = "量表维度表")
+@DynamicUpdate
+public class DimensionEntity extends BaseEntity {
+
+    @Convert(converter = EncryptDecodeConverter.class)
+    @Column(name = "name", columnDefinition = "varchar(400) comment '维度名称'")
+    private String name;
+
+    @Convert(converter = EncryptDecodeConverter.class)
+    @Column(name = "question_no", columnDefinition = "varchar(600) comment '所含题号'")
+    private String questionNo;
+
+    @Column(name = "flag", columnDefinition = "varchar(50) comment '标识:所属量表'")
+    private String flag;
+
+    @Column(name = "is_icon_flag", columnDefinition = "varchar(2) default '0' comment '表示当前字段是否需要在图表展示:0---否,1---是'")
+    private String isIconFlag;
+
+    ///**
+    // * 加密
+    // */
+    //public void encrypt() {
+    //    this.questionNo = DESede.encryptString(this.questionNo);
+    //    this.name = DESede.encryptString(this.name);
+    //}
+    //
+    ///**
+    // * 进行解密
+    // */
+    //public void decrypt() {
+    //    this.questionNo = DESede.decryptString(this.questionNo);
+    //    this.name = DESede.decryptString(this.name);
+    //}
+
+}

+ 58 - 0
src/main/java/com/rf/psychological/dao/model/EATEntity.java

@@ -0,0 +1,58 @@
+package com.rf.psychological.dao.model;
+
+import lombok.AllArgsConstructor;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+
+/**
+ * @author zsy
+ * @description:面孔情绪评价任务
+ * @date 2021/2/1 15:12
+ */
+
+@NoArgsConstructor
+@AllArgsConstructor
+@Data
+public class EATEntity {
+
+    /**
+     *  图片名称
+     */
+    private String name;
+
+    /**
+     * 情绪类型
+     */
+    private String emoType;
+
+    /**
+     * 用户反应类型
+     */
+    private String userResponse;
+
+    /**
+     *  是否正确
+     */
+    private String correct;
+
+    /**
+     * 吸引力
+     */
+    private String xiyin;
+
+    /**
+     * 愉悦度
+     */
+    private String yuyue;
+
+    /**
+     * 唤醒度
+     */
+    private String huanxing;
+
+    /**
+     * 优势度
+     */
+    private String youshi;
+
+}

+ 43 - 0
src/main/java/com/rf/psychological/dao/model/EPRTEntity.java

@@ -0,0 +1,43 @@
+package com.rf.psychological.dao.model;
+
+import lombok.AllArgsConstructor;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+
+/**
+ * @author zsy
+ * @description:情绪图片评定任务
+ * @date 2021/2/1 15:12
+ */
+
+@NoArgsConstructor
+@AllArgsConstructor
+@Data
+public class EPRTEntity {
+
+    /**
+     *  图片名称
+     */
+    private String name;
+
+    /**
+     * 恐惧等级
+     */
+    private String level;
+
+    /**
+     * 效价
+     */
+    private String xiaojia;
+
+    /**
+     *  唤起度
+     */
+    private String huanqi;
+
+    /**
+     * 优势度
+     */
+    private String youshi;
+
+}

+ 47 - 0
src/main/java/com/rf/psychological/dao/model/GBEEntity.java

@@ -0,0 +1,47 @@
+package com.rf.psychological.dao.model;
+
+import lombok.AllArgsConstructor;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+
+/**
+ * @author lpf
+ * @description: 枪林弹雨
+ * @date 6/12/2021下午12:13
+ */
+@Data
+@AllArgsConstructor
+@NoArgsConstructor
+public class GBEEntity {
+
+    //游戏关卡
+    private String level;
+
+    //是否通过
+    private String isPassed;
+
+    //反应时间
+    private String responseTimeDanger1;
+
+    //反应时间
+    private String responseTimeDanger2;
+
+    //反应时间
+    private String responseTimeDanger3;
+
+    //反应时间
+    private String responseTimeDanger4;
+
+    //得分
+    private String score;
+
+    //错误个数
+    private String errorNum;
+
+    //道路个数
+    private String roadNum;
+
+    //正确率
+    private String rightRate;
+
+}

+ 50 - 0
src/main/java/com/rf/psychological/dao/model/GONOGO2Entity.java

@@ -0,0 +1,50 @@
+package com.rf.psychological.dao.model;
+
+import lombok.AllArgsConstructor;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+
+/**
+ * @author zsy
+ * @description:GO/NO-GO测试2实体类
+ * @date 2021/2/1 15:12
+ */
+
+@NoArgsConstructor
+@AllArgsConstructor
+@Data
+public class GONOGO2Entity {
+
+    /**
+     * 箭头朝向 0向左,1向右
+     */
+    private String arrowDirection;
+
+    /**
+     * 信号颜色 0红色,1绿色
+     */
+
+    private String color;
+
+    /**
+     * 是否需要反应 0无需反应,1需反应
+     */
+    private String needResponse;
+
+    /**
+     * 用户点击方向 0向左,1向右
+     */
+
+    private String userDirection;
+
+    /**
+     * 反应是否正确
+     */
+    private String responseTrue;
+
+    /**
+     * 用户反应时间
+     */
+    private String responseTime;
+
+}

+ 39 - 0
src/main/java/com/rf/psychological/dao/model/GONOGOADDICTIONEntity.java

@@ -0,0 +1,39 @@
+package com.rf.psychological.dao.model;
+
+import lombok.AllArgsConstructor;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+
+/**
+ * @author zzf
+ * @description:GO/NO-GO测试成瘾版实体类
+ * @date 2021/2/1 15:12
+ */
+
+@NoArgsConstructor
+@AllArgsConstructor
+@Data
+public class GONOGOADDICTIONEntity {
+
+    /**
+     * 刺激类型
+     */
+    private String stimulateType;
+
+    /**
+     * 信号颜色
+     */
+
+    private String color;
+
+    /**
+     * 按键正误
+     */
+    private String rightOrWrong;
+
+    /**
+     * 响应时间
+     */
+    private int rspTime;
+
+}

+ 39 - 0
src/main/java/com/rf/psychological/dao/model/GONOGOEntity.java

@@ -0,0 +1,39 @@
+package com.rf.psychological.dao.model;
+
+import lombok.AllArgsConstructor;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+
+/**
+ * @author zzf
+ * @description:GO/NO-GO测试实体类
+ * @date 2021/2/1 15:12
+ */
+
+@NoArgsConstructor
+@AllArgsConstructor
+@Data
+public class GONOGOEntity {
+
+    /**
+     * 轮次
+     */
+    private String circle;
+
+    /**
+     * 信号颜色
+     */
+
+    private String color;
+
+    /**
+     * 本轮出现次数
+     */
+    private String times;
+
+    /**
+     * 响应时间
+     */
+    private int rspTime;
+
+}

+ 54 - 0
src/main/java/com/rf/psychological/dao/model/GTCTEntity.java

@@ -0,0 +1,54 @@
+package com.rf.psychological.dao.model;
+
+import lombok.AllArgsConstructor;
+import lombok.Getter;
+import lombok.NoArgsConstructor;
+import lombok.Setter;
+
+/**
+ * @author zsy
+ * @description:目标追踪认知任务
+ * @date 2021/1/19 16:31
+ */
+@Getter
+@Setter
+@NoArgsConstructor
+@AllArgsConstructor
+public class GTCTEntity {
+
+    /**
+     * 正确率(%)
+     */
+    private String raghtRate;
+
+    /**
+     * 运动速度(秒)
+     */
+    private String velocity;
+
+    /**
+     * 运动时长
+     */
+    private String duration;
+
+    /**
+     * 追踪目标数
+     */
+    private int targetNum;
+
+    /**
+     * 难度等级
+     */
+    private int diff;
+
+    /**
+     * 序号
+     */
+    private int index;
+
+    /**
+     * 反应时间
+     */
+    private String responseTime;
+
+}

+ 31 - 0
src/main/java/com/rf/psychological/dao/model/HaiKongJiZhanAndTanKeHongLiuEntity.java

@@ -0,0 +1,31 @@
+package com.rf.psychological.dao.model;
+
+import lombok.AllArgsConstructor;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+
+/**
+ * @author lpf
+ * @description:
+ * @date 2022/1/1415:05
+ */
+@Data
+@AllArgsConstructor
+@NoArgsConstructor
+public class HaiKongJiZhanAndTanKeHongLiuEntity {
+
+    //关卡数
+    private String levelNum;
+
+    //每关反应时间
+    private String everyReactionTimes;
+
+    //每关平均反应时间
+    private String averageSlideTimes;
+
+    //每关得分
+    private String scores;
+
+    //每关正确率
+    private String correctRate;
+}

+ 48 - 0
src/main/java/com/rf/psychological/dao/model/HearingTestEntity.java

@@ -0,0 +1,48 @@
+package com.rf.psychological.dao.model;
+
+import com.rf.psychological.base.model.BaseEntity;
+import lombok.*;
+import org.hibernate.annotations.DynamicUpdate;
+
+import javax.persistence.Column;
+import javax.persistence.Entity;
+import javax.persistence.Table;
+
+/**
+ * @author zsf
+ * @description:听觉词语学习测验(华山版)
+ * @date 2021/5/13 11:02
+ */
+@Entity
+@Data
+@Getter
+@Setter
+@NoArgsConstructor
+@AllArgsConstructor
+@Table(name = "t_hearing_test" )
+@org.hibernate.annotations.Table(appliesTo = "t_hearing_test", comment = "听觉词语学习测验(华山版)表")
+@DynamicUpdate
+public class HearingTestEntity extends BaseEntity {
+
+    @Column(name = "phone",columnDefinition = "varchar(11) not null comment '用户手机号'")
+    private String phone;
+
+    @Column(name = "round",columnDefinition = "varchar(5) not null comment '所属轮次'")
+    private String round;
+
+    @Column(name = "correct_no",columnDefinition = "int(4) comment '正确数'")
+    private String correctNo;
+
+    @Column(name = "grade",columnDefinition = "int(4) comment '得分'")
+    private String grade;
+
+    @Column(name = "status",columnDefinition = "int(2) not null comment '状态:0-已结束;1-进行中'")
+    private int status;
+
+    @Column(name = "test_date",columnDefinition = "varchar(50) not null comment '测试日期'")
+    private String testDate;
+
+    @Column(name = "correlation",columnDefinition = "varchar(36) comment '关联测试id'")
+    private String correlation;
+
+}

+ 38 - 0
src/main/java/com/rf/psychological/dao/model/LifeEntity.java

@@ -0,0 +1,38 @@
+package com.rf.psychological.dao.model;
+
+import com.rf.psychological.base.model.BaseEntity;
+import lombok.AllArgsConstructor;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+import org.hibernate.annotations.DynamicUpdate;
+
+import javax.persistence.Column;
+import javax.persistence.Entity;
+import javax.persistence.Table;
+
+/**
+ * @author zzf
+ * @description:
+ * @date 2021/2/1 16:46
+ */
+@Data
+@Entity
+@NoArgsConstructor
+@AllArgsConstructor
+@Table(name = "t_life_info")
+@org.hibernate.annotations.Table(appliesTo = "t_life_info", comment = "生活事件量表")
+@DynamicUpdate
+public class LifeEntity extends BaseEntity {
+
+    @Column(name = "no", columnDefinition = "int(10) comment '题号'")
+    private int no;
+
+    @Column(name = "content", columnDefinition = "varchar(200) comment '内容'")
+    private String content;
+
+    @Column(name = "checked", columnDefinition = "varchar(10) comment '发生次数'")
+    private String checked;
+
+    @Column(name = "score", columnDefinition = "int(10) comment '单次分值'")
+    private int score;
+}

+ 72 - 0
src/main/java/com/rf/psychological/dao/model/MemoryCheckEntity.java

@@ -0,0 +1,72 @@
+package com.rf.psychological.dao.model;
+
+import com.rf.psychological.base.model.BaseEntity;
+import lombok.*;
+import org.hibernate.annotations.DynamicUpdate;
+
+import javax.persistence.Column;
+import javax.persistence.Entity;
+import javax.persistence.Table;
+
+/**
+ * @author zzf
+ * @description:记忆检查实体类
+ * @date 2021/5/13 11:02
+ */
+@Entity
+@Data
+@Getter
+@Setter
+@NoArgsConstructor
+@AllArgsConstructor
+@Table(name = "t_memory_check" )
+@org.hibernate.annotations.Table(appliesTo = "t_memory_check", comment = "记忆检查结果表")
+@DynamicUpdate
+public class MemoryCheckEntity extends BaseEntity {
+
+    @Column(name = "phone",columnDefinition = "varchar(20) not null comment '用户手机号'")
+    private String phone;
+
+    @Column(name = "institution_no", columnDefinition = "varchar(50) comment '所属机构编码'")
+    private String institutionNo;
+
+    @Column(name = "question_no",columnDefinition = "varchar(5) not null comment '所属题号'")
+    private String questionNo;
+
+    @Column(name = "gradea",columnDefinition = "int(4) comment '成绩a'")
+    private String gradea;
+
+    @Column(name = "gradeb",columnDefinition = "int(4) comment '成绩b'")
+    private String gradeb;
+
+    @Column(name = "gradec",columnDefinition = "int(4) comment '成绩c'")
+    private String gradec;
+
+    @Column(name = "mina",columnDefinition = "varchar(15) comment '时长a'")
+    private String mina;
+
+    @Column(name = "minb",columnDefinition = "varchar(15) comment '时长b'")
+    private String minb;
+
+    @Column(name = "memory_type" ,columnDefinition = "int(2) not null comment '记忆类型:0-无需记忆;1-即时记忆;2-延时记忆;3-长时记忆'")
+    private int memoryType;
+
+    @Column(name = "status",columnDefinition = "int(2) not null comment '状态:0-已结束;1-进行中'")
+    private int status;
+
+    @Column(name = "test_date",columnDefinition = "varchar(50) not null comment '测试日期'")
+    private String testDate;
+
+    @Column(name = "correlation_emory",columnDefinition = "varchar(36) comment '关联记忆id'")
+    private String correlationMemory;
+
+    @Column(name = "credentials",columnDefinition = "varchar(255) comment '既时记忆凭证'")
+    private String credentials;
+
+    @Column(name = "type" ,columnDefinition = "varchar(50) DEFAULT 'RTC' comment '任务类型:RTC-成人版;RTC_CHILD-儿童版'")
+    private String type;
+
+    @Column(name = "test_type" ,columnDefinition = "varchar(5) DEFAULT '0' comment '测试类型:0-流程测试;1-分项测试'")
+    private String testType;
+
+}

+ 46 - 0
src/main/java/com/rf/psychological/dao/model/MemoryEntity.java

@@ -0,0 +1,46 @@
+package com.rf.psychological.dao.model;
+
+import lombok.AllArgsConstructor;
+import lombok.Getter;
+import lombok.NoArgsConstructor;
+import lombok.Setter;
+
+/**
+ * @author zzf
+ * @description:工作记忆能力测试实体对象
+ * @date 2021/3/4 16:54
+ */
+@Getter
+@Setter
+@NoArgsConstructor
+@AllArgsConstructor
+public class MemoryEntity {
+
+    /**
+     * 任务种类  0-back    1-back  2-back
+     * 0 ,1 , 2
+     */
+    private int backCount;
+
+    /**
+     * 组块序号:每种任务6个组块
+     */
+    private int groupCount;
+
+    /**
+     * 字母序号:0-17
+     */
+    private int charShowCount;
+
+    /**
+     * 字母
+     */
+    private String charStr;
+
+    /**
+     * 响应时间
+     */
+    private int time;
+
+
+}

+ 55 - 0
src/main/java/com/rf/psychological/dao/model/MemoryTestEntity.java

@@ -0,0 +1,55 @@
+package com.rf.psychological.dao.model;
+
+import lombok.AllArgsConstructor;
+import lombok.Getter;
+import lombok.NoArgsConstructor;
+import lombok.Setter;
+
+/**
+ * @author zzf
+ * @description:工作记忆能力测试(空间记忆)2
+ * @date 2021/3/4 16:54
+ */
+@Getter
+@Setter
+@NoArgsConstructor
+@AllArgsConstructor
+public class MemoryTestEntity {
+
+    /**
+     * 图片1
+     */
+    private String img1;
+
+    /**
+     * 图片2
+     */
+    private String img2;
+
+    /**
+     * 时间间隔
+     */
+    private String timeSpan;
+
+    /**
+     * 是否是相同图片
+     */
+    private String same;
+
+    /**
+     * 左键或右键
+     */
+    private String keyType;
+
+    /**
+     * 用户反应是否正确
+     */
+    private String userResponse;
+
+    /**
+     * 反应时间
+     */
+    private String responseTime;
+
+
+}

+ 46 - 0
src/main/java/com/rf/psychological/dao/model/MoodEntity.java

@@ -0,0 +1,46 @@
+package com.rf.psychological.dao.model;
+
+import com.rf.psychological.base.model.BaseEntity;
+import lombok.*;
+import org.hibernate.annotations.DynamicUpdate;
+
+import javax.persistence.Column;
+import javax.persistence.Entity;
+import javax.persistence.Table;
+
+/**
+ * @author zzf
+ * @description:正性负性情绪量表
+ * @date 2021/1/20 18:40
+ */
+@Entity
+@Data
+@Getter
+@Setter
+@NoArgsConstructor
+@AllArgsConstructor
+@Table(name = "t_mood_info")
+@org.hibernate.annotations.Table(appliesTo = "t_mood_info", comment = "正性负性情绪量表")
+@DynamicUpdate
+public class MoodEntity extends BaseEntity {
+    /**
+     * 编号
+     */
+    @Column(name = "no", columnDefinition = "int(10) comment '编号'")
+    private int no;
+
+    /**
+     * 内容
+     */
+    @Column(name = "content", columnDefinition = "text comment '内容'")
+    private String content;
+
+    /**
+     * 类型:1 正向情绪 0 反向情绪
+     */
+    @Column(name = "type", columnDefinition = "varchar(2) comment '类型:1正向情绪 0反向情绪'")
+    private String type;
+
+    @Column(name = "checked", columnDefinition = "varchar(50) comment '选择项'")
+    private String checked;
+}

+ 52 - 0
src/main/java/com/rf/psychological/dao/model/MovementEntity.java

@@ -0,0 +1,52 @@
+package com.rf.psychological.dao.model;
+
+import lombok.AllArgsConstructor;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+
+/**
+ * @author lpf
+ * @description:
+ * @date 14/12/2021下午10:10
+ */
+@Data
+@AllArgsConstructor
+@NoArgsConstructor
+public class MovementEntity {
+
+    /**
+     * 序号
+     */
+    private String index;
+
+    /**
+     * 难度系数
+     */
+    private String diff;
+
+    /**
+     * 运动方向
+     */
+    private String direction;
+
+    /**
+     * 用户反应方向
+     */
+    private String userResponse;
+
+    /**
+     * 反应时间
+     */
+    private String responseTime;
+
+    /**
+     * 噪声
+     */
+    private String noise;
+
+    /**
+     * 速度
+     */
+    private String dist;
+
+}

+ 27 - 0
src/main/java/com/rf/psychological/dao/model/ObjectEntity.java

@@ -0,0 +1,27 @@
+package com.rf.psychological.dao.model;
+
+import lombok.AllArgsConstructor;
+import lombok.Getter;
+import lombok.NoArgsConstructor;
+import lombok.Setter;
+
+/**
+ * @author zzf
+ * @description:认知任务测试通用实体类:1、瑞文测试 2、精神警觉度测试  3、连续假发测试
+ * @date 2021/1/30 11:55
+ */
+@Getter
+@Setter
+@NoArgsConstructor
+@AllArgsConstructor
+public class ObjectEntity {
+
+    /**
+     * 题目
+     */
+    private String key;
+    /**
+     *
+     */
+    private String value;
+}

+ 51 - 0
src/main/java/com/rf/psychological/dao/model/POMSEntity.java

@@ -0,0 +1,51 @@
+package com.rf.psychological.dao.model;
+
+import com.rf.psychological.base.model.BaseEntity;
+import lombok.*;
+
+import javax.persistence.Column;
+import javax.persistence.Entity;
+import javax.persistence.Table;
+
+/**
+ * @author zzf
+ * @description:心境状态量表(POMS)
+ * @date 2021/1/20 8:44
+ */
+@Entity
+@Data
+@Getter
+@Setter
+@NoArgsConstructor
+@AllArgsConstructor
+@Table(name = "t_poms_info")
+@org.hibernate.annotations.Table(appliesTo = "t_poms_info", comment = "心境状态量表测试信息表")
+public class POMSEntity extends BaseEntity {
+
+    /**
+     * 编号
+     */
+    @Column(name = "no", columnDefinition = "int(10) comment '编号'")
+    private int no;
+
+    /**
+     * 内容
+     */
+    @Column(name = "content", columnDefinition = "text comment '内容'")
+    private String content;
+
+    /**
+     * 选项
+     */
+    @Column(name = "check_items", columnDefinition = "text comment '选项'")
+    private String checkItems;
+
+    /**
+     * 默认选项
+     */
+    @Column(name = "checked", columnDefinition = "text comment '默认选项'")
+    private String checked;
+
+    @Column(name = "type", columnDefinition = "varchar(2) comment '类型:1紧张;2愤怒;3疲劳;4:抑郁;5精力;6慌乱;7自我情绪相关'")
+    private String type;
+}

+ 50 - 0
src/main/java/com/rf/psychological/dao/model/PSQIEntity.java

@@ -0,0 +1,50 @@
+package com.rf.psychological.dao.model;
+
+import com.rf.psychological.base.model.BaseEntity;
+import lombok.*;
+
+import javax.persistence.Column;
+import javax.persistence.Entity;
+import javax.persistence.Table;
+
+/**
+ * @author zzf
+ * @description:匹茨堡睡眠质量指数
+ * @date 2021/1/19 16:31
+ */
+@Entity
+@Data
+@Getter
+@Setter
+@NoArgsConstructor
+@AllArgsConstructor
+@Table(name = "t_qsti_info")
+@org.hibernate.annotations.Table(appliesTo = "t_qsti_info", comment = "匹兹堡睡眠质量指数测试信息表")
+public class PSQIEntity extends BaseEntity {
+
+
+    /**
+     * 编号
+     */
+    @Column(name = "no", columnDefinition = "varchar(10) comment '编号'")
+    private String no;
+
+    /**
+     * 内容
+     */
+    @Column(name = "content", columnDefinition = "text comment '内容'")
+    private String content;
+
+    /**
+     * 选项
+     */
+    @Column(name = "check_items", columnDefinition = "text comment '选项'")
+    private String checkItems;
+
+    /**
+     * 默认选项
+     */
+    @Column(name = "checked", columnDefinition = "text comment '默认选项'")
+    private String checked;
+
+}

+ 38 - 0
src/main/java/com/rf/psychological/dao/model/RDTEntity.java

@@ -0,0 +1,38 @@
+package com.rf.psychological.dao.model;
+
+import lombok.AllArgsConstructor;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+
+/**
+ * @author zsy
+ * @description:风险决策测试实体类
+ * @date 2021/2/1 15:12
+ */
+
+@NoArgsConstructor
+@AllArgsConstructor
+@Data
+public class RDTEntity {
+
+    /**
+     * 序号
+     */
+    private int index;
+
+    /**
+     * 本轮得分
+     */
+    private double currentEarn;
+
+    /**
+     * 点击次数
+     */
+    private int numberPumps;
+
+    /**
+     * 是否爆炸
+     */
+    private Boolean explosion;
+
+}

+ 19 - 0
src/main/java/com/rf/psychological/dao/model/ReturnEntity.java

@@ -0,0 +1,19 @@
+package com.rf.psychological.dao.model;
+
+import lombok.Data;
+import lombok.NoArgsConstructor;
+
+@NoArgsConstructor
+@Data
+public class ReturnEntity {
+
+    private String flag;
+
+    private int amount;
+
+    public ReturnEntity(String flag, int amount) {
+        this.flag = flag;
+        this.amount = amount;
+    }
+
+}

+ 44 - 0
src/main/java/com/rf/psychological/dao/model/RhythmEntity.java

@@ -0,0 +1,44 @@
+package com.rf.psychological.dao.model;
+
+import lombok.AllArgsConstructor;
+import lombok.Getter;
+import lombok.NoArgsConstructor;
+import lombok.Setter;
+
+/**
+ * @author zsy
+ * @description:节奏测试
+ * @date 2021/1/30 11:55
+ */
+@Getter
+@Setter
+@NoArgsConstructor
+@AllArgsConstructor
+public class RhythmEntity {
+
+    /**
+     * 诊断模式:跟随节奏、间断节奏、模仿节奏
+     */
+    private String type;
+    /**
+     * 子类型:声情并茂、有形无声、有声无形
+     */
+    private String subType;
+    /**
+     * 节拍间隔(ms)
+     */
+    private String interval;
+    /**
+     * 持续时间(s)
+     */
+    private String duration;
+    /**
+     * 测试得分
+     */
+    private String score;
+    /**
+     * 题号
+     */
+    private String questionNo;
+
+}

+ 38 - 0
src/main/java/com/rf/psychological/dao/model/SCEntity.java

@@ -0,0 +1,38 @@
+package com.rf.psychological.dao.model;
+
+import lombok.AllArgsConstructor;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+
+/**
+ * @author zsy
+ * @description:速度感知测试实体类
+ * @date 2021/2/1 15:12
+ */
+
+@NoArgsConstructor
+@AllArgsConstructor
+@Data
+public class SCEntity {
+
+    /**
+     * 序号
+     */
+    private String imgIndex;
+
+    /**
+     * 小球运动速度
+     */
+    private int speed;
+
+    /**
+     * 方块长度
+     */
+    private int length;
+
+    /**
+     * 误差
+     */
+    private String error;
+
+}

+ 41 - 0
src/main/java/com/rf/psychological/dao/model/SCLEntity.java

@@ -0,0 +1,41 @@
+package com.rf.psychological.dao.model;
+
+import com.rf.psychological.base.model.BaseEntity;
+import lombok.*;
+
+import javax.persistence.Column;
+import javax.persistence.Entity;
+import javax.persistence.Table;
+
+/**
+ * @author zzf
+ * @description:测试类型症状自评量表SCL-90
+ * @date 2021/1/20 16:51
+ */
+@Entity
+@Data
+@Getter
+@Setter
+@NoArgsConstructor
+@AllArgsConstructor
+@Table(name = "t_scl_info")
+@org.hibernate.annotations.Table(appliesTo = "t_scl_info", comment = "测试类型症状自评量表SCL-90测试信息表")
+public class SCLEntity extends BaseEntity {
+    /**
+     * 编号
+     */
+    @Column(name = "no", columnDefinition = "int(10) comment '编号'")
+    private int no;
+
+    /**
+     * 内容
+     */
+    @Column(name = "content", columnDefinition = "text comment '内容'")
+    private String content;
+
+    @Column(name = "type", columnDefinition = "varchar(2) comment '分量编号 0躯体化 1强迫症状 2人际关系敏感 3抑郁 4焦虑 5敌对 6恐怖 7偏执 8精神病性 9 其他'")
+    private String type;
+
+    @Column(name = "checked", columnDefinition = "varchar(50) comment '选择项'")
+    private String checked;
+}

+ 39 - 0
src/main/java/com/rf/psychological/dao/model/SHAPE2Entity.java

@@ -0,0 +1,39 @@
+package com.rf.psychological.dao.model;
+
+import lombok.AllArgsConstructor;
+import lombok.Getter;
+import lombok.NoArgsConstructor;
+import lombok.Setter;
+
+/**
+ * @author zzf
+ * @description:形状知觉测试2
+ * @date 2021/1/19 16:31
+ */
+@Getter
+@Setter
+@NoArgsConstructor
+@AllArgsConstructor
+public class SHAPE2Entity {
+
+    /**
+     * 序号
+     */
+    private int index;
+
+    /**
+     * 正确性
+     */
+    private String rightOrWrong;
+
+    /**
+     * 反应时长
+     */
+    private int responseTime;
+
+    /**
+     * 难度指数
+     */
+    private String diff;
+
+}

+ 48 - 0
src/main/java/com/rf/psychological/dao/model/STFSEntity.java

@@ -0,0 +1,48 @@
+package com.rf.psychological.dao.model;
+
+import lombok.AllArgsConstructor;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+
+/**
+ * @author zsy
+ * @description:神分裂症语义距离度量
+ * @date 2021/2/1 15:12
+ */
+
+@NoArgsConstructor
+@AllArgsConstructor
+@Data
+public class STFSEntity {
+
+    /**
+     *  序号
+     */
+    private String id;
+
+    /**
+     * 左边显示词汇
+     */
+    private String leftWord;
+
+    /**
+     * 右侧比对词汇
+     */
+    private String rightWord;
+
+    /**
+     *  词汇类型,0-具体,1-抽象
+     */
+    private String type;
+
+    /**
+     * 词汇关系,0-相关,1-不相关
+     */
+    private String relation;
+
+    /**
+     * 用户输入等级
+     */
+    private String rank;
+
+}

+ 44 - 0
src/main/java/com/rf/psychological/dao/model/STROOPTASKEntity.java

@@ -0,0 +1,44 @@
+package com.rf.psychological.dao.model;
+
+import lombok.AllArgsConstructor;
+import lombok.Getter;
+import lombok.NoArgsConstructor;
+import lombok.Setter;
+
+/**
+ * @author zzf
+ * @description:Stroop任务
+ * @date 2021/1/19 16:31
+ */
+@Getter
+@Setter
+@NoArgsConstructor
+@AllArgsConstructor
+public class STROOPTASKEntity {
+
+    /**
+     * 序号
+     */
+    private int index;
+
+    /**
+     * 正确性
+     */
+    private String rightOrWrong;
+
+    /**
+     * 用户反馈的方向,L-左/R右
+     */
+    private String clickLorR;
+
+    /**
+     * 反应时长
+     */
+    private int responseTime;
+
+    /**
+     * 1为同色同义,2为不同义但互补色,3不同义不为互补色
+     */
+    private String diff;
+
+}

+ 24 - 0
src/main/java/com/rf/psychological/dao/model/STTEntity.java

@@ -0,0 +1,24 @@
+package com.rf.psychological.dao.model;
+
+import lombok.AllArgsConstructor;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+
+/**
+ * @author lpf
+ * @description:
+ * @date 2022/3/21 14:04
+ */
+@Data
+@AllArgsConstructor
+@NoArgsConstructor
+public class STTEntity {
+
+    //练习测试时间
+    private String exerciseTime;
+    //正式测试时间
+    private String realTime;
+    //总时间
+    private String totalTime;
+
+}

+ 56 - 0
src/main/java/com/rf/psychological/dao/model/StatusEntity.java

@@ -0,0 +1,56 @@
+package com.rf.psychological.dao.model;
+
+import com.rf.psychological.base.model.BaseEntity;
+import lombok.*;
+
+import javax.persistence.Column;
+import javax.persistence.Entity;
+import javax.persistence.Table;
+
+/**
+ * @author zzf
+ * @description:状态-特质焦虑量表
+ * @date 2021/1/20 18:47
+ */
+@Entity
+@Data
+@Getter
+@Setter
+@NoArgsConstructor
+@AllArgsConstructor
+@Table(name = "t_status_info")
+@org.hibernate.annotations.Table(appliesTo = "t_status_info", comment = "状态-特质焦虑量表")
+public class StatusEntity extends BaseEntity {
+
+    /**
+     * 编号
+     */
+    @Column(name = "no", columnDefinition = "int(10) comment '编号'")
+    private int no;
+
+    /**
+     * 内容
+     */
+    @Column(name = "content", columnDefinition = "text comment '内容'")
+    private String content;
+
+    /**
+     * 选项
+     */
+    @Column(name = "check_items", columnDefinition = "text comment '选项'")
+    private String checkItems;
+
+    /**
+     * 默认选项
+     */
+    @Column(name = "checked", columnDefinition = "text comment '默认选项'")
+    private String checked;
+
+    /**
+     * 类型:0反向得分  1正向得分
+     */
+    @Column(name = "type", columnDefinition = "varchar(2) comment '类型:0反向得分  1正向得分'")
+    private String type;
+
+
+}

+ 35 - 0
src/main/java/com/rf/psychological/dao/model/StroopEntity.java

@@ -0,0 +1,35 @@
+package com.rf.psychological.dao.model;
+
+import lombok.AllArgsConstructor;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+
+/**
+ * @author zzf
+ * @description:Stroop试验实体类
+ * @date 2021/2/1 15:12
+ */
+
+@NoArgsConstructor
+@AllArgsConstructor
+@Data
+public class StroopEntity {
+
+    /**
+     * 实验名称
+     */
+    private String name;
+
+    /**
+     * 完成时间(秒)
+     */
+
+    private String finishTime;
+
+    /**
+     * 错误数目
+     */
+    private String errorNumber;
+
+
+}

+ 50 - 0
src/main/java/com/rf/psychological/dao/model/SupportEntity.java

@@ -0,0 +1,50 @@
+package com.rf.psychological.dao.model;
+
+import com.rf.psychological.base.model.BaseEntity;
+import lombok.*;
+
+import javax.persistence.Column;
+import javax.persistence.Entity;
+import javax.persistence.Table;
+
+/**
+ * @author zzf
+ * @description:社会支持评定量表
+ * @date 2021/1/20 17:55
+ */
+@Entity
+@Data
+@Getter
+@Setter
+@NoArgsConstructor
+@AllArgsConstructor
+@Table(name = "t_support_info")
+@org.hibernate.annotations.Table(appliesTo = "t_support_info", comment = "社会支持评定量表")
+public class SupportEntity extends BaseEntity {
+    /**
+     * 编号
+     */
+    @Column(name = "no", columnDefinition = "varchar(10) comment '编号'")
+    private String no;
+
+    /**
+     * 内容
+     */
+    @Column(name = "content", columnDefinition = "text comment '内容'")
+    private String content;
+
+    /**
+     * 选项
+     */
+    @Column(name = "check_items", columnDefinition = "text comment '选项'")
+    private String checkItems;
+
+    /**
+     * 默认选项
+     */
+    @Column(name = "checked", columnDefinition = "text comment '默认选项'")
+    private String checked;
+
+    @Column(name = "sort_by", columnDefinition = "int(10) comment '排序字段'")
+    private int sortBy;
+}

+ 35 - 0
src/main/java/com/rf/psychological/dao/model/TypeEntity.java

@@ -0,0 +1,35 @@
+package com.rf.psychological.dao.model;
+
+import com.rf.psychological.base.model.BaseEntity;
+import lombok.*;
+
+import javax.persistence.Column;
+import javax.persistence.Entity;
+import javax.persistence.Table;
+
+/**
+ * @author zzf
+ * @description:测试分类表
+ * @date 2021/6/7 9:55
+ */
+@EqualsAndHashCode(callSuper = true)
+@Entity
+@Data
+@Getter
+@Setter
+@NoArgsConstructor
+@AllArgsConstructor
+@Table(name = "t_type_info")
+@org.hibernate.annotations.Table(appliesTo = "t_type_info", comment = "测试分类表")
+public class TypeEntity extends BaseEntity {
+
+    @Column(name = "type_no", columnDefinition = "varchar(10) comment '类型编号'")
+    private String typeNo;
+
+    @Column(name = "type_name", columnDefinition = "varchar(10) comment '类型名称'")
+    private String typeName;
+
+    @Column(name = "image_url", columnDefinition = "varchar(255) comment '图片'")
+    private String imageUrl;
+
+}

+ 45 - 0
src/main/java/com/rf/psychological/dao/model/WebMemoryEntity.java

@@ -0,0 +1,45 @@
+package com.rf.psychological.dao.model;
+
+import lombok.AllArgsConstructor;
+import lombok.Getter;
+import lombok.NoArgsConstructor;
+import lombok.Setter;
+
+/**
+ * @author zzf
+ * @description:工作记忆能力测试实体对象
+ * @date 2021/3/4 16:54
+ */
+@Getter
+@Setter
+@NoArgsConstructor
+@AllArgsConstructor
+public class WebMemoryEntity {
+
+    /**
+     * 是否需要点击控制
+     */
+    private String ifNeedClick;
+
+    /**
+     * 用户是否点击
+     */
+    private String ifUserClick;
+
+    /**
+     * 字母
+     */
+    private String letter;
+
+    /**
+     * 响应时间
+     */
+    private int userResponseTime;
+
+
+    /**
+     * 难度等级
+     */
+    private String diffLevel;
+
+}

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