shenhao 5 лет назад
Родитель
Сommit
6dd03b2c35
99 измененных файлов с 7171 добавлено и 6225 удалено
  1. 26 0
      .gitignore
  2. 287 134
      pom.xml
  3. 107 0
      src/main/java/com/aijia/core/base/ResponseEntity.java
  4. 31 0
      src/main/java/com/aijia/core/filter/CorsFilter.java
  5. 31 0
      src/main/java/com/aijia/core/filter/CorsFilterConfig.java
  6. 94 0
      src/main/java/com/aijia/core/security/section/SecurityAspect.java
  7. 45 0
      src/main/java/com/aijia/kmt/dto/KnowHowDTO.java
  8. 31 0
      src/main/java/com/aijia/kmt/dto/KnowHowDetailDTO.java
  9. 142 0
      src/main/java/com/aijia/kmt/dto/WrongBookKnowledgeDTO2.java
  10. 80 0
      src/main/java/com/aijia/kmt/dto/WrongBookQuestionDTO.java
  11. 38 0
      src/main/java/com/aijia/kmt/vo/AuditingBigQuestionRequest.java
  12. 32 0
      src/main/java/com/aijia/kmt/vo/AuditingRequest.java
  13. 61 0
      src/main/java/com/aijia/kmt/vo/AuditingV1Request.java
  14. 93 0
      src/main/java/com/aijia/kmt/vo/ExerciseBookIdDealTypeRequest.java
  15. 97 0
      src/main/java/com/aijia/kmt/vo/ExerciseConditionRequest.java
  16. 208 0
      src/main/java/com/aijia/kmt/vo/ExerciseQuestionsRequest.java
  17. 30 0
      src/main/java/com/aijia/kmt/vo/HowDetailPointsRequest.java
  18. 221 0
      src/main/java/com/aijia/kmt/vo/KmtHandlingQuestionRequest.java
  19. 123 0
      src/main/java/com/aijia/kmt/vo/KnowHowDetailsDTO.java
  20. 75 0
      src/main/java/com/aijia/kmt/vo/KnowledgeRequest.java
  21. 27 0
      src/main/java/com/aijia/kmt/vo/ParentIdListRequest.java
  22. 69 0
      src/main/java/com/aijia/kmt/vo/QuestionNumMarkRemoveVo.java
  23. 239 0
      src/main/java/com/aijia/kmt/vo/QuestionUpdateRequest.java
  24. 36 0
      src/main/java/com/aijia/kmt/vo/TestPointDTO.java
  25. 77 0
      src/main/java/com/aijia/kmt/vo/TestPointRequest.java
  26. 0 15
      src/main/java/com/aijia/peixun/PeixunApplication.java
  27. 0 47
      src/main/java/com/aijia/peixun/config/AjaxPermissionsAuthorizationFilter.java
  28. 0 38
      src/main/java/com/aijia/peixun/config/GlobalCorsConfig.java
  29. 0 65
      src/main/java/com/aijia/peixun/config/RedisConfig.java
  30. 0 122
      src/main/java/com/aijia/peixun/config/ShiroConfiguration.java
  31. 0 87
      src/main/java/com/aijia/peixun/config/UserRealm.java
  32. 0 134
      src/main/java/com/aijia/peixun/controller/FileUploadController.java
  33. 0 218
      src/main/java/com/aijia/peixun/controller/JzPeiXunController.java
  34. 0 37
      src/main/java/com/aijia/peixun/dao/FileMapper.java
  35. 0 43
      src/main/java/com/aijia/peixun/dao/UserMapper.java
  36. 0 34
      src/main/java/com/aijia/peixun/dao/examinationMapper.java
  37. 0 131
      src/main/java/com/aijia/peixun/entity/File.java
  38. 0 221
      src/main/java/com/aijia/peixun/entity/User.java
  39. 0 178
      src/main/java/com/aijia/peixun/entity/examination.java
  40. 0 25
      src/main/java/com/aijia/peixun/service/JzFileService.java
  41. 0 70
      src/main/java/com/aijia/peixun/service/JzFileServiceImpl.java
  42. 0 27
      src/main/java/com/aijia/peixun/service/JzPeiXunService.java
  43. 0 147
      src/main/java/com/aijia/peixun/service/JzPeiXunServiceImpl.java
  44. 0 163
      src/main/java/com/aijia/peixun/utils/AliyunSmsUtil.java
  45. 0 383
      src/main/java/com/aijia/peixun/utils/Constant.java
  46. 0 19
      src/main/java/com/aijia/peixun/utils/Constants.java
  47. 0 44
      src/main/java/com/aijia/peixun/utils/EmptyUtil.java
  48. 0 41
      src/main/java/com/aijia/peixun/utils/ErrorEnum.java
  49. 0 86
      src/main/java/com/aijia/peixun/utils/FileMD5Util.java
  50. 0 66
      src/main/java/com/aijia/peixun/utils/PhoneFormatCheckUtils.java
  51. 0 2124
      src/main/java/com/aijia/peixun/utils/RedisUtil.java
  52. 0 88
      src/main/java/com/aijia/peixun/utils/ResponseConstant.java
  53. 0 152
      src/main/java/com/aijia/peixun/utils/ResponseEntity.java
  54. 0 53
      src/main/java/com/aijia/peixun/utils/SmsUtils.java
  55. 0 50
      src/main/java/com/aijia/peixun/utils/StringUtil.java
  56. 0 47
      src/main/java/com/aijia/peixun/utils/Uuid.java
  57. 0 120
      src/main/java/com/aijia/peixun/utils/ZipFileUtil.java
  58. 0 90
      src/main/java/com/aijia/peixun/utils/httpClient.java
  59. 0 40
      src/main/java/com/aijia/peixun/utils/httpClientGet.java
  60. 0 141
      src/main/java/com/aijia/peixun/vo/MultipartFileParam.java
  61. 0 89
      src/main/java/com/aijia/peixun/vo/UserVo.java
  62. 58 0
      src/main/java/com/aijia/train/bean/TrTrainExerciseRole.java
  63. 108 0
      src/main/java/com/aijia/train/bean/TrTrainFiles.java
  64. 150 0
      src/main/java/com/aijia/train/bean/TrTrainPartUser.java
  65. 310 0
      src/main/java/com/aijia/train/bean/TrTrainUserExercise.java
  66. 96 0
      src/main/java/com/aijia/train/bean/TrTrainUserInfo.java
  67. 123 0
      src/main/java/com/aijia/train/bean/TrTrainUserQuestionKnow.java
  68. 399 0
      src/main/java/com/aijia/train/controller/ApiTrainController.java
  69. 33 0
      src/main/java/com/aijia/train/mapper/TrainAllMapper.java
  70. 19 0
      src/main/java/com/aijia/train/mapper/TrainFileServiceMapper.java
  71. 19 0
      src/main/java/com/aijia/train/mapper/TrainUserExerciseMapper.java
  72. 20 0
      src/main/java/com/aijia/train/mapper/TrainUserInfoServiceMapper.java
  73. 15 0
      src/main/java/com/aijia/train/mapper/TrainUserQuestionKnowMapper.java
  74. 20 0
      src/main/java/com/aijia/train/mapper/TrainUserServiceMapper.java
  75. 99 0
      src/main/java/com/aijia/train/service/ITrainService.java
  76. 264 0
      src/main/java/com/aijia/train/service/impl/TrainServiceImpl.java
  77. 31 0
      src/main/java/com/aijia/train/vo/AuditVO.java
  78. 42 0
      src/main/java/com/aijia/train/vo/EditVO.java
  79. 53 0
      src/main/java/com/aijia/train/vo/FileIdVO.java
  80. 97 0
      src/main/java/com/aijia/train/vo/FileVO.java
  81. 32 0
      src/main/java/com/aijia/train/vo/OssfsTokenReq.java
  82. 42 0
      src/main/java/com/aijia/train/vo/TrainLoginVo.java
  83. 22 0
      src/main/java/com/aijia/train/vo/TypeVO.java
  84. 22 0
      src/main/java/com/aijia/train/vo/UserIdVO.java
  85. 468 0
      src/main/java/com/aijia/utils/AIServiceUtils.java
  86. 137 0
      src/main/java/com/aijia/utils/CodecUtil.java
  87. 1475 0
      src/main/java/com/aijia/utils/DateUtil.java
  88. 282 0
      src/main/java/com/aijia/utils/HttpUtils.java
  89. 22 0
      src/main/java/com/aijia/utils/MyX509TrustManager.java
  90. 57 0
      src/main/java/com/aijia/utils/PhoneFormatCheckUtils.java
  91. 172 0
      src/main/java/com/aijia/utils/RSAUtils.java
  92. 68 0
      src/main/java/com/aijia/utils/SHA1Util.java
  93. 34 0
      src/main/java/com/aijia/utils/SessionKey.java
  94. 46 0
      src/main/java/com/aijia/utils/StringUtil.java
  95. 0 27
      src/main/resources/application.yml
  96. 0 166
      src/main/resources/mapper/FileMapper.xml
  97. 0 260
      src/main/resources/mapper/UserMapper.xml
  98. 0 203
      src/main/resources/mapper/examinationMapper.xml
  99. 36 0
      src/main/resources/mybatis/mapper/TrainMapper.xml

+ 26 - 0
.gitignore

@@ -0,0 +1,26 @@
+# Created by .ignore support plugin (hsz.mobi)
+### Java template
+# Compiled class file
+*.class
+
+# Log file
+*.log
+
+# BlueJ files
+*.ctxt
+
+# Mobile Tools for Java (J2ME)
+.mtj.tmp/
+
+# Package Files #
+*.jar
+*.war
+*.nar
+*.ear
+*.zip
+*.tar.gz
+*.rar
+
+# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
+hs_err_pid*
+

+ 287 - 134
pom.xml

@@ -1,144 +1,297 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
-    <modelVersion>4.0.0</modelVersion>
-    <parent>
-        <groupId>org.springframework.boot</groupId>
-        <artifactId>spring-boot-starter-parent</artifactId>
-        <version>2.5.2</version>
-        <relativePath/> <!-- lookup parent from repository -->
-    </parent>
-    <groupId>com.aijia</groupId>
-    <artifactId>peixun</artifactId>
-    <version>0.0.1-SNAPSHOT</version>
-    <name>peixun</name>
-    <description>Demo project for Spring Boot</description>
-    <properties>
-        <java.version>1.8</java.version>
-    </properties>
-    <dependencies>
-        <dependency>
-            <groupId>org.springframework.boot</groupId>
-            <artifactId>spring-boot-starter-thymeleaf</artifactId>
-        </dependency>
-        <dependency>
-            <groupId>org.springframework.boot</groupId>
-            <artifactId>spring-boot-starter-web</artifactId>
-        </dependency>
-        <dependency>
-            <groupId>org.mybatis.spring.boot</groupId>
-            <artifactId>mybatis-spring-boot-starter</artifactId>
-            <version>2.2.0</version>
-        </dependency>
-        <dependency>
-            <groupId>mysql</groupId>
-            <artifactId>mysql-connector-java</artifactId>
-            <scope>runtime</scope>
-            <version>8.0.15</version>
-        </dependency>
-        <dependency>
-            <groupId>com.aliyun</groupId>
-            <artifactId>aliyun-java-sdk-core</artifactId>
-            <version>4.0.6</version>
-        </dependency>
-        <dependency>
-            <groupId>com.aliyun</groupId>
-            <artifactId>aliyun-java-sdk-dysmsapi</artifactId>
-            <version>1.1.0</version>
-        </dependency>
-        <dependency>
-            <groupId>com.alipay.sdk</groupId>
-            <artifactId>alipay-sdk-java</artifactId>
-            <version>3.6.0.ALL</version>
-        </dependency>
-        <dependency>
-            <groupId>org.apache.commons</groupId>
-            <artifactId>commons-lang3</artifactId>
-            <version>3.12.0</version>
-        </dependency>
-        <dependency>
-            <groupId>redis.clients</groupId>
-            <artifactId>jedis</artifactId>
-        </dependency>
-        <dependency>
-            <groupId>org.apache.shiro</groupId>
-            <artifactId>shiro-spring</artifactId>
-            <version>1.4.0</version>
-        </dependency>
-        <dependency>
-            <groupId>de.knightsoft-net</groupId>
-            <artifactId>gwt-time-dummy</artifactId>
-            <version>1.7.6</version>
-        </dependency>
-        <dependency>
-            <groupId>com.alibaba</groupId>
-            <artifactId>fastjson</artifactId>
-            <version>1.2.47</version>
-        </dependency>
-        <dependency>
-            <groupId>commons-io</groupId>
-            <artifactId>commons-io</artifactId>
-            <version>2.10.0</version>
-        </dependency>
-        <dependency>
-            <groupId>org.apache.httpcomponents</groupId>
-            <artifactId>httpclient</artifactId>
-            <version>4.5.2</version>
-        </dependency>
-        <dependency>
-            <groupId>com.sun.jersey.contribs</groupId>
-            <artifactId>jersey-multipart</artifactId>
-            <version>1.17</version>
-        </dependency>
-<!--        &lt;!&ndash;引入 aliyun oss sdk&ndash;&gt;-->
-<!--        <dependency>-->
-<!--            <groupId>com.aliyun.oss</groupId>-->
-<!--            <artifactId>aliyun-sdk-oss</artifactId>-->
-<!--            <version>3.10.2</version>-->
-<!--        </dependency>-->
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
 
-        <dependency>
-            <groupId>org.springframework.boot</groupId>
-            <artifactId>spring-boot-starter-data-redis</artifactId>
-        </dependency>
+  <groupId>com.aijia</groupId>
+  <artifactId>ssj-px</artifactId>
+  <version>0.0.1-SNAPSHOT</version>
+  <packaging>war</packaging>
+  <name>ssj-px</name>
+  <description>私塾家兼职培训平台</description>
+  <modelVersion>4.0.0</modelVersion>
+  <properties>
+    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
+    <elasticsearch.version>7.2.0</elasticsearch.version>
+    <java.version>1.8</java.version>
+  </properties>
+  <parent>
+    <groupId>org.springframework.boot</groupId>
+    <artifactId>spring-boot-starter-parent</artifactId>
+    <version>2.1.3.RELEASE</version>
+  </parent>
+  <dependencies>
+    <dependency>
+      <groupId>org.springframework.boot</groupId>
+      <artifactId>spring-boot-starter-web</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>com.baomidou</groupId>
+      <artifactId>mybatis-plus-boot-starter</artifactId>
+      <version>3.3.2</version>
+    </dependency>
+    <dependency>
+      <groupId>com.belerweb</groupId>
+      <artifactId>pinyin4j</artifactId>
+      <version>2.5.1</version>
+    </dependency>
+    <dependency>
+      <groupId>com.alibaba</groupId>
+      <artifactId>druid</artifactId>
+      <version>1.1.19</version>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.dubbo</groupId>
+      <artifactId>dubbo</artifactId>
+      <version>2.7.5</version>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.dubbo</groupId>
+      <artifactId>dubbo-spring-boot-starter</artifactId>
+      <version>2.7.5</version>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.dubbo</groupId>
+      <artifactId>dubbo-registry-nacos</artifactId>
+      <version>2.7.5</version>
+    </dependency>
+    <dependency>
+      <groupId>com.alibaba.nacos</groupId>
+      <artifactId>nacos-client</artifactId>
+      <version>1.1.4</version>
+    </dependency>
+    <dependency>
+      <groupId>org.elasticsearch.client</groupId>
+      <artifactId>elasticsearch-rest-high-level-client</artifactId>
+      <exclusions>
+        <exclusion>
+          <groupId>org.elasticsearch</groupId>
+          <artifactId>elasticsearch</artifactId>
+        </exclusion>
+        <exclusion>
+          <groupId>org.elasticsearch.client</groupId>
+          <artifactId>elasticsearch-rest-client</artifactId>
+        </exclusion>
+      </exclusions>
+    </dependency>
+    <dependency>
+      <groupId>org.elasticsearch.client</groupId>
+      <artifactId>elasticsearch-rest-client</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>org.elasticsearch</groupId>
+      <artifactId>elasticsearch</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>com.aliyun</groupId>
+      <artifactId>aliyun-java-sdk-dysmsapi</artifactId>
+      <version>1.1.0</version>
+      <scope>compile</scope>
+    </dependency>
+    <dependency>
+      <groupId>org.springframework.boot</groupId>
+      <artifactId>spring-boot-starter-aop</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>mysql</groupId>
+      <artifactId>mysql-connector-java</artifactId>
+    </dependency>
 
+    <dependency>
+      <groupId>org.springframework.boot</groupId>
+      <artifactId>spring-boot-starter-test</artifactId>
+    </dependency>
 
+    <dependency>
+      <groupId>io.springfox</groupId>
+      <artifactId>springfox-swagger2</artifactId>
+      <version>2.9.2</version>
+    </dependency>
 
+    <dependency>
+      <groupId>io.springfox</groupId>
+      <artifactId>springfox-swagger-ui</artifactId>
+      <version>2.9.2</version>
+    </dependency>
+    <dependency>
+      <groupId>org.springframework.boot</groupId>
+      <artifactId>spring-boot-starter-thymeleaf</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>com.itextpdf</groupId>
+      <artifactId>itextpdf</artifactId>
+      <version>5.5.13</version>
+    </dependency>
 
+    <dependency>
+      <groupId>cn.afterturn</groupId>
+      <artifactId>easypoi-base</artifactId>
+      <version>3.3.0</version>
+    </dependency>
+    <dependency>
+      <groupId>cn.afterturn</groupId>
+      <artifactId>easypoi-web</artifactId>
+      <version>3.3.0</version>
+    </dependency>
+    <dependency>
+      <groupId>cn.afterturn</groupId>
+      <artifactId>easypoi-annotation</artifactId>
+      <version>3.3.0</version>
+    </dependency>
 
+    <dependency>
+      <groupId>org.springframework.boot</groupId>
+      <artifactId>spring-boot-starter-data-redis</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>org.springframework.session</groupId>
+      <artifactId>spring-session-data-redis</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>redis.clients</groupId>
+      <artifactId>jedis</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>org.elasticsearch</groupId>
+      <artifactId>elasticsearch</artifactId>
+      <version>7.2.0</version>
+    </dependency>
+    <dependency>
+      <groupId>org.elasticsearch.client</groupId>
+      <artifactId>elasticsearch-rest-client</artifactId>
+      <version>7.2.0</version>
+    </dependency>
+    <dependency>
+      <groupId>org.elasticsearch.client</groupId>
+      <artifactId>elasticsearch-rest-high-level-client</artifactId>
+      <version>7.2.0</version>
+    </dependency>
+    <dependency>
+      <groupId>org.springframework.boot</groupId>
+      <artifactId>spring-boot-starter-data-jpa</artifactId>
+      <version>RELEASE</version>
+      <scope>compile</scope>
+    </dependency>
+    <dependency>
+      <groupId>javax.validation</groupId>
+      <artifactId>validation-api</artifactId>
+      <version>2.0.1.Final</version>
+    </dependency>
+    <dependency>
+      <groupId>redis.clients</groupId>
+      <artifactId>jedis</artifactId>
+      <version>3.6.1</version>
+    </dependency>
+    <dependency>
+      <groupId>org.projectlombok</groupId>
+      <artifactId>lombok</artifactId>
+      <version>1.18.16</version>
+    </dependency>
+    <dependency>
+      <groupId>com.aliyun</groupId>
+      <artifactId>aliyun-java-sdk-core</artifactId>
+      <version>4.0.6</version>
+    </dependency>
+    <dependency>
+      <groupId>org.springframework</groupId>
+      <artifactId>spring-web</artifactId>
+      <version>5.3.8</version>
+    </dependency>
+    <dependency>
+      <groupId>javax.servlet</groupId>
+      <artifactId>javax.servlet-api</artifactId>
+      <version>4.0.1</version>
+    </dependency>
+    <dependency>
+      <groupId>org.hibernate.validator</groupId>
+      <artifactId>hibernate-validator</artifactId>
+      <version>6.2.0.Final</version>
+    </dependency>
+    <dependency>
+      <groupId>com.aliyun.oss</groupId>
+      <artifactId>aliyun-sdk-oss</artifactId>
+      <version>3.8.1</version>
+    </dependency>
+    <dependency>
+      <groupId>org.springframework.session</groupId>
+      <artifactId>spring-session</artifactId>
+      <version>1.3.4.RELEASE</version>
+    </dependency>
+      <dependency>
+          <groupId>org.springframework</groupId>
+          <artifactId>spring-web</artifactId>
+      </dependency>
 
+      <!-- https://mvnrepository.com/artifact/org.apache.tomcat.embed/tomcat-embed-core -->
+      <dependency>
+          <groupId>org.apache.tomcat.embed</groupId>
+          <artifactId>tomcat-embed-core</artifactId>
+      </dependency>
+  </dependencies>
 
-        <dependency>
-            <groupId>org.springframework.boot</groupId>
-            <artifactId>spring-boot-starter-test</artifactId>
-            <scope>test</scope>
-        </dependency>
-    </dependencies>
+  <!-- Package as an executable jar -->
+  <build>
+    <!-- 产生的构件的文件名,默认值是${artifactId}-${version}。 -->
+    <finalName>${project.artifactId}</finalName>
+    <resources>
+      <resource>
+        <directory>src/main/resources/</directory>
+        <filtering>true</filtering>
+        <includes>
+          <include>**/*.properties</include>
+        </includes>
+      </resource>
+      <resource>
+        <directory>src/main/resources</directory>
+        <includes>
+          <include>**.*</include>
+          <include>**/*.*</include><!-- i18n能读取到 -->
+          <include>**/*/*.*</include>
+        </includes>
+      </resource>
+    </resources>
 
-    <build>
-        <plugins>
-            <plugin>
-                <groupId>org.springframework.boot</groupId>
-                <artifactId>spring-boot-maven-plugin</artifactId>
-            </plugin>
-            <plugin>
-                <groupId>org.mybatis.generator</groupId>
-                <artifactId>mybatis-generator-maven-plugin</artifactId>
-                <version>1.4.0</version>
-                <configuration>
-                    <verbose>true</verbose>
-                    <overwrite>true</overwrite>
-                    <configurationFile>src/main/resources/generatorConfig.xml</configurationFile>
-                </configuration>
-                <dependencies>
-                    <dependency>
-                        <groupId>mysql</groupId>
-                        <artifactId>mysql-connector-java</artifactId>
-                        <version>8.0.15</version>
-                    </dependency>
-                </dependencies>
-            </plugin>
-        </plugins>
-    </build>
 
-</project>
+    <plugins>
+
+      <plugin>
+        <artifactId>maven-resources-plugin</artifactId>
+        <configuration>
+          <encoding>utf-8</encoding>
+          <useDefaultDelimiters>true</useDefaultDelimiters>
+        </configuration>
+      </plugin>
+      <plugin>
+        <artifactId>maven-compiler-plugin</artifactId>
+        <configuration>
+          <source>1.8</source>
+          <target>1.8</target>
+        </configuration>
+      </plugin>
+    </plugins>
+
+  </build>
+
+  <profiles>
+    <profile>
+      <id>local</id>
+      <properties>
+        <!-- 环境标识,需要与配置文件的名称相对应 -->
+        <activatedProperties>local</activatedProperties>
+      </properties>
+      <activation>
+        <!-- 默认环境 -->
+        <activeByDefault>true</activeByDefault>
+      </activation>
+    </profile>
+    <profile>
+      <id>dev</id>
+      <properties>
+        <activatedProperties>dev</activatedProperties>
+      </properties>
+    </profile>
+    <profile>
+      <id>prod</id>
+      <properties>
+        <activatedProperties>prod</activatedProperties>
+      </properties>
+    </profile>
+  </profiles>
+</project>

+ 107 - 0
src/main/java/com/aijia/core/base/ResponseEntity.java

@@ -0,0 +1,107 @@
+package com.aijia.core.base;
+
+import com.aijia.core.web.ResponseConstant;
+
+import java.io.Serializable;
+
+/**
+ *
+ * 类名称:Response<br>
+ * 类描述:Response 类<br>
+ * @version v1.0
+ *
+ */
+public class ResponseEntity implements Serializable{
+
+	private static final long serialVersionUID = 8731218855844435111L;
+
+	private static final String ERROR = "error";
+    private static final String SUCCESS = "success";
+
+    private String status;
+    private String code;
+    private String msg;
+    private Object data;
+
+    public String getStatus() {
+        return status;
+    }
+
+    public void setStatus(String status) {
+        this.status = status;
+    }
+
+    public String getCode() {
+        return code;
+    }
+
+    public void setCode(String code) {
+        this.code = code;
+    }
+
+    public String getMsg() {
+        return msg;
+    }
+
+    public void setMsg(String msg) {
+        this.msg = msg;
+    }
+
+    public Object getData() {
+        return data;
+    }
+
+    public void setData(Object data) {
+        this.data = data;
+    }
+
+    private static ResponseEntity getInstance(String status, String code, String msg, Object data) {
+        ResponseEntity responseEntity = new ResponseEntity();
+        responseEntity.setStatus(status);
+        responseEntity.setCode(code);
+        responseEntity.setMsg(msg);
+        responseEntity.setData(data);
+        return responseEntity;
+    }
+
+    public static ResponseEntity success() {
+        return ResponseEntity.getInstance(SUCCESS, ResponseConstant.CODE_999, "成功", null);
+    }
+
+    public static ResponseEntity success(String msg) {
+        return ResponseEntity.getInstance(SUCCESS, ResponseConstant.CODE_999, msg, null);
+    }
+
+    public static ResponseEntity success(Object data) {
+        return ResponseEntity.getInstance(SUCCESS, ResponseConstant.CODE_999, "成功", data);
+    }
+
+    public static ResponseEntity success(String code, String msg) {
+        return ResponseEntity.getInstance(SUCCESS, code, msg, null);
+    }
+
+    public static ResponseEntity success(String msg, Object data) {
+        return ResponseEntity.getInstance(SUCCESS, ResponseConstant.CODE_999, msg, data);
+    }
+
+    public static ResponseEntity failure() {
+        return ResponseEntity.getInstance(ERROR, ResponseConstant.CODE_000, "暂未加载到数据,请稍后再试", null);
+    }
+
+    public static ResponseEntity failure(String msg) {
+        return ResponseEntity.getInstance(ERROR, ResponseConstant.CODE_000, msg, null);
+    }
+
+    public static ResponseEntity failure(String code, String msg) {
+        return ResponseEntity.getInstance(ERROR, code, msg, null);
+    }
+
+    public static ResponseEntity failure(Object data, String msg) {
+        return ResponseEntity.getInstance(ERROR, ResponseConstant.CODE_000, msg, data);
+    }
+
+    public static ResponseEntity failure(String code, String msg, Object data) {
+        return ResponseEntity.getInstance(ERROR, code, msg, data);
+    }
+
+}

+ 31 - 0
src/main/java/com/aijia/core/filter/CorsFilter.java

@@ -0,0 +1,31 @@
+package com.aijia.core.filter;
+
+import org.springframework.stereotype.Component;
+
+import javax.servlet.*;
+import javax.servlet.annotation.WebFilter;
+import javax.servlet.http.HttpServletResponse;
+import java.io.IOException;
+
+
+public class CorsFilter implements Filter {
+
+    @Override
+    public void init(FilterConfig filterConfig) throws ServletException {
+    }
+
+    @Override
+    public void doFilter(ServletRequest servletRequest, ServletResponse servletResponse, FilterChain filterChain) throws IOException, ServletException {
+        System.out.println("我来了");
+        HttpServletResponse httpResponse = (HttpServletResponse)servletResponse;
+        httpResponse.setHeader("Access-Control-Allow-Headers","DNT,X-Mx-ReqToken,Keep-Alive,User-Agent,X-Requested-With,x_requested_with,If-Modified-Since,Cache-Control,Content-Type,Authorization");
+        httpResponse.setHeader("Access-Control-Allow-Credentials", "true");
+        httpResponse.setHeader("Access-Control-Allow-Methods", "GET, POST, OPTIONS");
+        httpResponse.addHeader("Access-Control-Allow-Origin", "*");
+        filterChain.doFilter(servletRequest, httpResponse);
+    }
+
+    @Override
+    public void destroy() {
+    }
+}

+ 31 - 0
src/main/java/com/aijia/core/filter/CorsFilterConfig.java

@@ -0,0 +1,31 @@
+package com.aijia.core.filter;
+
+import org.springframework.boot.web.servlet.FilterRegistrationBean;
+import org.springframework.context.annotation.Bean;
+
+import javax.servlet.Filter;
+
+/**
+ * @author sh
+ * @className CorsFilterConfig
+ * @description TODO
+ * @date 2021/8/1
+ */
+public class CorsFilterConfig {
+    @Bean
+public FilterRegistrationBean webAuthFilterRegistration() {
+    FilterRegistrationBean registration = new FilterRegistrationBean();
+    registration.setFilter(CorsFilter());
+    registration.setName("CorsFilter");
+    registration.addUrlPatterns("/*");
+//    registration.addInitParameter("excludeUrls", "/web/login");
+    registration.setOrder(0);
+    return registration;
+}
+
+    @Bean
+    public Filter CorsFilter() {
+        return new CorsFilter();
+    }
+
+}

+ 94 - 0
src/main/java/com/aijia/core/security/section/SecurityAspect.java

@@ -0,0 +1,94 @@
+package com.aijia.core.security.section;
+
+
+import com.aijia.core.web.exception.RequestsException;
+import com.aijia.core.web.exception.TokenException;
+import com.aijia.kmt.annotation.IgnoreSecurity;
+import com.aijia.kmt.annotation.ModifySecurity;
+import com.aijia.kmt.service.TokenManager;
+import org.apache.commons.lang3.StringUtils;
+import org.aspectj.lang.ProceedingJoinPoint;
+import org.aspectj.lang.annotation.Around;
+import org.aspectj.lang.annotation.Aspect;
+import org.aspectj.lang.annotation.Pointcut;
+import org.aspectj.lang.reflect.MethodSignature;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Component;
+import org.springframework.web.context.request.RequestContextHolder;
+import org.springframework.web.context.request.ServletRequestAttributes;
+
+import javax.servlet.http.HttpServletRequest;
+import java.lang.reflect.Method;
+
+
+/**
+ * 
+ * 类名称:SecurityAspect<br>
+ * 类描述:用于检查 token 的切面<br>
+ * @version v1.0
+ *
+ */
+@Aspect
+@Component
+public class SecurityAspect {
+	private static final Logger logger = LoggerFactory.getLogger(SecurityAspect.class);
+	@Autowired
+	private TokenManager tokenManager;
+    @Pointcut("@annotation(org.springframework.web.bind.annotation.RequestMapping)")
+	public void methodPointcut(){}
+    /**
+	 * 拦截器具体实现
+	 * @param pjp
+	 * @return JsonResult(被拦截方法的执行结果,或需要登录的错误提示。)
+	 */
+	@Around("methodPointcut()") //指定拦截器规则;也可以直接把“execution(* com.xjj.........)”写进这里
+	public Object Interceptor(ProceedingJoinPoint pjp)throws Throwable{
+		MethodSignature signature = (MethodSignature) pjp.getSignature();
+		Method method = signature.getMethod(); //获取被拦截的方法
+		HttpServletRequest request = ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest();
+		if (method.isAnnotationPresent(IgnoreSecurity.class)  ) {
+			logger.info("直接过滤url:{}", request.getRequestURI());
+			return pjp.proceed();
+		}
+
+//		String methodName = method.getName(); //获取被拦截的方法名
+	//	logger.info("请求getRequestURI:{}",  request.getRequestURI());
+	//	logger.info("请求getContextPath:{}",  request.getContextPath());
+		String url = request.getRequestURI().replaceFirst(request.getContextPath(), "");
+		logger.info("请求url:{}", url);
+		if ( !StringUtils.startsWith(url, "/wxapi/") && !StringUtils.startsWith(url, "/api/")) {
+            return pjp.proceed();
+        }
+		String token = StringUtils.isBlank(request.getHeader("accessToken")) ? request.getParameter("accessToken") : request.getHeader("accessToken");
+
+	//	logger.info("请求方法:{}", methodName);
+		logger.info("请求token:{}", token);
+		// 检查 token 有效性
+		if (token == null || !tokenManager.checkToken(token)) {
+			String message = String.format("token [%s] is invalid", token);
+			//失效标识
+			String key = "invalid_reason_" + token;
+			String reason = tokenManager.getString(key);
+			//reason为“1”:被强制下线;reason为“2”:被超级管理员挤下线;reason为“3”:资料正在审核中,请重新登录;
+			if (StringUtils.isNotBlank(reason)) {
+				message += (",失效原因为:{" + reason + "}");
+				tokenManager.delString(key);
+			}
+			throw new TokenException(message);
+		}
+        if(method.isAnnotationPresent(ModifySecurity.class)){
+            String requestsNum = tokenManager.getString(token+url);
+            if(requestsNum!=null){
+                String message = String.format("请求太频繁 [%s] 请稍后", token+url);
+                throw new RequestsException(message);
+            }
+            tokenManager.setString(token+url, "1",2);
+        }
+        // 调用目标方法
+        Object obj = pjp.proceed();
+//        tokenManager.delString(token + url);
+        return obj;
+	}
+}

+ 45 - 0
src/main/java/com/aijia/kmt/dto/KnowHowDTO.java

@@ -0,0 +1,45 @@
+package com.aijia.kmt.dto;
+
+import java.io.Serializable;
+import java.util.ArrayList;
+import java.util.List;
+
+public class KnowHowDTO implements Serializable {
+
+    private static final long serialVersionUID = -7884707624892891677L;
+
+    private String id;
+    private String name;
+    private List<KnowHowDetailsDTO> details = new ArrayList<>();
+
+    public String getId() {
+        return id;
+    }
+
+    public void setId(String id) {
+        this.id = id;
+    }
+
+    public String getName() {
+        return name;
+    }
+
+    public void setName(String name) {
+        this.name = name;
+    }
+
+    public List<KnowHowDetailsDTO> getDetails() {
+        return details;
+    }
+
+    public void setDetails(List<KnowHowDetailsDTO> details) {
+        this.details = details;
+    }
+
+    public void addHowDetails(KnowHowDetailsDTO howDetailsDTO){
+        if (details == null) {
+            details = new ArrayList<>();
+        }
+        details.add(howDetailsDTO);
+    }
+}

+ 31 - 0
src/main/java/com/aijia/kmt/dto/KnowHowDetailDTO.java

@@ -0,0 +1,31 @@
+package com.aijia.kmt.dto;
+
+import java.io.Serializable;
+
+/**
+ * @author yrf
+ * @date 2019/5/5 16:50
+ */
+public class KnowHowDetailDTO implements Serializable {
+
+    private static final long serialVersionUID = 2067193457855485135L;
+
+    private String knowHowDetailId;
+    private String knowledgeVersion;
+
+    public String getKnowHowDetailId() {
+        return knowHowDetailId;
+    }
+
+    public void setKnowHowDetailId(String knowHowDetailId) {
+        this.knowHowDetailId = knowHowDetailId;
+    }
+
+    public String getKnowledgeVersion() {
+        return knowledgeVersion;
+    }
+
+    public void setKnowledgeVersion(String knowledgeVersion) {
+        this.knowledgeVersion = knowledgeVersion;
+    }
+}

+ 142 - 0
src/main/java/com/aijia/kmt/dto/WrongBookKnowledgeDTO2.java

@@ -0,0 +1,142 @@
+package com.aijia.kmt.dto;
+
+import com.alibaba.fastjson.annotation.JSONField;
+import lombok.Data;
+
+import java.io.Serializable;
+import java.util.List;
+
+/**
+ * @author yrf
+ * @date 2019/4/29 13:53
+ */
+@Data
+public class WrongBookKnowledgeDTO2 implements Serializable {
+
+    private static final long serialVersionUID = -2351152244857400763L;
+
+    private String howDetailSortIdStr;
+
+    private Integer errorNum;
+
+    @JSONField(serialize = false)
+    private String knowHowDetailIdStr;
+
+    @JSONField(serialize = false)
+    private String knowledgeVersionStr;
+
+    private List<KnowHowDetailDTO> knowHowDetailList;
+    private String knowledgeAlias;
+    private Integer wrongQuestionSum;
+
+    //    @JSONField(serialize = false)
+    private Integer wrongQuestionCount;
+
+    @JSONField(serialize = false)
+    private Integer totalQuestionCount;
+
+    private Integer errorRate;
+
+    @JSONField(serialize = false)
+    private String questionStatusStr;
+
+    private Integer questionStatus;
+
+    public String getHowDetailSortIdStr() {
+        return howDetailSortIdStr;
+    }
+
+    public void setHowDetailSortIdStr(String howDetailSortIdStr) {
+        this.howDetailSortIdStr = howDetailSortIdStr;
+    }
+
+    public String getKnowHowDetailIdStr() {
+        return knowHowDetailIdStr;
+    }
+
+    public void setKnowHowDetailIdStr(String knowHowDetailIdStr) {
+        this.knowHowDetailIdStr = knowHowDetailIdStr;
+    }
+
+    public List<KnowHowDetailDTO> getKnowHowDetailList() {
+        return knowHowDetailList;
+    }
+
+    public String getKnowledgeVersionStr() {
+        return knowledgeVersionStr;
+    }
+
+    public void setKnowledgeVersionStr(String knowledgeVersionStr) {
+        this.knowledgeVersionStr = knowledgeVersionStr;
+    }
+
+    public void setKnowHowDetailIdList(List<KnowHowDetailDTO> knowHowDetailList) {
+        this.knowHowDetailList = knowHowDetailList;
+    }
+
+    public String getKnowledgeAlias() {
+        return knowledgeAlias;
+    }
+
+    public void setKnowledgeAlias(String knowledgeAlias) {
+        this.knowledgeAlias = knowledgeAlias;
+    }
+
+    public Integer getWrongQuestionSum() {
+        return wrongQuestionSum;
+    }
+
+    public void setWrongQuestionSum(Integer wrongQuestionSum) {
+        this.wrongQuestionSum = wrongQuestionSum;
+    }
+    public Integer getWrongQuestionCount() {
+        return wrongQuestionCount;
+    }
+
+    public void setWrongQuestionCount(Integer wrongQuestionCount) {
+        this.wrongQuestionCount = wrongQuestionCount;
+    }
+
+    public Integer getTotalQuestionCount() {
+        return totalQuestionCount;
+    }
+
+    public void setTotalQuestionCount(Integer totalQuestionCount) {
+        this.totalQuestionCount = totalQuestionCount;
+    }
+
+    public Integer getErrorRate() {
+        if (wrongQuestionCount == null || totalQuestionCount == 0 || totalQuestionCount < 1) {
+            return errorRate = 0;
+        } else {
+            errorRate = wrongQuestionCount * 10000 / totalQuestionCount;
+            if (totalQuestionCount <= 3) {
+                errorRate = errorRate / 2;
+            } else if (totalQuestionCount <= 10) {
+                errorRate = errorRate * 4 / 5;
+            }
+        }
+
+        return errorRate;
+    }
+
+    public void setErrorRate(Integer errorRate) {
+        this.errorRate = errorRate;
+    }
+
+    public String getQuestionStatusStr() {
+        return questionStatusStr;
+    }
+
+    public void setQuestionStatusStr(String questionStatusStr) {
+        this.questionStatusStr = questionStatusStr;
+    }
+
+    public Integer getQuestionStatus() {
+        return questionStatus;
+    }
+
+    public void setQuestionStatus(Integer questionStatus) {
+        this.questionStatus = questionStatus;
+    }
+}

+ 80 - 0
src/main/java/com/aijia/kmt/dto/WrongBookQuestionDTO.java

@@ -0,0 +1,80 @@
+package com.aijia.kmt.dto;
+
+import com.alibaba.fastjson.annotation.JSONField;
+
+import java.io.Serializable;
+import java.util.Date;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * @author yrf
+ * @date 2019/4/29 14:33
+ */
+public class WrongBookQuestionDTO implements Serializable {
+
+    private static final long serialVersionUID = -3599171753918336231L;
+
+    private String homeworkId;
+
+    @JSONField(format = "yyyy.MM.dd")
+    private Date createTime;
+
+    private String week;
+
+    @JSONField(serialize = false)
+    private String homeworkPictureIdStr;
+
+    @JSONField(serialize = false)
+    private String pictureUrlStr;
+
+    private List<Map<String, Object>> pictureList;
+
+    public String getHomeworkId() {
+        return homeworkId;
+    }
+
+    public void setHomeworkId(String homeworkId) {
+        this.homeworkId = homeworkId;
+    }
+
+    public Date getCreateTime() {
+        return createTime;
+    }
+
+    public void setCreateTime(Date createTime) {
+        this.createTime = createTime;
+    }
+
+    public String getWeek() {
+        return week;
+    }
+
+    public void setWeek(String week) {
+        this.week = week;
+    }
+
+    public String getHomeworkPictureIdStr() {
+        return homeworkPictureIdStr;
+    }
+
+    public void setHomeworkPictureIdStr(String homeworkPictureIdStr) {
+        this.homeworkPictureIdStr = homeworkPictureIdStr;
+    }
+
+    public String getPictureUrlStr() {
+        return pictureUrlStr;
+    }
+
+    public void setPictureUrlStr(String pictureUrlStr) {
+        this.pictureUrlStr = pictureUrlStr;
+    }
+
+    public List<Map<String, Object>> getPictureList() {
+        return pictureList;
+    }
+
+    public void setPictureList(List<Map<String, Object>> pictureList) {
+        this.pictureList = pictureList;
+    }
+}

+ 38 - 0
src/main/java/com/aijia/kmt/vo/AuditingBigQuestionRequest.java

@@ -0,0 +1,38 @@
+package com.aijia.kmt.vo;
+
+import io.swagger.annotations.ApiModelProperty;
+
+import java.io.Serializable;
+import java.util.List;
+
+/**
+ * @Author: chchen
+ * @Description
+ * @Date Create in 11:40 2020/3/11
+ * @Modified By
+ */
+public class AuditingBigQuestionRequest implements Serializable {
+    private static final long serialVersionUID = 1L;
+
+    @ApiModelProperty(name = "questions", value = "题目ids", required = true)
+    private List<QuestionUpdateRequest> questions;
+
+    @ApiModelProperty(name = "parentId", value = "大题的id", required = false)
+    private String parentId;
+
+    public List<QuestionUpdateRequest> getQuestions() {
+        return questions;
+    }
+
+    public void setQuestions(List<QuestionUpdateRequest> questions) {
+        this.questions = questions;
+    }
+
+    public String getParentId() {
+        return parentId;
+    }
+
+    public void setParentId(String parentId) {
+        this.parentId = parentId;
+    }
+}

+ 32 - 0
src/main/java/com/aijia/kmt/vo/AuditingRequest.java

@@ -0,0 +1,32 @@
+package com.aijia.kmt.vo;
+
+import com.aijia.core.web.BaseRequest;
+import io.swagger.annotations.ApiModelProperty;
+
+import java.util.List;
+
+public class AuditingRequest extends BaseRequest {
+    private static final long serialVersionUID = 1L;
+
+    @ApiModelProperty(name = "type", value = "类型, 0提交审核,1发布", required = true)
+    private int type;
+
+    @ApiModelProperty(name = "list", value = "大题列表", required = true)
+    private List<AuditingBigQuestionRequest> list;
+
+    public int getType() {
+        return type;
+    }
+
+    public void setType(int type) {
+        this.type = type;
+    }
+
+    public List<AuditingBigQuestionRequest> getList() {
+        return list;
+    }
+
+    public void setList(List<AuditingBigQuestionRequest> list) {
+        this.list = list;
+    }
+}

+ 61 - 0
src/main/java/com/aijia/kmt/vo/AuditingV1Request.java

@@ -0,0 +1,61 @@
+package com.aijia.kmt.vo;
+
+import com.aijia.core.web.BaseRequest;
+import io.swagger.annotations.ApiModelProperty;
+
+import java.util.ArrayList;
+import java.util.Comparator;
+import java.util.List;
+import java.util.TreeSet;
+
+import static java.util.stream.Collectors.collectingAndThen;
+import static java.util.stream.Collectors.toCollection;
+
+public class AuditingV1Request extends BaseRequest{
+
+    private static final long serialVersionUID = 1L;
+
+    @ApiModelProperty(name = "type", value = "类型, 0提交审核,1发布,4解析提交,5解析发布,6答案校对修改, 默认0", required = true)
+    private int type;
+    @ApiModelProperty(name = "questions", value = "题目ids", required = true)
+    private List<QuestionUpdateRequest> questions;
+
+    @ApiModelProperty(name = "detailIds", value = "关联的知识点", required = false)
+    private List<HowDetailPointsRequest> detailIds;
+
+    @ApiModelProperty(name = "parentId", value = "大题的id", required = false)
+    private String parentId;
+
+    public int getType() {
+        return type;
+    }
+
+    public void setType(int type) {
+        this.type = type;
+    }
+
+    public List<QuestionUpdateRequest> getQuestions() {
+        return questions;
+    }
+
+    public void setQuestions(List<QuestionUpdateRequest> questions) {
+        this.questions = questions;
+    }
+
+    public List<HowDetailPointsRequest> getDetailIds() {
+        return detailIds;
+    }
+
+    public void setDetailIds(List<HowDetailPointsRequest> detailIds) {
+        this.detailIds = detailIds.stream().collect(collectingAndThen(
+                toCollection(() -> new TreeSet<>(Comparator.comparing(HowDetailPointsRequest::getDetailId))), ArrayList::new));
+    }
+
+    public String getParentId() {
+        return parentId;
+    }
+
+    public void setParentId(String parentId) {
+        this.parentId = parentId;
+    }
+}

+ 93 - 0
src/main/java/com/aijia/kmt/vo/ExerciseBookIdDealTypeRequest.java

@@ -0,0 +1,93 @@
+package com.aijia.kmt.vo;
+
+import com.aijia.core.web.BaseRequest;
+import io.swagger.annotations.ApiModelProperty;
+
+/**
+ * @Author: chchen
+ * @Description
+ * @Date Create in 15:06 2019/11/26
+ * @Modified By
+ */
+public class ExerciseBookIdDealTypeRequest extends BaseRequest {
+
+    private static final long serialVersionUID = 1L;
+
+    @ApiModelProperty(name = "id", value = "练习册id", required = true)
+    private String id;
+
+    @ApiModelProperty(name = "dealType", value = "0未知, 1加工,2审核, 4解析", required = true)
+    private int dealType;
+
+    @ApiModelProperty(name = "bookYear", value = "练习册年份", required = true)
+    private int bookYear;
+
+    @ApiModelProperty(name = "bookType", value = "练习册类型", required = true)
+    private int bookType;
+
+    @ApiModelProperty(name = "bookPartType", value = "练习册题目类型, 1全部,2不同", required = true)
+    private int bookPartType;
+
+    @ApiModelProperty(name = "exerciseBookId", value = "练习册exerciseBookId", required = true)
+    private String exerciseBookId;
+
+    @ApiModelProperty(name = "questionId", value = "题目id", required = false)
+    private String questionId;
+
+
+    public String getId() {
+        return id;
+    }
+
+    public void setId(String id) {
+        this.id = id;
+    }
+
+    public int getDealType() {
+        return dealType;
+    }
+
+    public void setDealType(int dealType) {
+        this.dealType = dealType;
+    }
+
+    public int getBookYear() {
+        return bookYear;
+    }
+
+    public void setBookYear(int bookYear) {
+        this.bookYear = bookYear;
+    }
+
+    public int getBookType() {
+        return bookType;
+    }
+
+    public void setBookType(int bookType) {
+        this.bookType = bookType;
+    }
+
+    public String getExerciseBookId() {
+        return exerciseBookId;
+    }
+
+    public void setExerciseBookId(String exerciseBookId) {
+        this.exerciseBookId = exerciseBookId;
+    }
+
+    public String getQuestionId() {
+        return questionId;
+    }
+
+    public void setQuestionId(String questionId) {
+        this.questionId = questionId;
+    }
+
+    public int getBookPartType() {
+        return bookPartType;
+    }
+
+    public void setBookPartType(int bookPartType) {
+        this.bookPartType = bookPartType;
+    }
+}

+ 97 - 0
src/main/java/com/aijia/kmt/vo/ExerciseConditionRequest.java

@@ -0,0 +1,97 @@
+package com.aijia.kmt.vo;
+
+import com.aijia.core.web.BaseRequest;
+import io.swagger.annotations.ApiModelProperty;
+
+public class ExerciseConditionRequest extends BaseRequest {
+
+    private static final long serialVersionUID = 1L;
+
+    @ApiModelProperty(name = "subject", value = "科目", required = false)
+    private String  subject;
+
+    @ApiModelProperty(name = "versionType", value = "版本类别, 如语文1北师大版,2人教版", required = false)
+    private int  versionType;
+
+    @ApiModelProperty(name = "grade", value = "年级,一年级", required = false)
+    private String  grade;
+
+    @ApiModelProperty(name = "semester", value = "上下册,1上册,2下册", required = false)
+    private int  semester;
+
+    @ApiModelProperty(name = "dealType", value = "0未知, 1加工,2审核, 4解析", required = true)
+    private int dealType;
+
+    @ApiModelProperty(name = "bookName", value = "搜索的练习册名称", required = false)
+    private String  bookName;
+
+    @ApiModelProperty(name = "searchType", value = "0模糊,1精确", required = true)
+    private int searchType;
+
+    @ApiModelProperty(name = "questionId", value = "题目id", required = false)
+    private String questionId;
+
+    public String getSubject() {
+        return subject;
+    }
+
+    public void setSubject(String subject) {
+        this.subject = subject;
+    }
+
+    public int getVersionType() {
+        return versionType;
+    }
+
+    public void setVersionType(int versionType) {
+        this.versionType = versionType;
+    }
+
+    public String getGrade() {
+        return grade;
+    }
+
+    public void setGrade(String grade) {
+        this.grade = grade;
+    }
+
+    public int getSemester() {
+        return semester;
+    }
+
+    public void setSemester(int semester) {
+        this.semester = semester;
+    }
+
+    public int getDealType() {
+        return dealType;
+    }
+
+    public void setDealType(int dealType) {
+        this.dealType = dealType;
+    }
+
+    public String getBookName() {
+        return bookName;
+    }
+
+    public void setBookName(String bookName) {
+        this.bookName = bookName;
+    }
+
+    public int getSearchType() {
+        return searchType;
+    }
+
+    public void setSearchType(int searchType) {
+        this.searchType = searchType;
+    }
+
+    public String getQuestionId() {
+        return questionId;
+    }
+
+    public void setQuestionId(String questionId) {
+        this.questionId = questionId;
+    }
+}

+ 208 - 0
src/main/java/com/aijia/kmt/vo/ExerciseQuestionsRequest.java

@@ -0,0 +1,208 @@
+package com.aijia.kmt.vo;
+
+import com.aijia.core.web.BaseRequest;
+import io.swagger.annotations.ApiModelProperty;
+
+public class ExerciseQuestionsRequest extends BaseRequest {
+
+    private static final long serialVersionUID = 1L;
+
+    @ApiModelProperty(name = "subject", value = "科目", required = true)
+    private String  subject;
+
+    @ApiModelProperty(name = "versionType", value = "版本类别, 如语文1北师大版,2人教版", required = true)
+    private int  versionType;
+
+    @ApiModelProperty(name = "grade", value = "年级,一年级", required = true)
+    private String  grade;
+
+    @ApiModelProperty(name = "semester", value = "上下册,1上册,2下册", required = true)
+    private int  semester;
+
+    @ApiModelProperty(name = "bookId", value = "练习册id", required = true)
+    private String  bookId;
+
+    @ApiModelProperty(name = "unitId", value = "单元id", required = false)
+    private String  unitId;
+
+    @ApiModelProperty(name = "periodId", value = "课时id", required = false)
+    private String  periodId;
+
+    @ApiModelProperty(name = "dealType", value = "类型,1待加工,2待审核", required = false)
+    private int  dealType = 1;
+
+    @ApiModelProperty(name = "page", value = "练习册的页码", required = false)
+    private int page;
+
+    @ApiModelProperty(name = "pageNo", value = "练习册的页码", required = false)
+    private int pageNo;
+
+    @ApiModelProperty(name = "pageSize", value = "练习册的页码", required = false)
+    private int pageSize;
+
+    @ApiModelProperty(name = "bookYear", value = "练习册年份", required = true)
+    private int bookYear = 2019;
+
+    @ApiModelProperty(name = "exerciseBookId", value = "练习册exerciseBookId", required = true)
+    private String exerciseBookId;
+
+    @ApiModelProperty(name = "rollbackType", value = "批量打回类型,1(打回到ai),2(打回到题目加工), 3(打回到题目审核), 4(打回到解析加工),5(打回到解析审核)", required = false)
+    private int  rollbackType;
+
+    @ApiModelProperty(name = "questionId", value = "questionId", required = false)
+    private String questionId;
+
+    @ApiModelProperty(name = "bookPartType", value = "练习册类型,1全部, 2不同", required = false)
+    private int  bookPartType;
+
+    @ApiModelProperty(name = "questionType", value = "题目类型", required = false)
+    private int questionType;
+
+    @ApiModelProperty(name = "publishStatus", value = "发布状态,1未发布,2已发布", required = false)
+    private int publishStatus;
+
+    public String getSubject() {
+        return subject;
+    }
+
+    public void setSubject(String subject) {
+        this.subject = subject;
+    }
+
+    public int getVersionType() {
+        return versionType;
+    }
+
+    public void setVersionType(int versionType) {
+        this.versionType = versionType;
+    }
+
+    public String getGrade() {
+        return grade;
+    }
+
+    public void setGrade(String grade) {
+        this.grade = grade;
+    }
+
+    public int getSemester() {
+        return semester;
+    }
+
+    public void setSemester(int semester) {
+        this.semester = semester;
+    }
+
+    public String getBookId() {
+        return bookId;
+    }
+
+    public void setBookId(String bookId) {
+        this.bookId = bookId;
+    }
+
+    public String getUnitId() {
+        return unitId;
+    }
+
+    public void setUnitId(String unitId) {
+        this.unitId = unitId;
+    }
+
+    public String getPeriodId() {
+        return periodId;
+    }
+
+    public void setPeriodId(String periodId) {
+        this.periodId = periodId;
+    }
+
+
+    public int getDealType() {
+        return dealType;
+    }
+
+    public void setDealType(int dealType) {
+        this.dealType = dealType;
+    }
+
+    public int getPage() {
+        return page;
+    }
+
+    public void setPage(int page) {
+        this.page = page;
+    }
+
+    public int getPageNo() {
+        return pageNo;
+    }
+
+    public void setPageNo(int pageNo) {
+        this.pageNo = pageNo;
+    }
+
+    public int getPageSize() {
+        return pageSize;
+    }
+
+    public void setPageSize(int pageSize) {
+        this.pageSize = pageSize;
+    }
+
+    public int getBookYear() {
+        return bookYear;
+    }
+
+    public void setBookYear(int bookYear) {
+        this.bookYear = bookYear;
+    }
+
+    public String getExerciseBookId() {
+        return exerciseBookId;
+    }
+
+    public void setExerciseBookId(String exerciseBookId) {
+        this.exerciseBookId = exerciseBookId;
+    }
+
+    public int getRollbackType() {
+        return rollbackType;
+    }
+
+    public void setRollbackType(int rollbackType) {
+        this.rollbackType = rollbackType;
+    }
+
+    public String getQuestionId() {
+        return questionId;
+    }
+
+    public void setQuestionId(String questionId) {
+        this.questionId = questionId;
+    }
+
+    public int getBookPartType() {
+        return bookPartType;
+    }
+
+    public void setBookPartType(int bookPartType) {
+        this.bookPartType = bookPartType;
+    }
+
+    public int getQuestionType() {
+        return questionType;
+    }
+
+    public void setQuestionType(int questionType) {
+        this.questionType = questionType;
+    }
+
+    public int getPublishStatus() {
+        return publishStatus;
+    }
+
+    public void setPublishStatus(int publishStatus) {
+        this.publishStatus = publishStatus;
+    }
+}

+ 30 - 0
src/main/java/com/aijia/kmt/vo/HowDetailPointsRequest.java

@@ -0,0 +1,30 @@
+package com.aijia.kmt.vo;
+
+import com.aijia.core.web.BaseRequest;
+
+import java.util.List;
+import java.util.stream.Collectors;
+
+public class HowDetailPointsRequest extends BaseRequest{
+    private static final long serialVersionUID = 1L;
+
+    private String detailId;
+
+    private List<String> pointIds;
+
+    public String getDetailId() {
+        return detailId;
+    }
+
+    public void setDetailId(String detailId) {
+        this.detailId = detailId;
+    }
+
+    public List<String> getPointIds() {
+        return pointIds;
+    }
+
+    public void setPointIds(List<String> pointIds) {
+        this.pointIds =  pointIds.stream().distinct().collect(Collectors.toList());
+    }
+}

+ 221 - 0
src/main/java/com/aijia/kmt/vo/KmtHandlingQuestionRequest.java

@@ -0,0 +1,221 @@
+package com.aijia.kmt.vo;
+
+import com.aijia.core.web.BaseRequest;
+import io.swagger.annotations.ApiModelProperty;
+
+/**
+ * @Author: chchen
+ * @Description 查询待加工审核的kmt题目列表请求体
+ * @Date Create in 11:24 2019/11/27
+ * @Modified By
+ */
+public class KmtHandlingQuestionRequest extends BaseRequest {
+
+    private static final long serialVersionUID = 1L;
+
+    @ApiModelProperty(name = "dealType", value = "1加工 2审核 3全部", required = true)
+    private  int dealType;
+
+    @ApiModelProperty(name = "grade", value = "年级", required = false)
+    private String grade;
+
+    @ApiModelProperty(name = "subject", value = "科目", required = false)
+    private  String subject;
+
+    @ApiModelProperty(name = "versionType", value = "版本类型", required = false)
+    private int versionType;
+
+    @ApiModelProperty(name = "semester", value = "上下册,1上2下", required = false)
+    private int semester;
+
+    @ApiModelProperty(name = "moduleType", value = "模块, 1同步2专题", required = false)
+    private int moduleType;
+
+    @ApiModelProperty(name = "detailId", value = "知识点id", required = false)
+    private String detailId;
+
+    @ApiModelProperty(name = "pointId", value = "考点id", required = false)
+    private String pointId;
+
+    @ApiModelProperty(name = "questionId", value = "题目id", required = false)
+    private String questionId;
+
+    @ApiModelProperty(name = "pageNo", value = "页码", required = true)
+    private int pageNo;
+
+    @ApiModelProperty(name = "pageSize", value = "每页条数", required = true)
+    private int pageSize;
+
+    @ApiModelProperty(name = "maxCreateTime", value = "最大创建时间", required = true)
+    private String maxCreateTime;
+
+    @ApiModelProperty(name = "name", value = "加工人/审核人名(模糊查询)", required = true)
+    private String name;
+
+    @ApiModelProperty(name = "yearName", value = "年份", required = false)
+    private String yearName;
+
+    private int beginYear;
+
+    private int endYear;
+
+    private String questionProvince;
+
+    private String questionCity;
+
+    private String questionCountry;
+
+    public String getName() {
+        return name;
+    }
+
+    public void setName(String name) {
+        this.name = name;
+    }
+
+    public int getDealType() {
+        return dealType;
+    }
+
+    public void setDealType(int dealType) {
+        this.dealType = dealType;
+    }
+
+    public String getGrade() {
+        return grade;
+    }
+
+    public void setGrade(String grade) {
+        this.grade = grade;
+    }
+
+    public String getSubject() {
+        return subject;
+    }
+
+    public void setSubject(String subject) {
+        this.subject = subject;
+    }
+
+    public int getVersionType() {
+        return versionType;
+    }
+
+    public void setVersionType(int versionType) {
+        this.versionType = versionType;
+    }
+
+    public int getSemester() {
+        return semester;
+    }
+
+    public void setSemester(int semester) {
+        this.semester = semester;
+    }
+
+    public int getModuleType() {
+        return moduleType;
+    }
+
+    public void setModuleType(int moduleType) {
+        this.moduleType = moduleType;
+    }
+
+    public String getDetailId() {
+        return detailId;
+    }
+
+    public void setDetailId(String detailId) {
+        this.detailId = detailId;
+    }
+
+    public String getPointId() {
+        return pointId;
+    }
+
+    public void setPointId(String pointId) {
+        this.pointId = pointId;
+    }
+
+    public String getQuestionId() {
+        return questionId;
+    }
+
+    public void setQuestionId(String questionId) {
+        this.questionId = questionId;
+    }
+
+    public int getPageNo() {
+        return pageNo;
+    }
+
+    public void setPageNo(int pageNo) {
+        this.pageNo = pageNo;
+    }
+
+    public int getPageSize() {
+        return pageSize;
+    }
+
+    public void setPageSize(int pageSize) {
+        this.pageSize = pageSize;
+    }
+
+    public String getMaxCreateTime() {
+        return maxCreateTime;
+    }
+
+    public void setMaxCreateTime(String maxCreateTime) {
+        this.maxCreateTime = maxCreateTime;
+    }
+
+    public String getYearName() {
+        return yearName;
+    }
+
+    public void setYearName(String yearName) {
+        this.yearName = yearName;
+        if (yearName != null && yearName !=""){
+            String[] yearArray = yearName.split("-");
+            if (yearArray.length == 2){
+                this.beginYear = Integer.parseInt(yearArray[0]);
+                this.endYear = Integer.parseInt(yearArray[1]);
+
+            }
+        }
+    }
+
+    public long getBeginYear() {
+        return beginYear;
+    }
+
+
+    public long getEndYear() {
+        return endYear;
+    }
+
+    public String getQuestionProvince() {
+        return questionProvince;
+    }
+
+    public void setQuestionProvince(String questionProvince) {
+        this.questionProvince = questionProvince;
+    }
+
+    public String getQuestionCity() {
+        return questionCity;
+    }
+
+    public void setQuestionCity(String questionCity) {
+        this.questionCity = questionCity;
+    }
+
+    public String getQuestionCountry() {
+        return questionCountry;
+    }
+
+    public void setQuestionCountry(String questionCountry) {
+        this.questionCountry = questionCountry;
+    }
+}
+

+ 123 - 0
src/main/java/com/aijia/kmt/vo/KnowHowDetailsDTO.java

@@ -0,0 +1,123 @@
+package com.aijia.kmt.vo;
+
+import java.io.Serializable;
+import java.util.ArrayList;
+import java.util.Comparator;
+import java.util.List;
+import java.util.TreeSet;
+
+import static java.util.stream.Collectors.collectingAndThen;
+import static java.util.stream.Collectors.toCollection;
+
+public class KnowHowDetailsDTO implements Serializable {
+
+    private static final long serialVersionUID = 8294356977626600268L;
+
+    private String id;
+    private String name;
+    private List<TestPointDTO> points;
+    private boolean selected = false;
+    private String wrongCount;
+    private String correctCount;
+    private String grade;
+    private String versionName;
+    private int semester;
+    private String howName;
+
+    public KnowHowDetailsDTO(){
+
+    }
+
+    public KnowHowDetailsDTO(String id, String name) {
+        this.id = id;
+        this.name = name;
+    }
+
+    public String getId() {
+        return id;
+    }
+
+    public void setId(String id) {
+        this.id = id;
+    }
+
+    public String getName() {
+        return name;
+    }
+
+    public void setName(String name) {
+        this.name = name;
+    }
+
+    public List<TestPointDTO> getPoints() {
+        return points;
+    }
+
+    public void setPoints(List<TestPointDTO> points) {
+        this.points = points.stream().collect(collectingAndThen(
+                toCollection(() -> new TreeSet<>(Comparator.comparing(TestPointDTO::getId))), ArrayList::new));
+    }
+
+    public void addPoint (TestPointDTO pointDTO){
+        if (points == null) {
+            points = new ArrayList<>();
+        }
+        points.add(pointDTO);
+    }
+
+    public boolean isSelected() {
+        return selected;
+    }
+
+    public void setSelected(boolean selected) {
+        this.selected = selected;
+    }
+
+    public String getWrongCount() {
+        return wrongCount;
+    }
+
+    public void setWrongCount(String wrongCount) {
+        this.wrongCount = wrongCount;
+    }
+
+    public String getCorrectCount() {
+        return correctCount;
+    }
+
+    public void setCorrectCount(String correctCount) {
+        this.correctCount = correctCount;
+    }
+
+    public String getGrade() {
+        return grade;
+    }
+
+    public void setGrade(String grade) {
+        this.grade = grade;
+    }
+
+    public String getVersionName() {
+        return versionName;
+    }
+
+    public void setVersionName(String versionName) {
+        this.versionName = versionName;
+    }
+
+    public int getSemester() {
+        return semester;
+    }
+
+    public void setSemester(int semester) {
+        this.semester = semester;
+    }
+
+    public String getHowName() {
+        return howName;
+    }
+
+    public void setHowName(String howName) {
+        this.howName = howName;
+    }
+}

+ 75 - 0
src/main/java/com/aijia/kmt/vo/KnowledgeRequest.java

@@ -0,0 +1,75 @@
+package com.aijia.kmt.vo;
+
+import com.aijia.core.web.BaseRequest;
+import io.swagger.annotations.ApiModelProperty;
+
+public class KnowledgeRequest extends BaseRequest {
+
+    private static final long serialVersionUID = 5708203490137525830L;
+
+    @ApiModelProperty(name = "grade", value = "年级, 如:'一年级'", required = true)
+    private String grade;
+
+    @ApiModelProperty(name = "subject", value = "科目", required = true)
+    private String subject;
+
+    @ApiModelProperty(name = "versionType", value = "版本列表标识,在查询筛选条件接口返回", required = true)
+    private Integer versionType;
+
+    @ApiModelProperty(name = "semester", value = "上下册, 1上2下", required = true)
+     private Integer semester;
+
+    @ApiModelProperty(name = "moduleType", value = "同步专题字段,默认1同步")
+     private Integer moduleType;
+
+    @ApiModelProperty(name = "searchKey", value = "搜索关键词")
+     private String searchKey = "";
+
+    public String getGrade() {
+        return grade;
+    }
+
+    public void setGrade(String grade) {
+        this.grade = grade;
+    }
+
+    public String getSubject() {
+        return subject;
+    }
+
+    public void setSubject(String subject) {
+        this.subject = subject;
+    }
+
+    public Integer getVersionType() {
+        return versionType;
+    }
+
+    public void setVersionType(Integer versionType) {
+        this.versionType = versionType;
+    }
+
+    public Integer getSemester() {
+        return semester;
+    }
+
+    public void setSemester(Integer semester) {
+        this.semester = semester;
+    }
+
+    public Integer getModuleType() {
+        return moduleType;
+    }
+
+    public void setModuleType(Integer moduleType) {
+        this.moduleType = moduleType;
+    }
+
+    public String getSearchKey() {
+        return searchKey;
+    }
+
+    public void setSearchKey(String searchKey) {
+        this.searchKey = searchKey;
+    }
+}

+ 27 - 0
src/main/java/com/aijia/kmt/vo/ParentIdListRequest.java

@@ -0,0 +1,27 @@
+package com.aijia.kmt.vo;
+
+import com.aijia.core.web.BaseRequest;
+import io.swagger.annotations.ApiModelProperty;
+
+import java.util.List;
+
+/**
+ * @Author: chchen
+ * @Description
+ * @Date Create in 15:48 2020/4/16
+ * @Modified By
+ */
+public class ParentIdListRequest extends BaseRequest {
+    private static final long serialVersionUID = 1L;
+
+    @ApiModelProperty(name = "parentIdList", value = "父题id", required = true)
+    private List<String> parentIdList;
+
+    public List<String> getParentIdList() {
+        return parentIdList;
+    }
+
+    public void setParentIdList(List<String> parentIdList) {
+        this.parentIdList = parentIdList;
+    }
+}

+ 69 - 0
src/main/java/com/aijia/kmt/vo/QuestionNumMarkRemoveVo.java

@@ -0,0 +1,69 @@
+package com.aijia.kmt.vo;
+
+
+import com.aijia.core.web.BaseRequest;
+
+public class QuestionNumMarkRemoveVo extends BaseRequest {
+
+    private static final long serialVersionUID = 1L;
+
+    private String questionId;
+
+    private int startX;
+
+    private int startY;
+
+    private int endX;
+
+    private int endY;
+
+    private int enumerate =1;
+
+    public int getEnumerate() {
+        return enumerate;
+    }
+
+    public void setEnumerate(int enumerate) {
+        this.enumerate = enumerate;
+    }
+
+    public String getQuestionId() {
+        return questionId;
+    }
+
+    public void setQuestionId(String questionId) {
+        this.questionId = questionId;
+    }
+
+    public int getStartX() {
+        return startX;
+    }
+
+    public void setStartX(int startX) {
+        this.startX = startX;
+    }
+
+    public int getStartY() {
+        return startY;
+    }
+
+    public void setStartY(int startY) {
+        this.startY = startY;
+    }
+
+    public int getEndX() {
+        return endX;
+    }
+
+    public void setEndX(int endX) {
+        this.endX = endX;
+    }
+
+    public int getEndY() {
+        return endY;
+    }
+
+    public void setEndY(int endY) {
+        this.endY = endY;
+    }
+}

+ 239 - 0
src/main/java/com/aijia/kmt/vo/QuestionUpdateRequest.java

@@ -0,0 +1,239 @@
+package com.aijia.kmt.vo;
+
+import com.aijia.core.web.BaseRequest;
+import com.aijia.kmt.dto.KnowHowDetailsDTO;
+import com.aijia.kmt.dto.knowledge.KnowledgeBaseDto;
+import io.swagger.annotations.ApiModelProperty;
+
+import java.util.ArrayList;
+import java.util.Comparator;
+import java.util.List;
+import java.util.TreeSet;
+
+import static java.util.stream.Collectors.collectingAndThen;
+import static java.util.stream.Collectors.toCollection;
+
+public class QuestionUpdateRequest extends BaseRequest {
+
+    private static final long serialVersionUID = 1L;
+
+    @ApiModelProperty(name = "questionId", value = "题目id", required = false)
+    private String  questionId;
+
+    @ApiModelProperty(name = "questionText", value = "题目", required = true)
+    private String questionText;
+
+    @ApiModelProperty(name = "smallQuestionIndex", value = "小题号", required = true)
+    private String smallQuestionIndex;
+
+    @ApiModelProperty(name = "questionImage", value = "题目原图", required = true)
+    private String questionImage;
+
+    @ApiModelProperty(name = "answer", value = "答案h5", required = true)
+    private String answer;
+
+    @ApiModelProperty(name = "answerJson", value = "答案", required = true)
+    private String answerJson;
+
+    @ApiModelProperty(name = "questionAnalysis", value = "题目解析", required = false)
+    private String questionAnalysis;
+
+    @ApiModelProperty(name = "analysisJson", value = "解析json字符串", required = false)
+    private String analysisJson;
+
+    @ApiModelProperty(name = "questionTypes", value = "题目类型", required = false)
+    private List<KnowledgeBaseDto> questionTypes;
+
+    @ApiModelProperty(name = "difficultyLevels", value = "难度级别", required = false)
+    private List<KnowledgeBaseDto> difficultyLevels;
+
+    @ApiModelProperty(name = "realExamTypes", value = "真题、例题类型", required = false)
+    private List<KnowledgeBaseDto> realExamTypes;
+
+    @ApiModelProperty(name = "trainingSkills", value = "训练能力", required = false)
+    private List<KnowledgeBaseDto> trainingSkills;
+
+    @ApiModelProperty(name = "knowledges", value = "关联的知识点", required = false)
+    private List<KnowHowDetailsDTO> knowledges;
+
+    @ApiModelProperty(name = "subject", value = "科目", required = false)
+    private String subject;
+
+    @ApiModelProperty(name = "yearName", value = "年份", required = false)
+    private String yearName;
+
+    private int beginYear;
+
+    private int endYear;
+
+    @ApiModelProperty(name = "questionProvince", value = "省", required = false)
+    private String questionProvince;
+
+    @ApiModelProperty(name = "questionCity", value = "城市", required = false)
+    private String questionCity;
+
+    @ApiModelProperty(name = "questionCountry", value = "地区", required = false)
+    private String questionCountry;
+
+    public String getQuestionId() {
+        return questionId;
+    }
+
+    public void setQuestionId(String questionId) {
+        this.questionId = questionId;
+    }
+
+    public String getSmallQuestionIndex() {
+        return smallQuestionIndex;
+    }
+
+    public void setSmallQuestionIndex(String smallQuestionIndex) {
+        this.smallQuestionIndex = smallQuestionIndex;
+    }
+
+    public String getQuestionText() {
+        return questionText;
+    }
+
+    public void setQuestionText(String questionText) {
+        this.questionText = questionText;
+    }
+
+    public String getQuestionImage() {
+        return questionImage;
+    }
+
+    public void setQuestionImage(String questionImage) {
+        this.questionImage = questionImage;
+    }
+
+    public String getAnswerJson() {
+        return answerJson;
+    }
+
+    public void setAnswerJson(String answerJson) {
+        this.answerJson = answerJson;
+    }
+
+    public String getQuestionAnalysis() {
+        return questionAnalysis;
+    }
+
+    public void setQuestionAnalysis(String questionAnalysis) {
+        this.questionAnalysis = questionAnalysis;
+    }
+
+    public String getAnalysisJson() {
+        return analysisJson;
+    }
+
+    public void setAnalysisJson(String analysisJson) {
+        this.analysisJson = analysisJson;
+    }
+
+    public List<KnowledgeBaseDto> getQuestionTypes() {
+        return questionTypes;
+    }
+
+    public void setQuestionTypes(List<KnowledgeBaseDto> questionTypes) {
+        this.questionTypes = questionTypes.stream().collect(collectingAndThen(
+                toCollection(() -> new TreeSet<>(Comparator.comparing(KnowledgeBaseDto::getType))), ArrayList::new));
+    }
+
+    public List<KnowledgeBaseDto> getDifficultyLevels() {
+        return difficultyLevels;
+    }
+
+    public void setDifficultyLevels(List<KnowledgeBaseDto> difficultyLevels) {
+        this.difficultyLevels = difficultyLevels.stream().collect(collectingAndThen(
+                toCollection(() -> new TreeSet<>(Comparator.comparing(KnowledgeBaseDto::getType))), ArrayList::new));
+    }
+
+    public List<KnowledgeBaseDto> getRealExamTypes() {
+        return realExamTypes;
+    }
+
+    public void setRealExamTypes(List<KnowledgeBaseDto> realExamTypes) {
+        this.realExamTypes = realExamTypes.stream().collect(collectingAndThen(
+                toCollection(() -> new TreeSet<>(Comparator.comparing(KnowledgeBaseDto::getType))), ArrayList::new));
+    }
+
+    public List<KnowledgeBaseDto> getTrainingSkills() {
+        return trainingSkills;
+    }
+
+    public void setTrainingSkills(List<KnowledgeBaseDto> trainingSkills) {
+        this.trainingSkills = trainingSkills.stream().collect(collectingAndThen(
+                toCollection(() -> new TreeSet<>(Comparator.comparing(KnowledgeBaseDto::getType))), ArrayList::new));
+    }
+
+    public List<KnowHowDetailsDTO> getKnowledges() {
+        return knowledges;
+    }
+
+    public void setKnowledges(List<KnowHowDetailsDTO> knowledges) {
+        this.knowledges = knowledges.stream().collect(collectingAndThen(
+                toCollection(() -> new TreeSet<>(Comparator.comparing(KnowHowDetailsDTO::getId))), ArrayList::new));
+    }
+
+    public String getSubject() {
+        return subject;
+    }
+
+    public void setSubject(String subject) {
+        this.subject = subject;
+    }
+
+    public void setYearName(String yearName) {
+        this.yearName = yearName;
+        if (yearName != null && yearName !=""){
+            String[] yearArray = yearName.split("-");
+            if (yearArray.length == 2){
+                this.beginYear = Integer.parseInt(yearArray[0]);
+                this.endYear = Integer.parseInt(yearArray[1]);
+
+            }
+        }
+    }
+
+    public int getBeginYear() {
+        return beginYear;
+    }
+
+
+    public int getEndYear() {
+        return endYear;
+    }
+
+    public String getQuestionProvince() {
+        return questionProvince;
+    }
+
+    public void setQuestionProvince(String questionProvince) {
+        this.questionProvince = questionProvince;
+    }
+
+    public String getQuestionCity() {
+        return questionCity;
+    }
+
+    public void setQuestionCity(String questionCity) {
+        this.questionCity = questionCity;
+    }
+
+    public String getQuestionCountry() {
+        return questionCountry;
+    }
+
+    public void setQuestionCountry(String questionCountry) {
+        this.questionCountry = questionCountry;
+    }
+
+    public String getAnswer() {
+        return answer;
+    }
+
+    public void setAnswer(String answer) {
+        this.answer = answer;
+    }
+}

+ 36 - 0
src/main/java/com/aijia/kmt/vo/TestPointDTO.java

@@ -0,0 +1,36 @@
+package com.aijia.kmt.vo;
+
+import java.io.Serializable;
+
+public class TestPointDTO implements Serializable {
+
+    private static final long serialVersionUID = 8294356977626600268L;
+
+    private String id;
+    private String name;
+
+    public TestPointDTO() {
+
+    }
+
+    public TestPointDTO(String id, String name){
+       this.id = id;
+       this.name = name;
+    }
+
+    public String getId() {
+        return id;
+    }
+
+    public void setId(String id) {
+        this.id = id;
+    }
+
+    public String getName() {
+        return name;
+    }
+
+    public void setName(String name) {
+        this.name = name;
+    }
+}

+ 77 - 0
src/main/java/com/aijia/kmt/vo/TestPointRequest.java

@@ -0,0 +1,77 @@
+package com.aijia.kmt.vo;
+
+import com.aijia.core.web.BaseRequest;
+import io.swagger.annotations.ApiModelProperty;
+
+import java.util.List;
+
+public class TestPointRequest extends BaseRequest {
+
+    private static final long serialVersionUID = -5311566031615613726L;
+
+    @ApiModelProperty(name = "versionType", value = "知识点版本号")
+    private int versionType;
+
+    @ApiModelProperty(name = "semester", value = "上下册")
+    private int semester;
+
+    @ApiModelProperty(name = "grade", value = "年级")
+    private String grade;
+
+    @ApiModelProperty(name = "subject", value = "科目")
+    private String subject;
+
+    @ApiModelProperty(name = "moduleType", value = "1同步2专题,默认同步")
+    private int moduleType = 1;
+
+    @ApiModelProperty(name = "detailIds", value = "知识点id列表", required = true)
+    private List<String> detailIds;
+
+    public int getVersionType() {
+        return versionType;
+    }
+
+    public void setVersionType(int versionType) {
+        this.versionType = versionType;
+    }
+
+    public List<String> getDetailIds() {
+        return detailIds;
+    }
+
+    public void setDetailIds(List<String> detailIds) {
+        this.detailIds = detailIds;
+    }
+
+    public int getSemester() {
+        return semester;
+    }
+
+    public void setSemester(int semester) {
+        this.semester = semester;
+    }
+
+    public String getGrade() {
+        return grade;
+    }
+
+    public void setGrade(String grade) {
+        this.grade = grade;
+    }
+
+    public String getSubject() {
+        return subject;
+    }
+
+    public void setSubject(String subject) {
+        this.subject = subject;
+    }
+
+    public int getModuleType() {
+        return moduleType;
+    }
+
+    public void setModuleType(int moduleType) {
+        this.moduleType = moduleType;
+    }
+}

+ 0 - 15
src/main/java/com/aijia/peixun/PeixunApplication.java

@@ -1,15 +0,0 @@
-package com.aijia.peixun;
-
-import org.springframework.boot.SpringApplication;
-import org.springframework.boot.autoconfigure.SpringBootApplication;
-import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
-import org.springframework.context.annotation.Bean;
-import org.springframework.context.annotation.ComponentScan;
-
-@SpringBootApplication
-public class PeixunApplication {
-    public static void main(String[] args) {
-        SpringApplication.run(PeixunApplication.class, args);
-    }
-}
-

+ 0 - 47
src/main/java/com/aijia/peixun/config/AjaxPermissionsAuthorizationFilter.java

@@ -1,47 +0,0 @@
-package com.aijia.peixun.config;
-
-import com.aijia.peixun.utils.ErrorEnum;
-import com.alibaba.fastjson.JSONObject;
-import org.apache.shiro.web.filter.authc.FormAuthenticationFilter;
-import org.springframework.boot.web.servlet.FilterRegistrationBean;
-import org.springframework.context.annotation.Bean;
-
-import javax.servlet.ServletRequest;
-import javax.servlet.ServletResponse;
-import javax.servlet.http.HttpServletResponse;
-import java.io.PrintWriter;
-
-
-public class AjaxPermissionsAuthorizationFilter extends FormAuthenticationFilter {
-
-    @Override
-    protected boolean onAccessDenied(ServletRequest request, ServletResponse response) {
-        JSONObject jsonObject = new JSONObject();
-        jsonObject.put("code", ErrorEnum.E_20011.getErrorCode());
-        jsonObject.put("msg", ErrorEnum.E_20011.getErrorMsg());
-        PrintWriter out = null;
-        HttpServletResponse res = (HttpServletResponse) response;
-        try {
-            res.setCharacterEncoding("UTF-8");
-            res.setContentType("application/json");
-            out = response.getWriter();
-            out.println(jsonObject);
-        } catch (Exception e) {
-        } finally {
-            if (null != out) {
-                out.flush();
-                out.close();
-            }
-        }
-        return false;
-    }
-
-    @Bean
-    public FilterRegistrationBean registration(AjaxPermissionsAuthorizationFilter filter) {
-        FilterRegistrationBean registration = new FilterRegistrationBean(filter);
-        registration.setEnabled(false);
-        return registration;
-    }
-
-
-}

+ 0 - 38
src/main/java/com/aijia/peixun/config/GlobalCorsConfig.java

@@ -1,38 +0,0 @@
-package com.aijia.peixun.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;
-
-import java.util.ArrayList;
-import java.util.List;
-
-@Configuration
-public class GlobalCorsConfig {
-
-    private CorsConfiguration buildConfig() {
-        CorsConfiguration corsConfiguration = new CorsConfiguration();
-        corsConfiguration.setAllowCredentials(true); //sessionid 多次访问一致
-
-        // 允许访问的客户端域名
-        List<String> allowedOriginPatterns = new ArrayList<>();
-        allowedOriginPatterns.add("*");
-        corsConfiguration.setAllowedOriginPatterns(allowedOriginPatterns);
-        //  corsConfiguration.addAllowedOrigin("*"); // 允许任何域名使用
-        corsConfiguration.addAllowedHeader("*"); // 允许任何头
-        corsConfiguration.addAllowedMethod("*"); // 允许任何方法(post、get等)
-        return corsConfiguration;
-    }
-
-    @Bean
-    public CorsFilter corsFilter() {
-        UrlBasedCorsConfigurationSource source = new UrlBasedCorsConfigurationSource();
-        source.registerCorsConfiguration("/**", buildConfig()); // 对接口配置跨域设置
-        return new CorsFilter(source);
-    }
-
-
-
-}

+ 0 - 65
src/main/java/com/aijia/peixun/config/RedisConfig.java

@@ -1,65 +0,0 @@
-package com.aijia.peixun.config;
-
-import org.springframework.beans.factory.annotation.Value;
-import org.springframework.context.annotation.Bean;
-import org.springframework.context.annotation.Configuration;
-import redis.clients.jedis.HostAndPort;
-import redis.clients.jedis.JedisCluster;
-import redis.clients.jedis.JedisPoolConfig;
-
-import java.util.HashSet;
-
-@Configuration
-public class RedisConfig {
-
-//    @Value("${spring.redis.timeout}")
-    @Value("3000")
-    private int timeout;
-
-//    @Value("${spring.redis.cluster.pool.max-idle}")
-    @Value("8")
-    private int maxIdle;
-
-//    @Value("${spring.redis.cluster.pool.max-wait}")
-    @Value("-1")
-    private long maxWaitMillis;
-
-//    @Value("${spring.redis.block-when-exhausted}")
-    @Value("true")
-    private boolean blockWhenExhausted;
-
-//    @Value("${spring.redis.cluster.nodes}")
-//    @Value("192.168.2.118:7000,192.168.2.118:7001,192.168.2.118:7002,192.168.2.118:7003,192.168.2.118:7004,192.168.2.118:7005")
-    @Value("47.119.147.170:7000")
-    private String clusterNodes;
-
-//    @Value("${spring.redis.password}")
-//    @Value("123")
-    @Value("aijia@78342")
-    private String password;
-
-    @Bean
-    public JedisCluster redisPoolFactory() throws Exception {
-        JedisPoolConfig jedisPoolConfig = new JedisPoolConfig();
-        jedisPoolConfig.setMaxIdle(maxIdle);
-        jedisPoolConfig.setMaxWaitMillis(maxWaitMillis);
-        // 连接耗尽时是否阻塞, false报异常,ture阻塞直到超时, 默认true
-        jedisPoolConfig.setBlockWhenExhausted(blockWhenExhausted);
-        // 是否启用pool的jmx管理功能, 默认true
-        jedisPoolConfig.setJmxEnabled(true);
-        String[] cNodes = clusterNodes.split(",");
-        HashSet<HostAndPort> nodes = new HashSet<>();
-        // 分割集群节点
-        for (String node : cNodes) {
-            String[] hp = node.split(":");
-            nodes.add(new HostAndPort(hp[0], Integer.parseInt(hp[1])));
-        }
-        // 创建集群对象
-        // JedisCluster jedisCluster = new JedisCluster(nodes, timeout,
-        // jedisPoolConfig);
-
-        return new JedisCluster(nodes, timeout, timeout, 5, password, jedisPoolConfig);
-        // return new JedisCluster(nodes, timeout, jedisPoolConfig);
-    }
-
-}

+ 0 - 122
src/main/java/com/aijia/peixun/config/ShiroConfiguration.java

@@ -1,122 +0,0 @@
-package com.aijia.peixun.config;
-
-import org.apache.shiro.authc.credential.HashedCredentialsMatcher;
-import org.apache.shiro.mgt.SecurityManager;
-import org.apache.shiro.spring.LifecycleBeanPostProcessor;
-import org.apache.shiro.spring.security.interceptor.AuthorizationAttributeSourceAdvisor;
-import org.apache.shiro.spring.web.ShiroFilterFactoryBean;
-import org.apache.shiro.web.mgt.DefaultWebSecurityManager;
-import org.springframework.aop.framework.autoproxy.DefaultAdvisorAutoProxyCreator;
-import org.springframework.context.annotation.Bean;
-import org.springframework.context.annotation.Configuration;
-import org.springframework.context.annotation.DependsOn;
-
-import javax.servlet.Filter;
-import java.util.LinkedHashMap;
-import java.util.Map;
-
-@Configuration
-public class ShiroConfiguration {
-    /**
-     * Shiro的Web过滤器Factory 命名:shiroFilter
-     */
-    @Bean(name = "shiroFilter")
-    public ShiroFilterFactoryBean shiroFilterFactoryBean(SecurityManager securityManager) {
-        ShiroFilterFactoryBean shiroFilterFactoryBean = new ShiroFilterFactoryBean();
-        //Shiro的核心安全接口,这个属性是必须的
-        shiroFilterFactoryBean.setSecurityManager(securityManager);
-        Map<String, Filter> filterMap = new LinkedHashMap<>();
-        filterMap.put("authc", new AjaxPermissionsAuthorizationFilter());
-        shiroFilterFactoryBean.setFilters(filterMap);
-        /*定义shiro过滤链  Map结构
-         * Map中key(xml中是指value值)的第一个'/'代表的路径是相对于HttpServletRequest.getContextPath()的值来的
-         * anon:它对应的过滤器里面是空的,什么都没做,这里.do和.jsp后面的*表示参数,比方说login.jsp?main这种
-         * authc:该过滤器下的页面必须验证后才能访问,它是Shiro内置的一个拦截器org.apache.shiro.web.filter.authc.FormAuthenticationFilter
-         */
-        Map<String, String> filterChainDefinitionMap = new LinkedHashMap<>();
-         /* 过滤链定义,从上向下顺序执行,一般将 / ** 放在最为下边:这是一个坑呢,一不小心代码就不好使了;
-          authc:所有url都必须认证通过才可以访问; anon:所有url都都可以匿名访问 */
-        filterChainDefinitionMap.put("/", "anon");
-        filterChainDefinitionMap.put("/static/**", "anon");
-        filterChainDefinitionMap.put("/login/auth", "anon");
-        filterChainDefinitionMap.put("/login/logout", "anon");
-
-        //放行swagger
-//		filterChainDefinitionMap.put("/swagger-ui.html", "anon");
-//		filterChainDefinitionMap.put("/swagger-resources", "anon");
-//		filterChainDefinitionMap.put("/v2/api-docs", "anon");
-//		filterChainDefinitionMap.put("/webjars/springfox-swagger-ui/**", "anon");
-
-        filterChainDefinitionMap.put("/error", "anon");
-        //filterChainDefinitionMap.put("/**", "authc");
-        shiroFilterFactoryBean.setFilterChainDefinitionMap(filterChainDefinitionMap);
-        return shiroFilterFactoryBean;
-    }
-
-    /**
-     * 不指定名字的话,自动创建一个方法名第一个字母小写的bean
-     */
-    @Bean
-    public SecurityManager securityManager() {
-        DefaultWebSecurityManager securityManager = new DefaultWebSecurityManager();
-        securityManager.setRealm(userRealm());
-//		securityManager.setCacheManager(new MemoryConstrainedCacheManager());
-
-        return securityManager;
-    }
-
-    /**
-     * Shiro Realm 继承自AuthorizingRealm的自定义Realm,即指定Shiro验证用户登录的类为自定义的
-     */
-    @Bean
-    public UserRealm userRealm() {
-        UserRealm userRealm = new UserRealm();
-        return userRealm;
-    }
-
-    /**
-     * 凭证匹配器
-     * (由于我们的密码校验交给Shiro的SimpleAuthenticationInfo进行处理了
-     * 所以我们需要修改下doGetAuthenticationInfo中的代码;
-     * )
-     * 可以扩展凭证匹配器,实现 输入密码错误次数后锁定等功能,下一次
-     */
-    @Bean(name = "credentialsMatcher")
-    public HashedCredentialsMatcher hashedCredentialsMatcher() {
-        HashedCredentialsMatcher hashedCredentialsMatcher = new HashedCredentialsMatcher();
-        //散列算法:这里使用MD5算法;
-        hashedCredentialsMatcher.setHashAlgorithmName("md5");
-        //散列的次数,比如散列两次,相当于 md5(md5(""));
-        hashedCredentialsMatcher.setHashIterations(2);
-        //storedCredentialsHexEncoded默认是true,此时用的是密码加密用的是Hex编码;false时用Base64编码
-        hashedCredentialsMatcher.setStoredCredentialsHexEncoded(true);
-        return hashedCredentialsMatcher;
-    }
-
-    /**
-     * Shiro生命周期处理器
-     */
-    @Bean
-    public LifecycleBeanPostProcessor lifecycleBeanPostProcessor() {
-        return new LifecycleBeanPostProcessor();
-    }
-
-    /**
-     * 开启Shiro的注解(如@RequiresRoles,@RequiresPermissions),需借助SpringAOP扫描使用Shiro注解的类,并在必要时进行安全逻辑验证
-     * 配置以下两个bean(DefaultAdvisorAutoProxyCreator(可选)和AuthorizationAttributeSourceAdvisor)即可实现此功能
-     */
-    @Bean
-    @DependsOn({"lifecycleBeanPostProcessor"})
-    public DefaultAdvisorAutoProxyCreator advisorAutoProxyCreator() {
-        DefaultAdvisorAutoProxyCreator advisorAutoProxyCreator = new DefaultAdvisorAutoProxyCreator();
-        advisorAutoProxyCreator.setProxyTargetClass(true);
-        return advisorAutoProxyCreator;
-    }
-
-    @Bean
-    public AuthorizationAttributeSourceAdvisor authorizationAttributeSourceAdvisor() {
-        AuthorizationAttributeSourceAdvisor authorizationAttributeSourceAdvisor = new AuthorizationAttributeSourceAdvisor();
-        authorizationAttributeSourceAdvisor.setSecurityManager(securityManager());
-        return authorizationAttributeSourceAdvisor;
-    }
-}

+ 0 - 87
src/main/java/com/aijia/peixun/config/UserRealm.java

@@ -1,87 +0,0 @@
-package com.aijia.peixun.config;
-
-import com.aijia.peixun.entity.User;
-import com.aijia.peixun.service.JzPeiXunService;
-import com.aijia.peixun.utils.Constants;
-import com.alibaba.fastjson.JSONObject;
-import org.apache.shiro.SecurityUtils;
-import org.apache.shiro.authc.*;
-import org.apache.shiro.authz.AuthorizationInfo;
-import org.apache.shiro.authz.SimpleAuthorizationInfo;
-import org.apache.shiro.realm.AuthorizingRealm;
-import org.apache.shiro.session.Session;
-import org.apache.shiro.subject.PrincipalCollection;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.springframework.beans.factory.annotation.Autowired;
-
-import java.util.Collection;
-import java.util.Objects;
-
-public class UserRealm extends AuthorizingRealm {
-    private Logger logger = LoggerFactory.getLogger(UserRealm.class);
-
-    @Autowired
-    private JzPeiXunService jzPeiXunService;
-
-    @Override
-    @SuppressWarnings("unchecked")
-    protected AuthorizationInfo doGetAuthorizationInfo(PrincipalCollection principals) {
-        Session session = SecurityUtils.getSubject().getSession();
-        //查询用户的权限
-        JSONObject permission = (JSONObject) session.getAttribute(Constants.SESSION_USER_PERMISSION);
-        logger.info("permission的值为:" + permission);
-        logger.info("本用户权限为:" + permission.get("permissionList"));
-        //为当前用户设置角色和权限
-        SimpleAuthorizationInfo authorizationInfo = new SimpleAuthorizationInfo();
-        authorizationInfo.addStringPermissions((Collection<String>) permission.get("permissionList"));
-        return authorizationInfo;
-    }
-
-    /**
-     * 验证当前登录的Subject
-     * LoginController.login()方法中执行Subject.login()时 执行此方法
-     */
-    @Override
-    protected AuthenticationInfo doGetAuthenticationInfo(AuthenticationToken authcToken) throws AuthenticationException {
-        //获取用户的账号名称 -- 手机号
-        String loginName = (String) authcToken.getPrincipal();
-        // 获取用户密码
-        String password = new String((char[]) authcToken.getCredentials());
-
-        User user = new User();
-        //存储用户名
-        user.setTelephoneno(loginName);
-        //存储验证码
-        user.setBackup2(password);
-
-        //因为是手机号+短息验证码登录,即使没有此手机号账号,也可以登录,可以为null
-//        if (user == null) {
-//            //没找到帐号
-//            throw new UnknownAccountException();
-//        }
-        //交给AuthenticatingRealm使用CredentialsMatcher进行密码匹配,如果觉得人家的不好可以自定义实现
-        SimpleAuthenticationInfo authenticationInfo = new SimpleAuthenticationInfo(
-                user,
-//                user.getTelephoneno(),
-                user.getBackup2(),
-                //ByteSource.Util.bytes("salt"), salt=username+salt,采用明文访问时,不需要此句
-                getName()
-        );
-        //session中不需要保存密码
-//        user.remove("password");
-        //将用户信息放入session中
-        SecurityUtils.getSubject().getSession().setAttribute(Constants.SESSION_USER_INFO, user);
-        System.out.println(authenticationInfo);
-        return authenticationInfo;
-    }
-
-    public static String getUser(){
-        Session session = SecurityUtils.getSubject().getSession();
-        JSONObject userInfo = (JSONObject) session.getAttribute(Constants.SESSION_USER_INFO);
-        if (Objects.isNull(userInfo)) {
-            return null;
-        }
-        return userInfo.getString("username");
-    }
-}

+ 0 - 134
src/main/java/com/aijia/peixun/controller/FileUploadController.java

@@ -1,134 +0,0 @@
-package com.aijia.peixun.controller;
-
-import com.aijia.peixun.entity.File;
-import com.aijia.peixun.service.JzFileService;
-import com.aijia.peixun.utils.ResponseEntity;
-import com.aijia.peixun.utils.httpClient;
-import com.alibaba.fastjson.JSONObject;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.web.bind.annotation.RequestBody;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RequestMethod;
-import org.springframework.web.bind.annotation.RestController;
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-import java.text.SimpleDateFormat;
-import java.util.ArrayList;
-import java.util.Date;
-import java.util.HashMap;
-import java.util.List;
-
-
-@RestController
-@RequestMapping(value = "/file")
-public class FileUploadController {
-
-    @Autowired
-    JzFileService jzFileService;
-
-    //全局map
-    HashMap map = new HashMap();
-
-    final static String uploadeFile = "上传文件";
-    final static String downLodeFile = "获取文件";
-    final static String doExsercise = "做练习题";
-    final static String checkeExsercise = "考评打分";
-    final static String getResult = "获取考试成绩";
-
-    //1. 保存上传文件路径---系统管理员web端上传文件,服务端保存文件url
-    private Logger logger = LoggerFactory.getLogger(this.getClass());
-    @RequestMapping(value = "/saveUploadfilePath", method = RequestMethod.POST)
-    public ResponseEntity getUploadfilePath(@RequestBody JSONObject data) {
-      try {
-          String userId = data.get("userid").toString();
-          String filePath = data.get("filepath").toString();
-          String fileName = data.get("filename").toString();
-          //设置上传文件对应兼职教师的类型
-          Integer fileType = data.getInteger("typeofjob");
-          SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
-          String time = df.format(new Date());
-          File file = new File();
-          file.setUploadeuser(userId);
-          //设置上传文件对应兼职教师的类型
-          file.setFiletype(fileType);
-          file.setFilename(fileName);
-          file.setBackup1(filePath);
-          file.setUploadetime(time);
-          jzFileService.SaveFileData(file);
-      }catch (Exception e){
-            e.printStackTrace();
-        }
-        return new ResponseEntity().success("上传文件成功");
-    }
-
-    //2. 系统管理员获取上传文件(学习资料)  ----  批量获取
-    @RequestMapping(value = "/getFile",method = RequestMethod.POST)
-    public List<File> getFile(@RequestBody JSONObject data){
-
-        List<File> list = new ArrayList<>();
-        try {
-            Integer userId = data.getInteger("userid");
-//            Integer fileId = data.getInteger("fileid");
-            //依据userid,进行多个查询;
-            list = jzFileService.GetFileDataList(userId.toString());
-        }catch (Exception e){
-            e.printStackTrace();
-        }
-        return list;
-    }
-
-    //3. 系统管理员获取上传文件(学习资料)  ----  单个获取
-    @RequestMapping(value = "/getFilebyOne",method = RequestMethod.POST)
-    public File getFilebyOne(@RequestBody JSONObject data){
-                File file = new File();
-        try {
-            Integer fileId = data.getInteger("fileid");
-            //依据文件id,单个查询
-            file = jzFileService.GetFileData(fileId);
-        }catch (Exception e){
-            e.printStackTrace();
-        }
-        return file;
-    }
-
-
-    //4. 兼职教师 -- 获取上传文件(学习资料),依据兼职教师的类型,获取类型匹配的学习资料(pdf,音频,视频,图片等)
-    @RequestMapping(value = "/getFilebytype",method = RequestMethod.POST)
-    public List<File> getFilebytype(@RequestBody JSONObject data){
-
-        List list = new ArrayList();
-        try {
-            String userId = data.get("userid").toString();
-            Integer typeofjob = data.getInteger("typeofjob");
-            list=jzFileService.GetFileByType(typeofjob);
-
-        }catch (Exception e){
-            e.printStackTrace();
-        }
-        return list;
-    }
-
-
-    //5. 教师考试做习题(Kmt实现),依据兼职教师类型,获取考试习题,且检测考试次数;
-    @RequestMapping(value = "/getExamina",method = RequestMethod.POST)
-    public List<File> getExamina(@RequestBody JSONObject data){
-
-        try {
-            String correctingsub = data.getString("correctingsub");
-        }catch (Exception e){
-            e.printStackTrace();
-        }
-
-        return null;
-    }
-
-
-
-}
-
-
-
-
-

+ 0 - 218
src/main/java/com/aijia/peixun/controller/JzPeiXunController.java

@@ -1,218 +0,0 @@
-package com.aijia.peixun.controller;
-
-import com.aijia.peixun.dao.examinationMapper;
-import com.aijia.peixun.entity.User;
-import com.aijia.peixun.entity.examination;
-import com.aijia.peixun.service.JzPeiXunService;
-import com.aijia.peixun.utils.*;
-import com.alibaba.fastjson.JSONObject;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.web.bind.annotation.*;
-
-import javax.annotation.Resource;
-import java.util.*;
-
-@RestController
-@RequestMapping(value = "/jzpeixun")
-public class JzPeiXunController {
-
-    @Resource
-    RedisUtil redisUtil;
-    @Autowired
-    JzPeiXunService jzPeiXunService;
-    //定义全局map,存储短信验证码
-    HashMap map1 = new HashMap();
-
-
-    //1. 发短息
-    @RequestMapping(value = "/sendsms", method = RequestMethod.POST)
-//    public ResponseEntity sendSMSLogin(@RequestParam String telephoneNo, @RequestParam int type){
-    public ResponseEntity sendSMSLogin(@RequestBody JSONObject data) {
-
-        String telephoneNo = data.getString("telephoneNo");
-        Integer type = data.getInteger("type");
-
-        ResponseEntity responseEntity = null;
-        try {
-            if (PhoneFormatCheckUtils.isChinaPhoneLegal(telephoneNo) == true && PhoneFormatCheckUtils.isNumeric(String.valueOf(type))) {
-                //发短信息,手机号与短息验证码写入redis
-                SmsUtils smsUtils = new SmsUtils();
-//                responseEntity = smsUtils.sendSms(telephoneNo, type);
-                String code = smsUtils.sendSms(telephoneNo, type);
-//                redisUtil.set(telephoneNo,code);
-//                String code2 = redisUtil.get(telephoneNo);
-                //短信验证码写入map
-                map1.put(telephoneNo,code);
-                String code2 = map1.get(telephoneNo).toString();
-                System.out.println(code2+"发出短信验证码");
-            }
-        } catch (Exception e) {
-            e.printStackTrace();
-            return responseEntity.failure(ResponseConstant.CODE_000, "");
-        }
-        return responseEntity;
-    }
-
-    //2.手机号+短信验证码,注册登录
-    @RequestMapping(value = "/smslogin", method = RequestMethod.POST)
-    public ResponseEntity SmsLogin(@RequestBody JSONObject data) {
-        ResponseEntity responseEntity = null;
-        HashMap map = new HashMap();
-        try {
-                    String telephoneNo = data.getString("telephoneNo");
-                    String smsCode = data.getString("smsCode");
-            //判断手机号格式是否正确
-            if (PhoneFormatCheckUtils.isChinaPhoneLegal(telephoneNo) == true) {
-                //依据手机号,从redis中取出code
-//                String code1 = redisUtil.get(telephoneNo);
-                String code1 = map1.get(telephoneNo).toString();
-                System.out.println(code1+"map存储获取的验证码");
-                if (code1.equals(smsCode)){
-                //执行登录操作
-                User user = jzPeiXunService.getUserInfoByTelePhone(telephoneNo);
-                if (user.equals(null)) {
-                    //注册用户 ---- 兼职教师登录
-                    jzPeiXunService.addUser(telephoneNo);
-                    jzPeiXunService.authLogin(telephoneNo, smsCode);
-                } else {
-                    //直接登录 --- 已注册兼职教师后者管理员登录
-                    jzPeiXunService.authLogin(telephoneNo, smsCode);
-                }
-                }
-            }
-        } catch (Exception e) {
-            e.printStackTrace();
-            return new ResponseEntity().failure("404", "登录失败");
-        }
-        System.out.println("登录成功");
-        return new ResponseEntity().success("505", "登录成功");
-    }
-
-
-    //3.用户退出
-    @RequestMapping(value = "/logout", method = RequestMethod.POST)
-    public ResponseEntity logout() {
-        try {
-            jzPeiXunService.logout();
-        } catch (Exception e) {
-            e.printStackTrace();
-            return new ResponseEntity().failure("fail", "退出失败");
-        }
-        return new ResponseEntity().success("logoutSuccess", "退出成功");
-    }
-
-    //4. 编辑用户资料
-    @RequestMapping(value = "/editUser", method = RequestMethod.POST)
-    public ResponseEntity editUser(@RequestBody JSONObject data) {
-        try {
-            if (data.equals(null)) {
-                return new ResponseEntity().failure("404", "输入信息为空", "");
-            }
-            User user = new User();
-//         String telephoneNo = data.getString("telephoneNo");
-            String name = data.getString("name");
-            String email = data.getString("email");
-            String sex = data.getString("sex");
-            String age = data.getString("age");
-            String correctingsub = data.getString("correctingsub");
-
-            Integer typeofjob = Integer.parseInt(data.getString("typeofjob"));
-            String createtime = data.getString("createtime");
-            Integer userstate = Integer.parseInt(data.getString("userstate"));
-            String area = data.getString("area");
-            Integer id = data.getInteger("id");
-
-            user.setName(name);
-            user.setEmail(email);
-            user.setSex(sex);
-            user.setAge(age);
-            user.setCorrectingsub(correctingsub);
-            user.setTypeofjob(typeofjob);
-            user.setUserstate(userstate);
-            user.setArea(area);
-            user.setId(id);
-            jzPeiXunService.updateUser(user);
-        } catch (Exception e) {
-            e.printStackTrace();
-        }
-        return new ResponseEntity().success("", "用户资料编辑成功");
-    }
-
-    //4. 获取用户个人资料
-    @RequestMapping(value = "/getUserInfo", method = RequestMethod.POST)
-    public ResponseEntity selectUserInfo(@RequestBody JSONObject data) {
-        User user = null;
-        if (data.equals(null)) {
-            return new ResponseEntity().failure("404", "输入信息为空", "");
-        }
-        try {
-            Integer userId = data.getInteger("userid");
-            user = jzPeiXunService.getUserInfo(userId);
-        } catch (Exception e) {
-            e.printStackTrace();
-        }
-        return new ResponseEntity().success(user, "获取用户资料成功");
-    }
-
-
-    //5. 教师状态获取,正在学习,考试中,已考试,考试通过,考试未通过等;
-    @RequestMapping(value = "/getLearnTeacherStauts", method = RequestMethod.POST)
-    public List<User> getLearnTeacherStauts(@RequestBody JSONObject data) {
-        List<User> list = null;
-        try {
-            Integer userState = data.getInteger("userstate");
-            list = jzPeiXunService.getLearnTeacher(userState);
-        } catch (Exception e) {
-            e.printStackTrace();
-        }
-        return list;
-    }
-
-
-
-    //6. 兼职教师获取考试试卷
-    @RequestMapping(value = "/getexaminationData", method = RequestMethod.POST)
-    public examination getexaminationData(@RequestBody JSONObject data) {
-
-        examination examination = null;
-        try {
-            String subject = data.get("subject").toString();
-            examination = jzPeiXunService.getexam(subject);
-        } catch (Exception e) {
-            e.printStackTrace();
-        }
-        return examination;
-    }
-
-
-    //7.兼职教师依据做考试试卷
-//    @RequestMapping(value = "/dotexam", method = RequestMethod.POST)
-//    public examination dotexaminationData(@RequestBody JSONObject data) {
-//
-//        try{
-//            String userid = data.getString("userid");
-//            String
-//
-//
-//        }catch (Exception e){
-//
-//        }
-//
-//    }
-//
-//
-//    //8. 系统管理员阅卷
-//    @RequestMapping(value = "/checkexam", method = RequestMethod.POST)
-//    public examination checkexaminationData(@RequestBody JSONObject data) {
-//
-//
-//    }
-
-
-
-
-}
-
-
-
-

+ 0 - 37
src/main/java/com/aijia/peixun/dao/FileMapper.java

@@ -1,37 +0,0 @@
-package com.aijia.peixun.dao;
-
-import com.aijia.peixun.entity.File;
-import org.apache.ibatis.annotations.Mapper;
-import org.apache.ibatis.annotations.ResultMap;
-import org.apache.ibatis.annotations.Select;
-
-import java.util.List;
-
-@Mapper
-public interface FileMapper {
-    int deleteByPrimaryKey(Integer id);
-
-    int insert(File record);
-
-    int insertSelective(File record);
-
-    File selectByPrimaryKey(Integer id);
-
-    int updateByPrimaryKeySelective(File record);
-
-    int updateByPrimaryKey(File record);
-
-    //新增:依据文件类别获取文件List
-    @Select("select id," + "filename," + "filetype," + "uploadetime," + "uploadeuser," + "filestate,"
-            +"backup1,"+"backup2,"+"backup3,"+ "backup4," +"filestate,"+" backup5 from jianzhi_peixun_file where filetype = #{filetype}")
-    @ResultMap("BaseResultMap")
-    List<File> selectbyUserType (Integer filetype);
-
-
-
-    //新增:依据用户id获取文件List
-    @Select("select id," + "filename," + "filetype," + "uploadetime," + "uploadeuser," + "filestate,"
-            +"backup1,"+"backup2,"+"backup3,"+ "backup4," +"filestate,"+" backup5 from jianzhi_peixun_file where uploadeuser = #{uploadeuser}")
-    @ResultMap("BaseResultMap")
-    List<File> selectbyUploadeType (String uploadeuser);
-}

+ 0 - 43
src/main/java/com/aijia/peixun/dao/UserMapper.java

@@ -1,43 +0,0 @@
-package com.aijia.peixun.dao;
-
-import com.aijia.peixun.entity.File;
-import com.aijia.peixun.entity.User;
-import org.apache.ibatis.annotations.Mapper;
-import org.apache.ibatis.annotations.ResultMap;
-import org.apache.ibatis.annotations.Select;
-
-import java.util.List;
-
-@Mapper
-public interface UserMapper {
-    int deleteByPrimaryKey(Integer id);
-
-    int insert(User record);
-
-    int insertSelective(User record);
-
-    User selectByPrimaryKey(Integer id);
-
-    int updateByPrimaryKeySelective(User record);
-
-    int updateByPrimaryKey(User record);
-
-
-    //1.新增:依据电话号码找用户对象
-    @Select("select id," + "name," + "telephoneNo," + "email," + "sex," + "age,"
-            +"correctingsub,"+"typeofjob,"+"createtime,"+ "userstate," +"area,"+
-            "typeofuser,"+"examinetime,"+"examinenum,"+ "backup1,"+"backup2,"+"backup3,"+"backup4,"+
-            " backup5 from jianzhi_peixun_user where telephoneNo = #{telephoneNo}")
-    @ResultMap("BaseResultMap")
-    public User selectByTelephone(String telephoneNo);
-
-
-    //2.新增:依据用户状态用户List
-    @Select("select id," + "name," + "telephoneNo," + "email," + "sex," + "age,"
-            +"correctingsub,"+"typeofjob,"+"createtime,"+ "userstate," +"area,"+
-            "typeofuser,"+"examinetime,"+"examinenum,"+ "backup1,"+"backup2,"+"backup3,"+"backup4,"+
-            " backup5 from jianzhi_peixun_user where userstate = #{userstate}")
-    @ResultMap("BaseResultMap")
-    public List<User> selectbyUserState(Integer userstate);
-
-}

+ 0 - 34
src/main/java/com/aijia/peixun/dao/examinationMapper.java

@@ -1,34 +0,0 @@
-package com.aijia.peixun.dao;
-
-import com.aijia.peixun.entity.User;
-import com.aijia.peixun.entity.examination;
-import org.apache.ibatis.annotations.Mapper;
-import org.apache.ibatis.annotations.ResultMap;
-import org.apache.ibatis.annotations.Select;
-
-import java.util.List;
-
-@Mapper
-public interface examinationMapper {
-    int deleteByPrimaryKey(String id);
-
-    int insert(examination record);
-
-    int insertSelective(examination record);
-
-    examination selectByPrimaryKey(String id);
-
-    int updateByPrimaryKeySelective(examination record);
-
-    int updateByPrimaryKey(examination record);
-
-
-    //1.新增:依据科目找考试试题内容
-    @Select("select id," + "user_id," + "grade," + "subject," + "version," + "name,"
-            +"pdf_without_answer_url,"+"pdf_with_answer_url,"+"status,"+ "description," +"answer_time,"+
-            "deleted,"+"update_time,"+"create_time from tb_examination_paper where subject = #{subject}")
-    @ResultMap("BaseResultMap")
-     public examination getExaminationData(String subject);
-
-
-}

+ 0 - 131
src/main/java/com/aijia/peixun/entity/File.java

@@ -1,131 +0,0 @@
-package com.aijia.peixun.entity;
-
-public class File {
-    private Integer id;
-
-    private String filename;
-
-    private Integer filetype;
-
-    private String uploadetime;
-
-    private String uploadeuser;
-
-    private Integer filestate;
-
-    private String backup1;
-
-    private String backup2;
-
-    private String backup3;
-
-    private String backup4;
-
-    private String backup5;
-
-    public File(Integer id, String filename, Integer filetype, String uploadetime, String uploadeuser, Integer filestate, String backup1, String backup2, String backup3, String backup4, String backup5) {
-        this.id = id;
-        this.filename = filename;
-        this.filetype = filetype;
-        this.uploadetime = uploadetime;
-        this.uploadeuser = uploadeuser;
-        this.filestate = filestate;
-        this.backup1 = backup1;
-        this.backup2 = backup2;
-        this.backup3 = backup3;
-        this.backup4 = backup4;
-        this.backup5 = backup5;
-    }
-
-    public File() {
-        super();
-    }
-
-    public Integer getId() {
-        return id;
-    }
-
-    public void setId(Integer id) {
-        this.id = id;
-    }
-
-    public String getFilename() {
-        return filename;
-    }
-
-    public void setFilename(String filename) {
-        this.filename = filename == null ? null : filename.trim();
-    }
-
-    public Integer getFiletype() {
-        return filetype;
-    }
-
-    public void setFiletype(Integer filetype) {
-        this.filetype = filetype;
-    }
-
-    public String getUploadetime() {
-        return uploadetime;
-    }
-
-    public void setUploadetime(String uploadetime) {
-        this.uploadetime = uploadetime == null ? null : uploadetime.trim();
-    }
-
-    public String getUploadeuser() {
-        return uploadeuser;
-    }
-
-    public void setUploadeuser(String uploadeuser) {
-        this.uploadeuser = uploadeuser == null ? null : uploadeuser.trim();
-    }
-
-    public Integer getFilestate() {
-        return filestate;
-    }
-
-    public void setFilestate(Integer filestate) {
-        this.filestate = filestate;
-    }
-
-    public String getBackup1() {
-        return backup1;
-    }
-
-    public void setBackup1(String backup1) {
-        this.backup1 = backup1 == null ? null : backup1.trim();
-    }
-
-    public String getBackup2() {
-        return backup2;
-    }
-
-    public void setBackup2(String backup2) {
-        this.backup2 = backup2 == null ? null : backup2.trim();
-    }
-
-    public String getBackup3() {
-        return backup3;
-    }
-
-    public void setBackup3(String backup3) {
-        this.backup3 = backup3 == null ? null : backup3.trim();
-    }
-
-    public String getBackup4() {
-        return backup4;
-    }
-
-    public void setBackup4(String backup4) {
-        this.backup4 = backup4 == null ? null : backup4.trim();
-    }
-
-    public String getBackup5() {
-        return backup5;
-    }
-
-    public void setBackup5(String backup5) {
-        this.backup5 = backup5 == null ? null : backup5.trim();
-    }
-}

+ 0 - 221
src/main/java/com/aijia/peixun/entity/User.java

@@ -1,221 +0,0 @@
-package com.aijia.peixun.entity;
-
-import java.util.Date;
-
-public class User {
-    private Integer id;
-
-    private String name;
-
-    private String telephoneno;
-
-    private String email;
-
-    private String sex;
-
-    private String age;
-
-    private String correctingsub;
-
-    private Integer typeofjob;
-
-    private Date createtime;
-
-    private Integer userstate;
-
-    private String area;
-
-    private Integer typeofuser;
-
-    private Date examinetime;
-
-    private Integer examinenum;
-
-    private String backup1;
-
-    private String backup2;
-
-    private String backup3;
-
-    private String backup4;
-
-    private String backup5;
-
-    public User(Integer id, String name, String telephoneno, String email, String sex, String age, String correctingsub, Integer typeofjob, Date createtime, Integer userstate, String area, Integer typeofuser, Date examinetime, Integer examinenum, String backup1, String backup2, String backup3, String backup4, String backup5) {
-        this.id = id;
-        this.name = name;
-        this.telephoneno = telephoneno;
-        this.email = email;
-        this.sex = sex;
-        this.age = age;
-        this.correctingsub = correctingsub;
-        this.typeofjob = typeofjob;
-        this.createtime = createtime;
-        this.userstate = userstate;
-        this.area = area;
-        this.typeofuser = typeofuser;
-        this.examinetime = examinetime;
-        this.examinenum = examinenum;
-        this.backup1 = backup1;
-        this.backup2 = backup2;
-        this.backup3 = backup3;
-        this.backup4 = backup4;
-        this.backup5 = backup5;
-    }
-
-    public User() {
-        super();
-    }
-
-    public Integer getId() {
-        return id;
-    }
-
-    public void setId(Integer id) {
-        this.id = id;
-    }
-
-    public String getName() {
-        return name;
-    }
-
-    public void setName(String name) {
-        this.name = name == null ? null : name.trim();
-    }
-
-    public String getTelephoneno() {
-        return telephoneno;
-    }
-
-    public void setTelephoneno(String telephoneno) {
-        this.telephoneno = telephoneno == null ? null : telephoneno.trim();
-    }
-
-    public String getEmail() {
-        return email;
-    }
-
-    public void setEmail(String email) {
-        this.email = email == null ? null : email.trim();
-    }
-
-    public String getSex() {
-        return sex;
-    }
-
-    public void setSex(String sex) {
-        this.sex = sex == null ? null : sex.trim();
-    }
-
-    public String getAge() {
-        return age;
-    }
-
-    public void setAge(String age) {
-        this.age = age == null ? null : age.trim();
-    }
-
-    public String getCorrectingsub() {
-        return correctingsub;
-    }
-
-    public void setCorrectingsub(String correctingsub) {
-        this.correctingsub = correctingsub == null ? null : correctingsub.trim();
-    }
-
-    public Integer getTypeofjob() {
-        return typeofjob;
-    }
-
-    public void setTypeofjob(Integer typeofjob) {
-        this.typeofjob = typeofjob;
-    }
-
-    public Date getCreatetime() {
-        return createtime;
-    }
-
-    public void setCreatetime(Date createtime) {
-        this.createtime = createtime;
-    }
-
-    public Integer getUserstate() {
-        return userstate;
-    }
-
-    public void setUserstate(Integer userstate) {
-        this.userstate = userstate;
-    }
-
-    public String getArea() {
-        return area;
-    }
-
-    public void setArea(String area) {
-        this.area = area == null ? null : area.trim();
-    }
-
-    public Integer getTypeofuser() {
-        return typeofuser;
-    }
-
-    public void setTypeofuser(Integer typeofuser) {
-        this.typeofuser = typeofuser;
-    }
-
-    public Date getExaminetime() {
-        return examinetime;
-    }
-
-    public void setExaminetime(Date examinetime) {
-        this.examinetime = examinetime;
-    }
-
-    public Integer getExaminenum() {
-        return examinenum;
-    }
-
-    public void setExaminenum(Integer examinenum) {
-        this.examinenum = examinenum;
-    }
-
-    public String getBackup1() {
-        return backup1;
-    }
-
-    public void setBackup1(String backup1) {
-        this.backup1 = backup1 == null ? null : backup1.trim();
-    }
-
-    public String getBackup2() {
-        return backup2;
-    }
-
-    public void setBackup2(String backup2) {
-        this.backup2 = backup2 == null ? null : backup2.trim();
-    }
-
-    public String getBackup3() {
-        return backup3;
-    }
-
-    public void setBackup3(String backup3) {
-        this.backup3 = backup3 == null ? null : backup3.trim();
-    }
-
-    public String getBackup4() {
-        return backup4;
-    }
-
-    public void setBackup4(String backup4) {
-        this.backup4 = backup4 == null ? null : backup4.trim();
-    }
-
-    public String getBackup5() {
-        return backup5;
-    }
-
-    public void setBackup5(String backup5) {
-        this.backup5 = backup5 == null ? null : backup5.trim();
-    }
-}

+ 0 - 178
src/main/java/com/aijia/peixun/entity/examination.java

@@ -1,178 +0,0 @@
-package com.aijia.peixun.entity;
-
-import java.util.Date;
-
-public class examination {
-    private String id;
-
-    private String userId;
-
-    private String grade;
-
-    private String subject;
-
-    private Byte version;
-
-    private String name;
-
-    private String pdfWithoutAnswerUrl;
-
-    private String pdfWithAnswerUrl;
-
-    private Byte status;
-
-    private String description;
-
-    private Byte answerTime;
-//    private int answerTime;
-
-    private Boolean deleted;
-
-    private Date updateTime;
-
-    private Date createTime;
-
-    public examination(String id, String userId, String grade, String subject, Byte version, String name, String pdfWithoutAnswerUrl, String pdfWithAnswerUrl, Byte status, String description,
-                       Byte answerTime,
-//                       int answerTime,
-                       Boolean deleted, Date updateTime, Date createTime) {
-        this.id = id;
-        this.userId = userId;
-        this.grade = grade;
-        this.subject = subject;
-        this.version = version;
-        this.name = name;
-        this.pdfWithoutAnswerUrl = pdfWithoutAnswerUrl;
-        this.pdfWithAnswerUrl = pdfWithAnswerUrl;
-        this.status = status;
-        this.description = description;
-        this.answerTime = answerTime;
-        this.deleted = deleted;
-        this.updateTime = updateTime;
-        this.createTime = createTime;
-    }
-
-    public examination() {
-        super();
-    }
-
-    public String getId() {
-        return id;
-    }
-
-    public void setId(String id) {
-        this.id = id == null ? null : id.trim();
-    }
-
-    public String getUserId() {
-        return userId;
-    }
-
-    public void setUserId(String userId) {
-        this.userId = userId == null ? null : userId.trim();
-    }
-
-    public String getGrade() {
-        return grade;
-    }
-
-    public void setGrade(String grade) {
-        this.grade = grade == null ? null : grade.trim();
-    }
-
-    public String getSubject() {
-        return subject;
-    }
-
-    public void setSubject(String subject) {
-        this.subject = subject == null ? null : subject.trim();
-    }
-
-    public Byte getVersion() {
-        return version;
-    }
-
-    public void setVersion(Byte version) {
-        this.version = version;
-    }
-
-    public String getName() {
-        return name;
-    }
-
-    public void setName(String name) {
-        this.name = name == null ? null : name.trim();
-    }
-
-    public String getPdfWithoutAnswerUrl() {
-        return pdfWithoutAnswerUrl;
-    }
-
-    public void setPdfWithoutAnswerUrl(String pdfWithoutAnswerUrl) {
-        this.pdfWithoutAnswerUrl = pdfWithoutAnswerUrl == null ? null : pdfWithoutAnswerUrl.trim();
-    }
-
-    public String getPdfWithAnswerUrl() {
-        return pdfWithAnswerUrl;
-    }
-
-    public void setPdfWithAnswerUrl(String pdfWithAnswerUrl) {
-        this.pdfWithAnswerUrl = pdfWithAnswerUrl == null ? null : pdfWithAnswerUrl.trim();
-    }
-
-    public Byte getStatus() {
-        return status;
-    }
-
-    public void setStatus(Byte status) {
-        this.status = status;
-    }
-
-    public String getDescription() {
-        return description;
-    }
-
-    public void setDescription(String description) {
-        this.description = description == null ? null : description.trim();
-    }
-
-    public Byte getAnswerTime() {
-        return answerTime;
-    }
-//    public int getAnswerTime() {
-//        return answerTime;
-//    }
-
-
-    public void setAnswerTime(Byte answerTime) {
-        this.answerTime = answerTime;
-    }
-
-//    public void setAnswerTime(int answerTime) {
-//        this.answerTime = answerTime;
-//    }
-
-    public Boolean getDeleted() {
-        return deleted;
-    }
-
-    public void setDeleted(Boolean deleted) {
-        this.deleted = deleted;
-    }
-
-    public Date getUpdateTime() {
-        return updateTime;
-    }
-
-    public void setUpdateTime(Date updateTime) {
-        this.updateTime = updateTime;
-    }
-
-    public Date getCreateTime() {
-        return createTime;
-    }
-
-    public void setCreateTime(Date createTime) {
-        this.createTime = createTime;
-    }
-}

+ 0 - 25
src/main/java/com/aijia/peixun/service/JzFileService.java

@@ -1,25 +0,0 @@
-package com.aijia.peixun.service;
-
-import com.aijia.peixun.entity.File;
-import com.aijia.peixun.utils.ResponseEntity;
-import com.aijia.peixun.vo.MultipartFileParam;
-import org.springframework.web.multipart.MultipartFile;
-
-import java.io.IOException;
-import java.util.List;
-
-public interface JzFileService {
-
-   //1. 上传信息数据保存
-    public void SaveFileData(File file) throws Exception;
-
-   //2. 依据文件id,获取文件
-    public File GetFileData(Integer id) throws Exception;
-
-    //3.依据兼职教师类型获取对应的资料
-    public List<File> GetFileByType(Integer filetype) throws Exception;
-
-    //4.依据UserId,获取文件List
-    public List<File> GetFileDataList(String userId) throws Exception;
-
-}

+ 0 - 70
src/main/java/com/aijia/peixun/service/JzFileServiceImpl.java

@@ -1,70 +0,0 @@
-package com.aijia.peixun.service;
-
-import com.aijia.peixun.dao.FileMapper;
-import com.aijia.peixun.entity.File;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.stereotype.Service;
-
-import java.util.ArrayList;
-import java.util.List;
-
-
-@Service
-public class JzFileServiceImpl implements JzFileService {
-
-    @Autowired
-    FileMapper fileMapper;
-
-    //1. 上传信息数据保存
-    @Override
-    public void SaveFileData(File file) throws Exception{
-
-        try {
-        fileMapper.insert(file);
-        }catch (Exception e){
-            e.printStackTrace();
-        }
-    }
-
-    //2. 依据文件id,获取文件
-    @Override
-    public File GetFileData(Integer id) throws Exception{
-          File file = new File();
-        try {
-            file = fileMapper.selectByPrimaryKey(id);
-        }catch (Exception e){
-            e.printStackTrace();
-        }
-        return file;
-    }
-
-    //3.依据兼职教师类型获取对应的资料
-    @Override
-    public List<File> GetFileByType(Integer filetype) throws Exception{
-
-        List<File> list = new ArrayList();
-        try {
-            list = fileMapper.selectbyUserType(filetype);
-        }catch (Exception e){
-            e.printStackTrace();
-        }
-        return list;
-    }
-
-    //4.依据UserId
-    @Override
-    public List<File> GetFileDataList(String userId) throws Exception{
-        List<File> list = new ArrayList();
-        try {
-            //依据userId查询List
-            list = fileMapper.selectbyUploadeType(userId);
-        }catch (Exception e){
-            e.printStackTrace();
-
-        }
-          return list;
-    }
-
-
-
-}

+ 0 - 27
src/main/java/com/aijia/peixun/service/JzPeiXunService.java

@@ -1,27 +0,0 @@
-package com.aijia.peixun.service;
-
-import com.aijia.peixun.entity.User;
-import com.aijia.peixun.entity.examination;
-import com.aijia.peixun.utils.ResponseEntity;
-
-import java.util.List;
-
-public interface JzPeiXunService {
-    //1.用户登录
-    public ResponseEntity authLogin(String telephoneNo,String smsCode) throws Exception;
-    //2.根据手机号码找到用户信息
-    public User getUserInfoByTelePhone(String telephoneNo) throws Exception;
-    //3.用户退出
-    public ResponseEntity logout() throws Exception;
-    //4.新增用户信息
-    public ResponseEntity addUser(String telephoneNo) throws Exception;
-    //5.编辑用户信息
-    public ResponseEntity updateUser(User user) throws Exception;
-    //6.获取用户资料信息
-    public User getUserInfo(Integer userid) throws Exception;
-    //7.获取正在学习教师
-    public List<User> getLearnTeacher(Integer userState) throws Exception;
-    //8.依据科目获取
-    public examination getexam(String subject) throws Exception;
-
-}

+ 0 - 147
src/main/java/com/aijia/peixun/service/JzPeiXunServiceImpl.java

@@ -1,147 +0,0 @@
-package com.aijia.peixun.service;
-
-import com.aijia.peixun.dao.UserMapper;
-import com.aijia.peixun.dao.examinationMapper;
-import com.aijia.peixun.entity.User;
-import com.aijia.peixun.entity.examination;
-import com.aijia.peixun.utils.ResponseEntity;
-import com.google.gson.JsonObject;
-import org.apache.shiro.SecurityUtils;
-import org.apache.shiro.authc.UsernamePasswordToken;
-import org.apache.shiro.subject.Subject;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.stereotype.Service;
-
-import java.util.List;
-
-@Service
-public class JzPeiXunServiceImpl implements JzPeiXunService{
-
-    @Autowired
-    private UserMapper userMapper;
-    @Autowired
-    private examinationMapper examinationMapper;
-
-    //1.用户登录
-    @Override
-    public ResponseEntity authLogin(String telephoneNo, String smsCode) throws Exception{
-
-        UsernamePasswordToken token = null;
-
-        System.out.println("---------开始注册登录-------");
-
-        try{
-            JsonObject object = new JsonObject();
-            Subject currentUser = SecurityUtils.getSubject();
-            //手机号+SmsCode 封装成 UsernamePasswordToken 对象;
-            token = new UsernamePasswordToken(telephoneNo,smsCode);
-            System.out.println(token);
-            //执行登录
-            currentUser.login(token);
-        }catch (Exception e){
-            e.printStackTrace();
-        }
-        System.out.println("--------Shiro----执行登录成功------");
-        return new ResponseEntity().success("result","success");
-    }
-
-    @Override
-    public User getUserInfoByTelePhone(String telephoneNo) throws Exception{
-        User user = null;
-        try {
-            //依据电话号码查询用户对象
-            user = userMapper.selectByTelephone(telephoneNo);
-        }catch (Exception e){
-            e.printStackTrace();
-        }
-        return user;
-    }
-
-    //3.用户退出
-    @Override
-    public ResponseEntity logout() throws Exception{
-        try {
-            Subject currentUser = SecurityUtils.getSubject();
-            currentUser.logout();
-        } catch (Exception e) {
-        }
-        return new ResponseEntity().success("success","退出成功");
-    }
-
-    //4. 增加用户
-    @Override
-    public ResponseEntity addUser(String telephoneNo) throws Exception{
-        try {
-            User user = new User();
-            user.setTelephoneno(telephoneNo);
-            userMapper.insert(user);
-        }catch (Exception e){
-            e.printStackTrace();
-            return new ResponseEntity().failure("新增用户失败");
-        }
-        return new ResponseEntity().success("新增用户成功");
-    }
-
-    //5.编辑用户信息
-    @Override
-    public ResponseEntity updateUser(User user) throws Exception{
-        try {
-//            int result = userMapper.updateByPrimaryKey(user);
-            int result = userMapper.updateByPrimaryKeySelective(user);
-            System.out.println(result);
-        }catch (Exception e){
-            e.printStackTrace();
-        }
-        return new ResponseEntity().success("","用户资料编辑成功");
-    }
-
-    //6.获取用户资料信息
-    @Override
-    public User getUserInfo(Integer userid) throws Exception{
-        User user =null;
-        try {
-            user=userMapper.selectByPrimaryKey(userid);
-        }catch (Exception e){
-            e.printStackTrace();
-        }
-        return user;
-    }
-
-    //7.获取正在学习教师状态
-    @Override
-    public List<User> getLearnTeacher(Integer userState) throws Exception{
-        List<User> list =null;
-        try {
-            list = userMapper.selectbyUserState(userState);
-        }catch (Exception e){
-            e.printStackTrace();
-        }
-        return list;
-    }
-
-    //8.兼职教师依据科目获取考试试卷
-    @Override
-    public examination getexam(String subject) throws Exception{
-
-        examination examination = null;
-        try{
-           examination = examinationMapper.getExaminationData(subject);
-        }catch (Exception e){
-            e.printStackTrace();
-        }
-         return examination;
-    }
-
-
-    //9.兼职教师依据做考试试卷
-
-
-
-
-
-    //10. 系统管理员阅卷
-
-
-
-
-}

+ 0 - 163
src/main/java/com/aijia/peixun/utils/AliyunSmsUtil.java

@@ -1,163 +0,0 @@
-package com.aijia.peixun.utils;
-
-import com.aliyuncs.DefaultAcsClient;
-import com.aliyuncs.IAcsClient;
-import com.aliyuncs.dysmsapi.model.v20170525.QuerySendDetailsRequest;
-import com.aliyuncs.dysmsapi.model.v20170525.QuerySendDetailsResponse;
-import com.aliyuncs.dysmsapi.model.v20170525.SendSmsRequest;
-import com.aliyuncs.dysmsapi.model.v20170525.SendSmsResponse;
-import com.aliyuncs.exceptions.ClientException;
-import com.aliyuncs.profile.DefaultProfile;
-import com.aliyuncs.profile.IClientProfile;
-
-import java.text.SimpleDateFormat;
-import java.util.Date;
-import java.util.Random;
-
-/**
- * 阿里云短信服务工具类
- * @author Mount Liu
- * @date 2018/9/19
- */
-
-public class AliyunSmsUtil {
-    //产品名称:云通信短信API产品,开发者无需替换
-    static final String product = "Dysmsapi";
-    //产品域名,开发者无需替换
-    static final String domain = "dysmsapi.aliyuncs.com";
-
-    // TODO 此处需要替换成开发者自己的AK(在阿里云访问控制台寻找)
-    static final String accessKeyId = "LTAIvFRB8Hf45wjd";
-    static final String accessKeySecret = "BW01drLwzxPHQhJIs9xa8LROcoddq0";
-
-    /**
-     * 发送短信
-     * @param phoneNumber
-     * @param code 验证码
-     * @param templateCode 短信模板
-     * @return
-     * @throws ClientException
-     */
-    public static SendSmsResponse sendSms(String phoneNumber, String code, String templateCode) throws ClientException {
-
-        //可自助调整超时时间
-        System.setProperty("sun.net.client.defaultConnectTimeout", "10000");
-        System.setProperty("sun.net.client.defaultReadTimeout", "10000");
-
-        //初始化acsClient,暂不支持region化
-        IClientProfile profile = DefaultProfile.getProfile("cn-hangzhou", accessKeyId, accessKeySecret);
-        DefaultProfile.addEndpoint("cn-hangzhou", "cn-hangzhou", product, domain);
-        IAcsClient acsClient = new DefaultAcsClient(profile);
-
-        //组装请求对象-具体描述见控制台-文档部分内容
-        SendSmsRequest request = new SendSmsRequest();
-        //必填:待发送手机号
-        request.setPhoneNumbers(phoneNumber);
-        //必填:短信签名-可在短信控制台中找到
-        request.setSignName("私塾家");
-        //必填:短信模板-可在短信控制台中找到
-        request.setTemplateCode(templateCode);
-        //可选:模板中的变量替换JSON串,如模板内容为"亲爱的${name},您的验证码为${code}"时,此处的值为
-        if(StringUtil.isNotBlank(code)){
-            request.setTemplateParam("{\"code\":\""+code+"\"}");
-        }else{
-            request.setTemplateParam("{\"code\":\""+getRandNum()+"\"}");
-        }
-
-        //选填-上行短信扩展码(无特殊需求用户请忽略此字段)
-        //request.setSmsUpExtendCode("90997");
-
-        //可选:outId为提供给业务方扩展字段,最终在短信回执消息中将此值带回给调用者
-        request.setOutId("yourOutId");
-
-        //hint 此处可能会抛出异常,注意catch
-        SendSmsResponse sendSmsResponse = acsClient.getAcsResponse(request);
-
-        return sendSmsResponse;
-    }
-
-    /**
-     * 短信明细查询
-     * @param bizId
-     * @param phoneNumber
-     * @return
-     * @throws ClientException
-     */
-    public static QuerySendDetailsResponse querySendDetails(String bizId, String phoneNumber) throws ClientException {
-
-        //可自助调整超时时间
-        System.setProperty("sun.net.client.defaultConnectTimeout", "10000");
-        System.setProperty("sun.net.client.defaultReadTimeout", "10000");
-
-        //初始化acsClient,暂不支持region化
-        IClientProfile profile = DefaultProfile.getProfile("cn-hangzhou", accessKeyId, accessKeySecret);
-        DefaultProfile.addEndpoint("cn-hangzhou", "cn-hangzhou", product, domain);
-        IAcsClient acsClient = new DefaultAcsClient(profile);
-
-        //组装请求对象
-        QuerySendDetailsRequest request = new QuerySendDetailsRequest();
-        //必填-号码
-        request.setPhoneNumber(phoneNumber);
-        //可选-流水号
-        request.setBizId(bizId);
-        //必填-发送日期 支持30天内记录查询,格式yyyyMMdd
-        SimpleDateFormat ft = new SimpleDateFormat("yyyyMMdd");
-        request.setSendDate(ft.format(new Date()));
-        //必填-页大小
-        request.setPageSize(10L);
-        //必填-当前页码从1开始计数
-        request.setCurrentPage(1L);
-
-        //hint 此处可能会抛出异常,注意catch
-        QuerySendDetailsResponse querySendDetailsResponse = acsClient.getAcsResponse(request);
-
-        return querySendDetailsResponse;
-    }
-
-    /**
-     * 生成6位随机数
-     * @return
-     */
-    public static String getRandNum() {
-        String randNum = new Random().nextInt(1000000) + "";
-        //如果生成的不是6位数随机数则返回该方法继续生成
-        if (randNum.length() != 6) {
-            return getRandNum();
-        }
-        return randNum;
-    }
-
-    public static void main(String[] args) throws ClientException, InterruptedException {
-        //发短信
-        SendSmsResponse response = sendSms("18611015740",null,null);
-        System.out.println("短信接口返回的数据----------------");
-        System.out.println("Code=" + response.getCode());
-        System.out.println("Message=" + response.getMessage());
-        System.out.println("RequestId=" + response.getRequestId());
-        System.out.println("BizId=" + response.getBizId());
-        Thread.sleep(3000L);
-        //查明细
-        if (response.getCode() != null && response.getCode().equals("OK")) {
-            QuerySendDetailsResponse querySendDetailsResponse = querySendDetails(response.getBizId(), "18611015740");
-            System.out.println("短信明细查询接口返回数据----------------");
-            System.out.println("Code=" + querySendDetailsResponse.getCode());
-            System.out.println("Message=" + querySendDetailsResponse.getMessage());
-            int i = 0;
-            for (QuerySendDetailsResponse.SmsSendDetailDTO smsSendDetailDTO : querySendDetailsResponse.getSmsSendDetailDTOs()) {
-                System.out.println("SmsSendDetailDTO[" + i + "]:");
-                System.out.println("Content=" + smsSendDetailDTO.getContent());
-                System.out.println("ErrCode=" + smsSendDetailDTO.getErrCode());
-                System.out.println("OutId=" + smsSendDetailDTO.getOutId());
-                System.out.println("PhoneNum=" + smsSendDetailDTO.getPhoneNum());
-                System.out.println("ReceiveDate=" + smsSendDetailDTO.getReceiveDate());
-                System.out.println("SendDate=" + smsSendDetailDTO.getSendDate());
-                System.out.println("SendStatus=" + smsSendDetailDTO.getSendStatus());
-                System.out.println("Template=" + smsSendDetailDTO.getTemplateCode());
-            }
-            System.out.println("TotalCount=" + querySendDetailsResponse.getTotalCount());
-            System.out.println("RequestId=" + querySendDetailsResponse.getRequestId());
-        }
-    }
-
-
-}

+ 0 - 383
src/main/java/com/aijia/peixun/utils/Constant.java

@@ -1,383 +0,0 @@
-package com.aijia.peixun.utils;
-
-import java.util.*;
-
-public class Constant {
-
-    /**
-     * 作业批注超时时间,30分钟
-     */
-    public static final int HOME_WORK_OUTTIME = 30;
-
-    /**
-     * 难题解答超时时间,20分钟
-     */
-    public static final int PROBLEM_OUTTIME = 20;
-
-    /**
-     * tb_lib_manager中校长的类别
-     */
-    public static final int SCHOOL_MASTER_TYPE = 6;
-
-    /**
-     * tb_lib_manager中馆长的类别
-     */
-    public static final int CURATOR = 4;
-
-    /**
-     * tb_lib_manager中在馆老师的类别
-     */
-    public static final int TEACHER_TYPE = 2;
-
-    /**
-     * tb_lib_manager一对一的老师类别
-     */
-    public static final int KMT_121_TEACHER_TYPE = 7;
-
-    /**
-     * tb_lib_manager中线上老师,和kmt 的老师
-     */
-    public static final int KMT_122_TEACHER_TYPE = 8;
-
-    /**
-     * tb_lib_manager小课老师的type
-     */
-    public static final int GROUP_TEACHER_TYPE = 9;
-
-    /**
-     * tb_lib_manager中学科老师的类别
-     */
-    public static final int ORG_TEACHER_TYPE = 10;
-
-    /**
-     * tb_lib_manager中管理员的类别
-     */
-    public static final int CORRECT_MANAGER = 11;
-
-    /**
-     * tb_lib_manager中批注质检员的类别
-     */
-    public static final int CORRECT_CHECKER = 50;
-
-
-    /**
-     * tb_lib_manager中超级管理员的类别
-     */
-    public static final int CORRECT_SUPER_MANAGER = 12;
-
-    /**
-     * tb_lib_manager中匹配知识点老师的类别
-     */
-    public static final int KNOW_MATCH_TYPE = 13;
-
-    /**
-     * 质检员类别
-     */
-    public static final int HOMEWORK_CHECK_TYPE = 14;
-
-    /**
-     * tb_lib_manager 机构作业自批注老师
-     */
-    public static final int LIB_TEACHER_TYPE = 15;
-
-    /**
-     * 作业批注
-     */
-    public static final int TEACHER_TASK_HOMEWORK = 1;
-
-    /**
-     * 难题反馈
-     */
-    public static final int TEACHER_TASK_RPOBLEM = 2;
-
-    /**
-     * 作业批注
-     */
-    public static final int TEACHER_TASK_WORKFEEDBACK = 3;
-
-    /**
-     * 年级
-     */
-    public static final List<String> GRADE_LIST = Arrays.asList("一年级", "二年级", "三年级", "四年级", "五年级", "六年级");
-
-    /**
-     * 学期
-     */
-    public static final List<Integer> SEMESTER_LIST = Arrays.asList(1, 2);
-
-    /**
-     * 知识点类型
-     */
-    public static final List<Integer> SEMESTER_REVIEW_KNOWLEDGE_TYPE_LIST = Arrays.asList(-1, 0, 1);
-
-    /**
-     * 服务列表
-     */
-    public static final Map<String, String> SERVICE_MAP = new HashMap<String, String>();
-    /**
-     * 录入
-     */
-    public static final String CMB_DF_STATUS_I = "I";
-    /**
-     * 成功
-     */
-    public static final String CMB_DF_STATUS_S = "S";
-    /**
-     * 失败
-     */
-    public static final String CMB_DF_STATUS_F = "F";
-
-    /**
-     * 正在获取状态
-     */
-    public static final String CMB_DF_STATUS_C = "C";
-
-    /**
-     * 录入
-     */
-    public static final String WITHDRAWAL_STATUS_INIT = "INIT";
-    /**
-     * 重新
-     */
-    public static final String WITHDRAWAL_STATUS_REINIT = "REINIT";
-    /**
-     * 错误
-     */
-    public static final String WITHDRAWAL_STATUS_ERROR = "ERROR";
-    /**
-     * 成功
-     */
-    public static final String WITHDRAWAL_STATUS_SUCCESS = "SUCCESS";
-    /**
-     * 失败
-     */
-    public static final String WITHDRAWAL_STATUS_FAIL = "FAIL";
-
-    /**
-     * 注册老师
-     */
-    public static final String REGISTER_TEACHER = "注册老师";
-
-    /**
-     * 资深老师
-     */
-    public static final String SENIOR_TEACHER = "资深老师";
-    /**
-     * 明星老师
-     */
-    public static final String STAR_TEACHER = "明星老师";
-    /**
-     * 学霸老师
-     */
-    public static final String SUPER_TEACHER = "学霸老师";
-
-    /**
-     * 小课老师
-     */
-    public static final String GROUP_TEACHER = "小课老师";
-
-    /**
-     * redis中已离开馆学生键值对的key的前缀,完整key为:key的前缀+馆id
-     */
-    public static final String EXITED_STUDENT_PREFIX = "EXITED_STUDENT_";
-
-    /**
-     * redis中同步锁key的前缀,完整key为:key的前缀+学生id
-     */
-    public static final String SIGN_LOCK_PREFIX = "SIGN_LOCK_";
-
-    /**
-     * redis中es保存出错的题目id的key
-     */
-    public static final String ES_SAVE_ERROR_QUESTIONS = "ES_SAVE_ERROR_QUESTIONS";
-
-    /**
-     * 各端app平台类型
-     */
-    public static final Integer CONCH_PLATFORM_TYPE = 1;
-    public static final Integer PARENT_PLATFORM_TYPE = 2;
-    public static final Integer STUDENT_PLATFORM_TYPE = 3;
-    public static final Integer TEACHER_PLATFORM_TYPE = 4;
-    public static final Integer SCHOOL_MASTER_PLATFORM_TYPE = 5;
-
-    public static final String PREVIOUS50_HOMEWORK_RANK = "PREVIOUS50_HOMEWORK_RANK";
-
-    /**
-     * 提分训练,推题时排除这些考点
-     */
-    public static final String EXCLUDED_KD_ID_OF_TRAIN_RECOMMEND = "EXCLUDED_KD_ID_OF_TRAIN_RECOMMEND";
-
-    /**
-     * 提分训练,推题时排除这些知识点
-     */
-    public static final String EXCLUDED_HOW_DETAIL_ID_OF_TRAIN_RECOMMEND = "EXCLUDED_HOW_DETAIL_ID_OF_TRAIN_RECOMMEND";
-
-    public static final Map<String, String> ZYB_CARD_TYPE = new HashMap<String, String>();
-
-    public static final String TEACHERAPP_URL = "https://img.sharingschool.com/aijiaH5/SSJAPPDownload/teacher.html";
-
-    public static final String PARENTAPP_URL = "https://img.sharingschool.com/aijiaH5/SSJAPPDownload/user.html";
-
-    /**
-     * 练习册最大数量
-     */
-    public static final int MAX_ROWS_COUNT = 5000;
-
-//    /**
-//     * 题目类型
-//     */
-//    public static final List<QuestionSubjectAttribute> QUESTION_TYPES = JSONArray.parseArray(PropertiesUtil.getValue("QUESTION_TYPES"), QuestionSubjectAttribute.class);
-//
-//    /**
-//     * 难度级别
-//     */
-//    public static final List<KnowledgeBaseDto> DIFFICULTY_LEVELS = JSONArray.parseArray(PropertiesUtil.getValue("DIFFICULTY_LEVELS"), KnowledgeBaseDto.class);
-//
-//    /**
-//     * 真题例题练习题
-//     */
-//    public static final List<KnowledgeBaseDto> REAL_EXAM_TYPE = JSONArray.parseArray(PropertiesUtil.getValue("REAL_EXAM_TYPE"), KnowledgeBaseDto.class);
-//
-//    /**
-//     * 能力
-//     */
-//    public static final List<QuestionSubjectAttribute> TRAINING_SKILL =  JSONArray.parseArray(PropertiesUtil.getValue("TRAINING_SKILL"), QuestionSubjectAttribute.class);
-
-
-    /**
-     * 保存文件所在路径的key,eg.FILE_MD5:1243jkalsjflkwaejklgjawe
-     */
-    public static final String FILE_MD5_KEY = "FILE_MD5:";
-    /**
-     * 保存上传文件的状态
-     */
-    public static final String FILE_UPLOAD_STATUS = "FILE_UPLOAD_STATUS";
-
-    /**
-     * 练习册题目类型
-     */
-    public static final Map<Integer, String> QUESTION_TYPE_MAP = new HashMap<>();
-
-    static {
-        SERVICE_MAP.put("S003", "作业吧");
-        SERVICE_MAP.put("S010", "一对一");
-
-        ZYB_CARD_TYPE.put("C001", "年卡");
-        ZYB_CARD_TYPE.put("C002", "半年卡");
-        ZYB_CARD_TYPE.put("C003", "月卡");
-        ZYB_CARD_TYPE.put("C004", "作业吧月卡");
-        ZYB_CARD_TYPE.put("C005", "作业吧半年卡");
-        ZYB_CARD_TYPE.put("C006", "作业吧年卡");
-        ZYB_CARD_TYPE.put("C015", "季度卡");
-
-        QUESTION_TYPE_MAP.put(1, "选择题");
-        QUESTION_TYPE_MAP.put(2, "多选项");
-        QUESTION_TYPE_MAP.put(3, "填空题");
-        QUESTION_TYPE_MAP.put(4, "简答题");
-        QUESTION_TYPE_MAP.put(6, "计算题");
-        QUESTION_TYPE_MAP.put(7, "作文题");
-        QUESTION_TYPE_MAP.put(8, "判断题");
-        QUESTION_TYPE_MAP.put(9, "连线题");
-        QUESTION_TYPE_MAP.put(10, "翻译题");
-        QUESTION_TYPE_MAP.put(11, "匹配题");
-        QUESTION_TYPE_MAP.put(12, "阅读题");
-        QUESTION_TYPE_MAP.put(13, "语音题");
-        QUESTION_TYPE_MAP.put(14, "操作题");
-        QUESTION_TYPE_MAP.put(16, "课外阅读题");
-        QUESTION_TYPE_MAP.put(17, "解决问题");
-        QUESTION_TYPE_MAP.put(18, "看图列式");
-        QUESTION_TYPE_MAP.put(19, "情景交际");
-        QUESTION_TYPE_MAP.put(20, "听力题");
-        QUESTION_TYPE_MAP.put(21, "口语题");
-        QUESTION_TYPE_MAP.put(22, "课内阅读题");
-        QUESTION_TYPE_MAP.put(23, "朗读背诵题");
-    }
-
-    public static final String getSubjectFromRequest(String subject) {
-        if ("YUWEN".equals(subject)) {
-            subject = "语文";
-        } else if ("YINGYU".equals(subject)) {
-            subject = "英语";
-        } else if ("SHUXUE".equals(subject)) {
-            subject = "数学";
-        }
-        return subject;
-    }
-
-    /**
-     * 获取中文汉字数字
-     * @param num
-     * @return
-     */
-    public static String getChineseNumberByNumber (int num){
-        String[] chinese = { "零", "一", "二", "三", "四", "五", "六", "七", "八", "九" };
-        String[] unit = { "十", "百", "千", "万", "十", "百", "千", "亿", "十", "百", "千" };
-        if (num > 0){
-            char[] numChar = (num + "").toCharArray();
-            StringBuffer sb = new StringBuffer();
-            int size = numChar.length;
-            for (int i = 0; i < numChar.length; i++) {
-                int tempNum = Integer.parseInt(String.valueOf(numChar[i]));
-                if(i != 0){
-                    if (sb.length() > 0 && "零".equals(sb.substring(sb.length() - 1, sb.length()))){
-                        if (tempNum != 0){
-                            sb.append(chinese[tempNum]);
-                        }
-                    } else {
-                        sb.append(unit[size-i-1]+chinese[tempNum]);
-                    }
-                } else {
-                    sb.append(chinese[tempNum]);
-                }
-            }
-            if (sb.length() > 2 && "一十".equals(sb.substring(0, 2))){
-                sb.deleteCharAt(0);
-            }
-            if (sb.length() > 0 && "零".equals(sb.substring(sb.length() - 1, sb.length()))){
-                sb.deleteCharAt(sb.length() - 1);
-            }
-            return sb.toString();
-        } else {
-            return "";
-        }
-    }
-
-    /**
-     * 把解析json转成html
-     *
-     * @return
-     */
-    public static final String changeAnalysisJson2AnalysisHtml(List<Map> arr) {
-        String result = null;
-        if (arr != null && arr.size() > 0) {
-            List<String> htmlList = new ArrayList<>();
-            for (Map<String, Object> a : arr) {
-                List<Map<String, Object>> list = (List<Map<String, Object>>) a.get("list");
-                List<String> htmlLi = new ArrayList<>();
-                for (Map<String, Object> c : list) {
-                    Map<String, Object> style = (Map<String, Object>) c.get("style");
-                    String value = (String) c.get("value");
-                    int type = (int) c.get("type");
-                    int width = (int) style.get("width");
-                    int height = (int) style.get("height");
-                    if (type == 1) {
-                        htmlLi.add("<span>" + value + "</span>");
-                    } else if (type == 2) {
-                        htmlLi.add("<img src=\"" + value + "\" style=\"width: " + width + "px; height: " + height
-                                + "px;\" alt=\"题目解析\"/>");
-                    }
-                }
-                if (htmlLi.size() > 0) {
-                    htmlList.add(
-                            "<div style=\"display: -webkit-flex; display: flex; -webkit-flex-direction: row; flex-direction: row; -webkit-flex-wrap: wrap; flex-wrap: wrap; -webkit-justify-content: flex-start; justify-content: flex-start; -webkit-align-items: flex-start; align-items: flex-start; margin: 0 50px 25px 0;\">"
-                                    + StringUtil.join(htmlLi, "") + "</div>");
-                }
-            }
-            result = "<div style=\"width: 100%; display: -webkit-flex; display: flex; -webkit-flex-direction: column; flex-direction: column; -webkit-flex-wrap: wrap; flex-wrap: wrap; -webkit-justify-content: flex-start; justify-content: flex-start; -webkit-align-items: flex-start; align-items: flex-start;\">"
-                    + StringUtil.join(htmlList, "") + "</div>";
-        }
-        return result;
-    }
-
-
-}

+ 0 - 19
src/main/java/com/aijia/peixun/utils/Constants.java

@@ -1,19 +0,0 @@
-package com.aijia.peixun.utils;
-
-public class Constants {
-
-    public static final String SUCCESS_CODE = "100";
-    public static final String SUCCESS_MSG = "请求成功";
-
-    public static final String CUSTOM_CODE = "502";
-    public static final String CUSTOM_MSG = "权限不足";
-
-    public static final String PWD_CODE = "302";
-    public static final String PWD_MSG = "第一次登陆修改密码";
-    public static final String SESSION_USER_PERMISSION = "userPermission";
-    /**
-     * session中存放用户信息的key值
-     */
-    public static final String SESSION_USER_INFO = "userInfo";
-
-}

+ 0 - 44
src/main/java/com/aijia/peixun/utils/EmptyUtil.java

@@ -1,44 +0,0 @@
-package com.aijia.peixun.utils;
-
-import java.util.List;
-
-public class EmptyUtil {
-
-    /**
-     * 判断对象为空
-     *
-     * @param obj
-     *      对象名
-     * @return 是否为空
-     */
-    @SuppressWarnings("rawtypes")
-    public static boolean isEmpty(Object obj)
-    {
-        if (obj == null)
-        {
-            return true;
-        }
-        if ((obj instanceof List))
-        {
-            return ((List) obj).size() == 0;
-        }
-        if ((obj instanceof String))
-        {
-            return ((String) obj).trim().equals("");
-        }
-        return false;
-    }
-
-    /**
-     * 判断对象不为空
-     *
-     * @param obj
-     *      对象名
-     * @return 是否不为空
-     */
-    public static boolean isNotEmpty(Object obj)
-    {
-        return !isEmpty(obj);
-    }
-
-}

+ 0 - 41
src/main/java/com/aijia/peixun/utils/ErrorEnum.java

@@ -1,41 +0,0 @@
-package com.aijia.peixun.utils;
-
-public enum ErrorEnum {
-    /*
-     * 错误信息
-     * */
-    E_400("400", "请求处理异常,请稍后再试"),
-    E_500("500", "请求方式有误,请检查 GET/POST"),
-    E_501("501", "请求路径不存在"),
-    E_502("502", "权限不足"),
-    E_10008("10008", "角色删除失败,尚有用户属于此角色"),
-    E_10009("10009", "账户已存在"),
-
-    E_20011("20011", "登陆已过期,请重新登陆"),
-
-    E_90003("90003", "缺少必填参数"),
-
-    E_90004("90004", "参数输入错误"),
-    E_90005("90005", "请输入正确的参数格式"),
-
-    E_90006("90006", "输入的原始密码不正确"),
-    E_90007("90007", "原始密码与新密码一致");
-
-    private String errorCode;
-
-    private String errorMsg;
-
-    ErrorEnum(String errorCode, String errorMsg) {
-        this.errorCode = errorCode;
-        this.errorMsg = errorMsg;
-    }
-
-    public String getErrorCode() {
-        return errorCode;
-    }
-
-    public String getErrorMsg() {
-        return errorMsg;
-    }
-
-}

+ 0 - 86
src/main/java/com/aijia/peixun/utils/FileMD5Util.java

@@ -1,86 +0,0 @@
-package com.aijia.peixun.utils;
-
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import sun.nio.ch.FileChannelImpl;
-
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.FileNotFoundException;
-import java.io.IOException;
-import java.lang.reflect.Method;
-import java.math.BigInteger;
-import java.nio.MappedByteBuffer;
-import java.nio.channels.FileChannel;
-import java.security.AccessController;
-import java.security.MessageDigest;
-import java.security.PrivilegedAction;
-
-public class FileMD5Util {
-    private final static Logger logger = LoggerFactory.getLogger(FileMD5Util.class);
-
-    public static String getFileMD5(File file) throws FileNotFoundException {
-        String value = null;
-        FileInputStream in = new FileInputStream(file);
-        MappedByteBuffer byteBuffer = null;
-        try {
-            byteBuffer = in.getChannel().map(FileChannel.MapMode.READ_ONLY, 0, file.length());
-            MessageDigest md5 = MessageDigest.getInstance("MD5");
-            md5.update(byteBuffer);
-            BigInteger bi = new BigInteger(1, md5.digest());
-            value = bi.toString(16);
-            if (value.length() < 32) {
-                value = "0" + value;
-            }
-        } catch (Exception e) {
-            e.printStackTrace();
-        } finally {
-            if (null != in) {
-                try {
-                    in.getChannel().close();
-                    in.close();
-                } catch (IOException e) {
-                    logger.error("get file md5 error!!!", e);
-                }
-            }
-            if (null != byteBuffer) {
-                freedMappedByteBuffer(byteBuffer);
-            }
-        }
-        return value;
-    }
-
-    /**
-     * 在MappedByteBuffer释放后再对它进行读操作的话就会引发jvm crash,在并发情况下很容易发生
-     * 正在释放时另一个线程正开始读取,于是crash就发生了。所以为了系统稳定性释放前一般需要检 查是否还有线程在读或写
-     *
-     * @param mappedByteBuffer
-     */
-    public static void freedMappedByteBuffer(final MappedByteBuffer mappedByteBuffer) {
-        try {
-            if (mappedByteBuffer == null) {
-                return;
-            }
-
-            mappedByteBuffer.force();
-            AccessController.doPrivileged(new PrivilegedAction<Object>() {
-                @Override
-                public Object run() {
-                    try {
-                        Method m = FileChannelImpl.class.getDeclaredMethod("unmap",
-                                MappedByteBuffer.class);
-                        m.setAccessible(true);
-                        m.invoke(FileChannelImpl.class, mappedByteBuffer);
-                    } catch (Exception e) {
-                        logger.error("clean MappedByteBuffer error!!!", e);
-                    }
-                    logger.info("clean MappedByteBuffer completed!!!");
-                    return null;
-                }
-            });
-
-        } catch (Exception e) {
-            e.printStackTrace();
-        }
-    }
-}

+ 0 - 66
src/main/java/com/aijia/peixun/utils/PhoneFormatCheckUtils.java

@@ -1,66 +0,0 @@
-package com.aijia.peixun.utils;
-
-import java.util.regex.Matcher;
-import java.util.regex.Pattern;
-import java.util.regex.PatternSyntaxException;
-
-/**
- * @since :手机号码校验工具类
- * @author :Jgm
- * @Date: 20210706
- */
-
-public class PhoneFormatCheckUtils {
-
-    /**
-     * 大陆号码或香港号码均可
-     */
-    public static boolean isPhoneLegal(String str) throws PatternSyntaxException {
-        return isChinaPhoneLegal(str) || isHKPhoneLegal(str);
-    }
-
-    /**
-     * 大陆手机号码11位数,匹配格式:前三位固定格式+后8位任意数
-     * 此方法中前三位格式有:
-     * 13+任意数
-     * 145,147,149
-     * 15+除4的任意数(不要写^4,这样的话字母也会被认为是正确的)
-     * 166
-     * 17+3,5,6,7,8
-     * 18+任意数
-     * 198,199
-     */
-    public static boolean isChinaPhoneLegal(String str) throws PatternSyntaxException {
-        // ^ 匹配输入字符串开始的位置
-        // \d 匹配一个或多个数字,其中 \ 要转义,所以是 \\d
-        // $ 匹配输入字符串结尾的位置
-        String regExp = "^((13[0-9])|(14[5,7,9])|(15[0-3,5-9])|(166)|(17[3,5,6,7,8])" +
-                "|(18[0-9])|(19[8,9]))\\d{8}$";
-        Pattern p = Pattern.compile(regExp);
-        Matcher m = p.matcher(str);
-        return m.matches();
-    }
-
-    /**
-     * 香港手机号码8位数,5|6|8|9开头+7位任意数
-     */
-    public static boolean isHKPhoneLegal(String str) throws PatternSyntaxException {
-        // ^ 匹配输入字符串开始的位置
-        // \d 匹配一个或多个数字,其中 \ 要转义,所以是 \\d
-        // $ 匹配输入字符串结尾的位置
-        String regExp = "^(5|6|8|9)\\d{7}$";
-        Pattern p = Pattern.compile(regExp);
-        Matcher m = p.matcher(str);
-        return m.matches();
-    }
-
-    /**
-     *
-     * 判断是否是正整数的方法
-     */
-    public static boolean isNumeric(String string){
-        Pattern pattern = Pattern.compile("[0-9]+");
-        return pattern.matcher(string).matches();
-    }
-
-}

Разница между файлами не показана из-за своего большого размера
+ 0 - 2124
src/main/java/com/aijia/peixun/utils/RedisUtil.java


+ 0 - 88
src/main/java/com/aijia/peixun/utils/ResponseConstant.java

@@ -1,88 +0,0 @@
-package com.aijia.peixun.utils;
-
-/**
- *
- * 类名称:Response<br>
- * 类描述:Response 类<br>
- * @version v1.0
- *
- */
-
-public class ResponseConstant {
-    /**
-     * 成功状态
-     */
-    public static final String CODE_999 = "999";
-
-    /**
-     * 用户名不存在
-     */
-    public static final String CODE_000 = "000";
-
-    /**
-     * 用户名和密码不匹配
-     */
-    public static final String CODE_001 = "001";
-
-    /**
-     * 用户密码不符合规范,需要重置密码
-     */
-    public static final String CODE_011 = "011";
-
-    /**
-     * 网络问题
-     */
-    public static final String CODE_002 = "002";
-    /**
-     * 会员卡为空
-     */
-    public static final String CODE_004 = "004";
-    /**
-     *图书isbn编号为空
-     */
-    public static final String CODE_005 = "005";
-    /**
-     *图书馆ID为空
-     */
-    public static final String CODE_006 = "006";
-    /**
-     *图书库存不足
-     */
-    public static final String CODE_007 = "007";
-    /**
-     *图书不存在
-     */
-    public static final String CODE_008 = "008";
-
-    /**
-     * 401 Unauthorized
-     */
-    public static final String CODE_401 = "401";
-
-    /**
-     * 403 Forbidden
-     */
-    public static final String CODE_403 = "403";
-
-    /**
-     * 404 Not Found
-     */
-    public static final String CODE_404 = "404";
-
-    /**
-     * 服务器问题
-     */
-    public static final String CODE_500 = "500";
-    /**
-     * 没有服务
-     */
-    public static final String CODE_003 = "003";
-    /**
-     * 请求太频繁
-     */
-    public static final String CODE_503 = "503";
-    /**
-     * 小程序根据code获取不到uninoid
-     */
-    public static final String CODE_888 = "888";
-}

+ 0 - 152
src/main/java/com/aijia/peixun/utils/ResponseEntity.java

@@ -1,152 +0,0 @@
-package com.aijia.peixun.utils;
-
-import java.io.Serializable;
-import java.util.Map;
-
-/**
- *
- * 类名称:Response<br>
- * 类描述:Response 类<br>
- * @version v1.0
- *
- */
-
-public class ResponseEntity {
-
-    /**
-     *
-     */
-    private static final long serialVersionUID = 8731218855844435111L;
-    private static final String ERROR = "error";
-    private static final String SUCCESS = "success";
-
-    private String status;
-    private String code;
-    private String msg;
-    private Object data;
-
-    public ResponseEntity success() {
-        this.status = SUCCESS;
-        this.msg = "成功";
-        this.code = com.aijia.peixun.utils.ResponseConstant.CODE_999;
-        return this;
-    }
-
-    public ResponseEntity success(String msg) {
-        this.status = SUCCESS;
-        this.msg = msg;
-        this.code = com.aijia.peixun.utils.ResponseConstant.CODE_999;
-        return this;
-    }
-
-    public ResponseEntity success(String code, String msg) {
-        this.status = SUCCESS;
-        this.code = code;
-        this.msg = msg;
-        return this;
-    }
-
-    public ResponseEntity success(Map<String, Object> data, String msg) {
-        this.status = SUCCESS;
-        this.code = ResponseConstant.CODE_999;
-        this.msg = msg;
-        this.data = data;
-        return this;
-    }
-
-    public ResponseEntity success(Object data, String msg) {
-        this.status = SUCCESS;
-        this.code = ResponseConstant.CODE_999;
-        this.msg = msg;
-        this.data = data;
-        return this;
-    }
-
-    public ResponseEntity success(String code, String msg, Map<String, Object> data) {
-        this.status = SUCCESS;
-        this.code = code;
-        this.msg = msg;
-        this.data = data;
-        return this;
-    }
-
-    public ResponseEntity failure(String code, String msg) {
-        this.status = ERROR;
-        this.code = code;
-        this.msg = msg;
-        return this;
-    }
-
-    public ResponseEntity failure(String msg) {
-        this.status = ERROR;
-        this.code = ResponseConstant.CODE_000;
-        this.msg = msg;
-        return this;
-    }
-
-    public ResponseEntity failure(Object data, String msg) {
-        this.status = ERROR;
-        this.code = ResponseConstant.CODE_000;
-        this.msg = msg;
-        this.data = data;
-        return this;
-    }
-
-    public ResponseEntity failure(String code, String msg, Object data) {
-        this.status = ERROR;
-        this.code = code;
-        this.msg = msg;
-        this.data = data;
-        return this;
-    }
-
-    public String getStatus() {
-        return status;
-    }
-
-    public String getCode() {
-        return code;
-    }
-
-    public String getMsg() {
-        return msg;
-    }
-
-    public void setMsg(String msg) {
-        this.msg = msg;
-    }
-
-    public Object getData() {
-        return data;
-    }
-
-    public void setData(ResponseData data) {
-        this.data = data;
-    }
-
-    public class ResponseData implements Serializable {
-        /**
-         *
-         */
-        private static final long serialVersionUID = 4460263954067427230L;
-        private Map<String, Object> data;
-
-        public ResponseData() {
-            super();
-        }
-
-        public ResponseData(Map<String, Object> data) {
-            super();
-            this.data = data;
-        }
-
-        public Map<String, Object> getData() {
-            return data;
-        }
-
-        public void setData(Map<String, Object> data) {
-            this.data = data;
-        }
-    }
-
-}

+ 0 - 53
src/main/java/com/aijia/peixun/utils/SmsUtils.java

@@ -1,53 +0,0 @@
-package com.aijia.peixun.utils;
-
-
-import javax.annotation.Resource;
-
-public class SmsUtils {
-
-    //1. 发短息
-//    public ResponseEntity sendSms(String phoneNumber, int type) throws Exception{
-        public String sendSms(String phoneNumber, int type) throws Exception{
-        ResponseEntity responseEntity = null;
-        String code = null;
-        try {
-            responseEntity = new ResponseEntity();
-            //判断手机号是否已经注册逻辑
-            //获取6位随机验证码
-            code = AliyunSmsUtil.getRandNum();
-            //所有验证码使用通用验证码:验证码${code},若非本人操作,请勿泄露。
-            AliyunSmsUtil.sendSms(phoneNumber, code,"SMS_175541171");
-            //1:用户注册或登陆确认;2:绑定手机号;3:设置支付密码;4:忘记支付密码;5:添加银行卡;6:换绑手机号
-		/*if (type == 1) {
-			User user = userService.findByMobile(phoneNumber);
-			if(user != null){
-				//登陆确认
-				AliyunSmsUtil.sendSms(phoneNumber, code,"SMS_146410129");
-			}else {
-				//用户注册
-				AliyunSmsUtil.sendSms(phoneNumber, code,"SMS_146410127");
-			}
-		} else if (type == 2) {
-            AliyunSmsUtil.sendSms(phoneNumber, code,"SMS_151548213");
-		} else if (type == 3) {
-            AliyunSmsUtil.sendSms(phoneNumber, code,"SMS_151548220");
-        } else if (type == 4) {
-            AliyunSmsUtil.sendSms(phoneNumber, code,"SMS_175120586");
-        } else if (type == 5) {
-            AliyunSmsUtil.sendSms(phoneNumber, code,"SMS_151578201");
-        } else if (type == 6) {
-            AliyunSmsUtil.sendSms(phoneNumber, code,"SMS_151578199");
-        }*/
-//        tokenManager.setString(phoneNumber, code, 300);
-
-        }catch (Exception e){
-            e.printStackTrace();
-        }
-
-        //返回手机号与验证码
-//        return responseEntity.success(phoneNumber,code);
-            return code;
-    }
-
-
-}

+ 0 - 50
src/main/java/com/aijia/peixun/utils/StringUtil.java

@@ -1,50 +0,0 @@
-package com.aijia.peixun.utils;
-
-import org.apache.commons.lang3.StringUtils;
-
-import java.util.Collection;
-import java.util.Map;
-
-
-public class StringUtil extends StringUtils {
-
-    public static <T> boolean isEmpty(T[] obj) {
-        return (obj == null) || (obj.length == 0);
-    }
-
-    public static boolean isEmpty(Object obj) {
-        if (obj == null) {
-            return true;
-        }
-        if ((obj instanceof String)) {
-            return (String.valueOf(obj)).trim().isEmpty();
-        }
-        if (obj instanceof CharSequence) {
-            return ((CharSequence) obj).length() == 0;
-        }
-        if (obj instanceof Number) {
-            return false;
-        }
-        return false;
-    }
-    public static String formateStr (String str){
-        if (isEmpty(str)){
-            return "";
-        } else {
-            return str;
-        }
-    }
-    @SuppressWarnings("rawtypes")
-    public static boolean isEmpty(Collection obj) {
-        return (obj == null) || (obj.isEmpty());
-    }
-
-    @SuppressWarnings("rawtypes")
-    public static boolean isEmpty(Map obj) {
-        return (obj == null) || (obj.isEmpty());
-    }
-
-
-   
-
-}

+ 0 - 47
src/main/java/com/aijia/peixun/utils/Uuid.java

@@ -1,47 +0,0 @@
-package com.aijia.peixun.utils;
-
-import java.util.UUID;
-
-public class Uuid {
-    // 得到16位的UUID-(数字)
-    public static String getUUID_16() {
-        int machineId = 1;// 最大支持1-9个集群机器部署
-
-        int hashCodeV = UUID.randomUUID().toString().hashCode();
-        if (hashCodeV < 0) {// 有可能是负数
-            hashCodeV = -hashCodeV;
-        }
-        String string = machineId + String.format("%015d", hashCodeV);
-        return string;
-    }
-
-    // 得到32位的UUID-(数字)
-    public static String getUUID_32() {
-        return UUID.randomUUID().toString().replace("-", "").toLowerCase();
-    }
-
-    //得到8位的UUID-(码)
-    public static String[] chars = new String[] { "a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n",
-            "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z", "0", "1", "2", "3", "4", "5", "6", "7", "8",
-            "9", "A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T",
-            "U", "V", "W", "X", "Y", "Z" };
-
-    public static String getUUID_8() {
-        StringBuffer shortBuffer = new StringBuffer();
-        String uuid = UUID.randomUUID().toString().replace("-", "");
-        for (int i = 0; i < 8; i++) {
-            String str = uuid.substring(i * 4, i * 4 + 4);
-            int x = Integer.parseInt(str, 16);
-            shortBuffer.append(chars[x % 0x3E]);
-        }
-        return shortBuffer.toString();
-
-    }
-
-    public static void main(String[] args) {
-
-        System.out.println(getUUID_8());
-    }
-
-}
-

+ 0 - 120
src/main/java/com/aijia/peixun/utils/ZipFileUtil.java

@@ -1,120 +0,0 @@
-package com.aijia.peixun.utils;
-
-import org.springframework.web.multipart.MultipartFile;
-
-import java.io.*;
-import java.nio.charset.Charset;
-import java.util.Enumeration;
-import java.util.UUID;
-import java.util.zip.ZipEntry;
-import java.util.zip.ZipFile;
-
-public class ZipFileUtil {
-
-    /**
-     * 解压文件到指定目录
-     */
-    public static void unZipFiles(File zipFile, String descDir)throws IOException {
-        File pathFile = new File(descDir);
-        if(!pathFile.exists())
-        {
-            pathFile.mkdirs();
-        }
-        //解决zip文件中有中文目录或者中文文件
-        ZipFile zip = new ZipFile(zipFile, Charset.forName("GBK"));
-        for(Enumeration entries = zip.entries(); entries.hasMoreElements();)
-        {
-            ZipEntry entry = (ZipEntry)entries.nextElement();
-            String zipEntryName = entry.getName();
-            InputStream in = zip.getInputStream(entry);
-            String outPath = (descDir+zipEntryName).replaceAll("\\*", "/");;
-            //判断路径是否存在,不存在则创建文件路径
-            File file = new File(outPath.substring(0, outPath.lastIndexOf('/')));
-            if(!file.exists())
-            {
-                file.mkdirs();
-            }
-            //判断文件全路径是否为文件夹,如果是上面已经上传,不需要解压
-            if(new File(outPath).isDirectory())
-            {
-                continue;
-            }
-            //输出文件路径信息
-            System.out.println(outPath);
-            OutputStream out = new FileOutputStream(outPath);
-            byte[] buf1 = new byte[1024];
-            int len;
-            while((len=in.read(buf1))>0)
-            {
-                out.write(buf1,0,len);
-            }
-            in.close();
-            out.close();
-        }
-        System.out.println("******************解压完毕********************");
-    }
-
-    //MultipartFile 转 File
-    public static File multipartFileToFile(MultipartFile multipartFile){
-
-        // 获取文件名
-        String fileName = multipartFile.getOriginalFilename();
-        // 获取文件后缀
-        String prefix=fileName.substring(fileName.lastIndexOf("."));
-
-        File excelFile = null;
-
-        try {
-            // 用时间作为文件名,防止生成的临时文件重复
-            excelFile = File.createTempFile(UUID.randomUUID().toString(), prefix);
-            multipartFile.transferTo(excelFile);
-        }catch (Exception e){
-//            log.error("==========={}文件=================转换异常", fileName);
-            e.printStackTrace();
-        }
-        return excelFile;
-    }
-
-
-    /**
-     * File文件转String
-     * @param file
-     * @return
-     * @throws IOException
-     */
-    public static String file2String(final File file) throws IOException {
-        if (file.exists()) {
-            byte[] data = new byte[(int) file.length()];
-            boolean result;
-            FileInputStream inputStream = null;
-            try {
-                inputStream = new FileInputStream(file);
-                int len = inputStream.read(data);
-                result = len == data.length;
-            } finally {
-                if (inputStream != null) {
-                    inputStream.close();
-                }
-            }
-            if (result) {
-                return new String(data);
-            }
-        }
-        return null;
-    }
-
-
-
-    public static void main(String[] args) throws IOException {
-        /**
-         * 解压文件
-         */
-        File zipFile = new File("F:/exercise/扫描文件/已完成练习册扫描20201010.zip");
-        String path = "F:/exercise/扫描文件/111/";
-        unZipFiles(zipFile, path);
-    }
-
-
-
-
-}

+ 0 - 90
src/main/java/com/aijia/peixun/utils/httpClient.java

@@ -1,90 +0,0 @@
-package com.aijia.peixun.utils;
-
-import com.alibaba.fastjson.JSON;
-import com.alibaba.fastjson.JSONObject;
-import org.apache.http.Consts;
-import org.apache.http.HttpEntity;
-import org.apache.http.NameValuePair;
-import org.apache.http.client.entity.UrlEncodedFormEntity;
-import org.apache.http.client.methods.CloseableHttpResponse;
-import org.apache.http.client.methods.HttpPost;
-import org.apache.http.impl.client.CloseableHttpClient;
-import org.apache.http.impl.client.HttpClients;
-import org.apache.http.message.BasicNameValuePair;
-import org.apache.http.util.EntityUtils;
-
-import javax.servlet.ServletException;
-import javax.servlet.http.HttpServlet;
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-import java.io.*;
-import java.net.HttpURLConnection;
-import java.net.URL;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-/**
- *  与KMT通信链接,发数据端
- */
-
-public class httpClient extends HttpServlet {
-
-    final static String uploadeFile = "上传文件";
-    final static String downLodeFile = "获取文件";
-    final static String doExsercise = "做练习题";
-    final static String checkeExsercise = "考评打分";
-    final static String getResult = "获取考试成绩";
-
-
-//  1. 发送Http请求,发送文件
-   public String doGet(HttpServletRequest request, HttpServletResponse response,String data)throws ServletException,IOException{
-       String tline=null;
-       try {
-           request.setCharacterEncoding("UTF-8");
-           response.setContentType("text/html;charset=utf-8");
-           System.out.println("兼职培训系统开始发送数据给Kmt");
-           //设置链接kmt项目的servlet的Url
-           String http = "http://localhost:3901/aijia-kmt/KmtAndPeixunHttpConectGet";
-           URL url = new URL(http);
-           HttpURLConnection httpURLConnection = (HttpURLConnection)url.openConnection();
-           httpURLConnection.setDoOutput(true);
-           httpURLConnection.setRequestMethod("POST");
-           httpURLConnection.setConnectTimeout(30000);
-           OutputStreamWriter writer = new OutputStreamWriter(httpURLConnection.getOutputStream(),"utf-8");
-           //写入文件数据
-           writer.write(data);
-           writer.flush();
-           writer.close();
-           int responseCode = httpURLConnection.getResponseCode();
-           //表示请求成功
-           if(responseCode==HttpURLConnection.HTTP_OK){
-               System.out.println("OK"+responseCode);
-               //获得服务端的输出流,得到返回的数据
-               InputStream urlstream=httpURLConnection.getInputStream();
-               BufferedReader reader=new BufferedReader(new InputStreamReader(urlstream));
-               String line;
-//               String tline="";
-               while((line=reader.readLine())!=null){
-                   tline+=line;
-               }
-               //输出所有的数据
-               System.out.println(tline);
-           }else{
-               System.out.println("ERR"+responseCode);
-           }
-
-       }catch (Exception e){
-           e.printStackTrace();
-       }
-       return tline;
-   }
-
-    public void doPost(HttpServletRequest request, HttpServletResponse response,String data)
-            throws ServletException, IOException {
-        this.doGet(request, response, data);
-
-    }
-
-}

+ 0 - 40
src/main/java/com/aijia/peixun/utils/httpClientGet.java

@@ -1,40 +0,0 @@
-package com.aijia.peixun.utils;
-
-
-import javax.servlet.ServletException;
-import javax.servlet.http.HttpServlet;
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-import java.io.IOException;
-
-// 与kmt链接,接受http数据端
-
-public class httpClientGet extends HttpServlet {
-
-    public void doGet(HttpServletRequest request, HttpServletResponse response)
-            throws ServletException, IOException {
-        request.setCharacterEncoding("utf-8");
-        response.setContentType("text/html;charset=utf-8");
-        System.out.println("test2");
-        System.out.println(request.getParameter("username"));
-        System.out.println(request.getParameter("password"));
-        //获得发送HTTP请求的参数
-        String username=request.getParameter("username");
-        String password=request.getParameter("password");
-        //向HTTP发送方返回响应数据
-        if("123".equals(username)&&"456".equals(password)){
-            response.getWriter().write("{\"falg\":\"success\"}");
-        }else{
-            response.getWriter().write("{\"falg\":\"error\"}");
-        }
-    }
-
-
-    public void doPost(HttpServletRequest request, HttpServletResponse response)
-            throws ServletException, IOException {
-        this.doGet(request, response);
-    }
-
-
-
-}

+ 0 - 141
src/main/java/com/aijia/peixun/vo/MultipartFileParam.java

@@ -1,141 +0,0 @@
-package com.aijia.peixun.vo;
-
-import org.springframework.web.multipart.MultipartFile;
-
-import java.io.Serializable;
-
-public class MultipartFileParam implements Serializable {
-
-    private static final long serialVersionUID = -5802485240718558864L;
-    // 用户id
-    private String uid;
-    //任务ID
-    private String id;
-    //总分片数量
-    private int chunks;
-    //当前为第几块分片
-    private int chunk;
-    //当前分片大小
-    private long size = 0L;
-    //文件名
-    private String name;
-    //分片对象
-    private MultipartFile file;
-    // MD5
-    private String md5;
-
-    private Integer filetype;
-
-    private String username;
-
-    //用户类型
-    private String typeofjob;
-
-    public String getUid() {
-        return uid;
-    }
-
-    public void setUid(String uid) {
-        this.uid = uid;
-    }
-
-    public String getId() {
-        return id;
-    }
-
-    public void setId(String id) {
-        this.id = id;
-    }
-
-    public int getChunks() {
-        return chunks;
-    }
-
-    public void setChunks(int chunks) {
-        this.chunks = chunks;
-    }
-
-    public int getChunk() {
-        return chunk;
-    }
-
-    public void setChunk(int chunk) {
-        this.chunk = chunk;
-    }
-
-    public long getSize() {
-        return size;
-    }
-
-    public void setSize(long size) {
-        this.size = size;
-    }
-
-    public String getName() {
-        return name;
-    }
-
-    public void setName(String name) {
-        this.name = name;
-    }
-
-    public MultipartFile getFile() {
-        return file;
-    }
-
-    public void setFile(MultipartFile file) {
-        this.file = file;
-    }
-
-    public String getMd5() {
-        return md5;
-    }
-
-    public void setMd5(String md5) {
-        this.md5 = md5;
-    }
-
-
-    public String gettypeofjob() {
-        return typeofjob;
-    }
-    public void settypeofjob(String typeofjob) {
-        this.typeofjob = typeofjob;
-    }
-
-
-    public Integer getfiletype() {
-        return filetype;
-    }
-
-    public void setfiletype(Integer filetype) {
-        this.filetype = filetype;
-    }
-
-
-    public String getusername() {
-        return username;
-    }
-
-    public void setusername(String username) {
-        this.username = username;
-    }
-
-
-
-
-    @Override
-    public String toString() {
-        return "MultipartFileParam{" +
-                "uid='" + uid + '\'' +
-                ", id='" + id + '\'' +
-                ", chunks=" + chunks +
-                ", chunk=" + chunk +
-                ", size=" + size +
-                ", name='" + name + '\'' +
-                ", file=" + file +
-                ", md5='" + md5 + '\'' +
-                '}';
-    }
-
-}

+ 0 - 89
src/main/java/com/aijia/peixun/vo/UserVo.java

@@ -1,89 +0,0 @@
-package com.aijia.peixun.vo;
-
-
-public class UserVo {
-
-    private String UserName;
-    private String telephoneNo;
-    private String email;
-    private String correctingsub;
-    private String typeofjob;
-    private String createtime;
-    private String area;
-    private String typeofuser;
-
-    private void setUserName(String UserName){
-        this.UserName=UserName;
-    }
-
-    private String getUserName(){
-        return UserName;
-    }
-
-    private void settelephoneNo(String telephoneNo){
-        this.telephoneNo=telephoneNo;
-    }
-
-    private String gettelephoneNo(){
-        return telephoneNo;
-    }
-
-    private void setemail(String telephoneNo){
-        this.email=email;
-    }
-
-    private String getemail(){
-        return email;
-    }
-
-    private void setcorrectingsub(String correctingsub){
-        this.correctingsub=correctingsub;
-    }
-
-    private String getcorrectingsub(){
-        return correctingsub;
-    }
-
-    private void settypeofjob(String typeofjob){
-        this.typeofjob=typeofjob;
-    }
-
-    private String gettypeofjob(){
-        return typeofjob;
-    }
-
-    private void setcreatetime(String createtime){
-        this.createtime=createtime;
-    }
-
-    private String getcreatetime(){
-        return createtime;
-    }
-
-    private void setarea(String area){
-        this.area=area;
-    }
-
-    private String getarea(){
-        return area;
-    }
-
-    private void settypeofuser(String typeofuser){
-        this.typeofuser=typeofuser;
-    }
-
-    private String gettypeofuser(){
-        return typeofuser;
-    }
-
-
-
-
-
-
-
-
-
-
-
-}

+ 58 - 0
src/main/java/com/aijia/train/bean/TrTrainExerciseRole.java

@@ -0,0 +1,58 @@
+package com.aijia.train.bean;
+
+
+
+import com.aijia.kmt.po.base.BaseEntity;
+
+import javax.persistence.Entity;
+import javax.persistence.Table;
+import java.util.Date;
+
+/**
+ * @author admin
+ * 练习册与角色
+ */
+@Entity
+@Table(name = "tr_train_exercise_role")
+public class TrTrainExerciseRole extends BaseEntity {
+
+	/**
+	 * 学习角色
+	 */
+	private int roleType;
+
+	/**
+	 * 练习册id
+	 */
+	private String exerciseId;
+
+	/**
+	 * 学科
+	 * @return
+	 */
+	private String subject;
+
+	public int getRoleType() {
+		return roleType;
+	}
+
+	public void setRoleType(int roleType) {
+		this.roleType = roleType;
+	}
+
+	public String getExerciseId() {
+		return exerciseId;
+	}
+
+	public void setExerciseId(String exerciseId) {
+		this.exerciseId = exerciseId;
+	}
+
+	public String getSubject() {
+		return subject;
+	}
+
+	public void setSubject(String subject) {
+		this.subject = subject;
+	}
+}

+ 108 - 0
src/main/java/com/aijia/train/bean/TrTrainFiles.java

@@ -0,0 +1,108 @@
+package com.aijia.train.bean;
+
+
+
+import com.aijia.kmt.po.base.BaseEntity;
+
+import javax.persistence.Entity;
+import javax.persistence.Table;
+import java.util.Date;
+
+/**
+ * @author admin
+ */
+@Entity
+@Table(name = "tr_train_files")
+public class TrTrainFiles extends BaseEntity {
+	
+	private static final long serialVersionUID = 890135943022798129L;
+
+	/**
+	 * 兼职类型 1、加工 2、加审 3、解析
+	 */
+	private Integer roleType;
+
+
+	/**
+	 * 创建时间
+	 */
+	private Date createTime;
+
+	/**
+     * 批改科目
+	 */
+	private String subject;
+
+	/**
+	 * mp4,pdf,word,excel
+	 */
+	private String fileType;
+
+	/**
+	 * 文件路径
+	 */
+	private String fileUrl;
+
+	/**
+	 * 文件顺序
+	 */
+	private int fileIndex;
+
+	private String fileName;
+
+	public Integer getRoleType() {
+		return roleType;
+	}
+
+	public void setRoleType(Integer roleType) {
+		this.roleType = roleType;
+	}
+
+	public Date getCreateTime() {
+		return createTime;
+	}
+
+	public void setCreateTime(Date createTime) {
+		this.createTime = createTime;
+	}
+
+	public String getSubject() {
+		return subject;
+	}
+
+	public void setSubject(String subject) {
+		this.subject = subject;
+	}
+
+	public String getFileType() {
+		return fileType;
+	}
+
+	public void setFileType(String fileType) {
+		this.fileType = fileType;
+	}
+
+	public String getFileUrl() {
+		return fileUrl;
+	}
+
+	public void setFileUrl(String fileUrl) {
+		this.fileUrl = fileUrl;
+	}
+
+	public int getFileIndex() {
+		return fileIndex;
+	}
+
+	public void setFileIndex(int fileIndex) {
+		this.fileIndex = fileIndex;
+	}
+
+	public String getFileName() {
+		return fileName;
+	}
+
+	public void setFileName(String fileName) {
+		this.fileName = fileName;
+	}
+}

+ 150 - 0
src/main/java/com/aijia/train/bean/TrTrainPartUser.java

@@ -0,0 +1,150 @@
+package com.aijia.train.bean;
+
+
+
+import com.aijia.kmt.po.base.BaseEntity;
+
+import javax.persistence.Entity;
+import javax.persistence.Table;
+import java.util.Date;
+
+/**
+ * @author admin
+ */
+@Entity(name="tr_train_part_user")
+@Table(name = "tr_train_part_user")
+public class TrTrainPartUser extends BaseEntity {
+	
+	private static final long serialVersionUID = 890135943022798129L;
+
+	/**
+	 * 兼职类型 1、加工 2、加审 3、解析
+	 */
+	private Integer roleType;
+
+	/**
+	 * 手机号
+	 */
+	private String mobile;
+
+	/**
+	 * 老师姓名
+	 */
+	private String name;
+
+	/**
+	 * 用户状态 1正常 2禁用
+	 */
+	private Integer status;
+
+	/**
+	 * 创建时间
+	 */
+	private Date createTime;
+
+	/**
+	 * 批改科目
+	 */
+	private String subject;
+
+	/**
+	 * 学习状态 0-未开始学习  1-学习中 2-学习超时 3-未提交 4-已提交 5-通过
+	 */
+	private int studyStatus;
+
+	/**
+	 * 学习次数(考核次数)
+	 */
+	private int studyTimes;
+
+	/**
+	 * 考核次数(考核次数)
+	 */
+	private int checkTimes;
+
+	/**
+	 * 0 不是管理员 1-管理员
+	 */
+	private int managerType;
+
+
+	public Integer getRoleType() {
+		return roleType;
+	}
+
+	public void setRoleType(Integer roleType) {
+		this.roleType = roleType;
+	}
+
+	public String getMobile() {
+		return mobile;
+	}
+
+	public void setMobile(String mobile) {
+		this.mobile = mobile;
+	}
+
+	public String getName() {
+		return name;
+	}
+
+	public void setName(String name) {
+		this.name = name;
+	}
+
+	public Integer getStatus() {
+		return status;
+	}
+
+	public void setStatus(Integer status) {
+		this.status = status;
+	}
+
+	public Date getCreateTime() {
+		return createTime;
+	}
+
+	public void setCreateTime(Date createTime) {
+		this.createTime = createTime;
+	}
+
+	public String getSubject() {
+		return subject;
+	}
+
+	public void setSubject(String subject) {
+		this.subject = subject;
+	}
+
+	public int getStudyStatus() {
+		return studyStatus;
+	}
+
+	public void setStudyStatus(int studyStatus) {
+		this.studyStatus = studyStatus;
+	}
+
+	public int getStudyTimes() {
+		return studyTimes;
+	}
+
+	public void setStudyTimes(int studyTimes) {
+		this.studyTimes = studyTimes;
+	}
+
+	public int getManagerType() {
+		return managerType;
+	}
+
+	public void setManagerType(int managerType) {
+		this.managerType = managerType;
+	}
+
+	public int getCheckTimes() {
+		return checkTimes;
+	}
+
+	public void setCheckTimes(int checkTimes) {
+		this.checkTimes = checkTimes;
+	}
+}

+ 310 - 0
src/main/java/com/aijia/train/bean/TrTrainUserExercise.java

@@ -0,0 +1,310 @@
+package com.aijia.train.bean;
+
+import com.aijia.kmt.po.base.BaseEntity;
+
+import javax.persistence.Entity;
+import javax.persistence.Table;
+
+/**
+ * @author sh
+ * @className TrainUserExerciseInfo
+ * @description 用户培训相关
+ * @date 2021/7/27
+ */
+@Entity
+@Table(name="tr_train_user_exercise")
+public class TrTrainUserExercise extends BaseEntity {
+
+    private String userId;
+
+    /**
+     * 练习册id
+     */
+    private String exerciseId;
+
+    /**
+     * 题目id
+     */
+    private String questionId;
+
+    private String questionOrg;
+
+    private String question;
+
+    private String questionText;
+
+    private String questionJson;
+
+    private String answer;
+
+    private String answerText;
+
+    private String answerJson;
+
+    private String analysis;
+
+    private String analysisJson;
+
+    private String updateTime;
+
+    private String createTime;
+
+    private int status;
+
+    private String des;
+
+    /**
+     * 题目类型,1:选择题2:多选项3:填空题4:简答题6:计算题7:作文题8:判断题9:连线题10:
+     * 翻译题11:匹配题12:阅读题13:语音题14:操作题16:课外阅读题17:解决问题18:看图列式19:情景交际
+     */
+    private Integer questionType = 0;
+
+    /**
+     * 真题,例题类型,1例题,2真题,3练习题
+     */
+    private String realExamType;
+
+    /**
+     * 难度级别
+     */
+    private Integer difficultyLevel = 0;
+
+    /**
+     * //训练的技能
+     */
+    private String trainingSkill;
+
+    /**
+     *update kmt_exercise_questions set concise_id=#{startX}, analysis_submit_type=#{startY}, update_type=#{endX}," +
+     *             " es_loaded=#{endY}, enumerate=#{enumerate} where id=#{questionId}
+     * `concise_id` int DEFAULT '0' COMMENT '年级科目版本信息id',
+     * `analysis_submit_type` int DEFAULT '0' COMMENT '解析加工的类型:0未解析,1已提交解析',
+     *`update_type` int DEFAULT '0' COMMENT '更新类型,默认0,1更新答案文本',
+     *`es_loaded` smallint NOT NULL DEFAULT '0' COMMENT '是否已加载到es(-1关联教辅不存在;0未加载;1已加载;2加载失败)',
+     * `enumerate` int NOT NULL DEFAULT '1' COMMENT '1 有题号需要去 ,2 有题号不需要去 ,3其他',
+     * `question_path` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
+     */
+
+    private int conciseId;
+
+    private int analysisSubmitType;
+
+    private int updateType;
+
+    private int esLoaded;
+
+    private int enumerate;
+
+    /**
+     * 题目图片路径
+     */
+    private String questionPath;
+
+    public String getUserId() {
+        return userId;
+    }
+
+    public void setUserId(String userId) {
+        this.userId = userId;
+    }
+
+    public String getExerciseId() {
+        return exerciseId;
+    }
+
+    public void setExerciseId(String exerciseId) {
+        this.exerciseId = exerciseId;
+    }
+
+    public String getQuestionId() {
+        return questionId;
+    }
+
+    public void setQuestionId(String questionId) {
+        this.questionId = questionId;
+    }
+
+    public String getQuestionOrg() {
+        return questionOrg;
+    }
+
+    public void setQuestionOrg(String questionOrg) {
+        this.questionOrg = questionOrg;
+    }
+
+    public String getQuestion() {
+        return question;
+    }
+
+    public void setQuestion(String question) {
+        this.question = question;
+    }
+
+    public String getQuestionText() {
+        return questionText;
+    }
+
+    public void setQuestionText(String questionText) {
+        this.questionText = questionText;
+    }
+
+    public String getQuestionJson() {
+        return questionJson;
+    }
+
+    public void setQuestionJson(String questionJson) {
+        this.questionJson = questionJson;
+    }
+
+    public String getAnswer() {
+        return answer;
+    }
+
+    public void setAnswer(String answer) {
+        this.answer = answer;
+    }
+
+    public String getAnswerText() {
+        return answerText;
+    }
+
+    public void setAnswerText(String answerText) {
+        this.answerText = answerText;
+    }
+
+    public String getAnswerJson() {
+        return answerJson;
+    }
+
+    public void setAnswerJson(String answerJson) {
+        this.answerJson = answerJson;
+    }
+
+    public String getAnalysis() {
+        return analysis;
+    }
+
+    public void setAnalysis(String analysis) {
+        this.analysis = analysis;
+    }
+
+    public String getAnalysisJson() {
+        return analysisJson;
+    }
+
+    public void setAnalysisJson(String analysisJson) {
+        this.analysisJson = analysisJson;
+    }
+
+    public String getUpdateTime() {
+        return updateTime;
+    }
+
+    public void setUpdateTime(String updateTime) {
+        this.updateTime = updateTime;
+    }
+
+    public String getCreateTime() {
+        return createTime;
+    }
+
+    public void setCreateTime(String createTime) {
+        this.createTime = createTime;
+    }
+
+    public int getStatus() {
+        return status;
+    }
+
+    public void setStatus(int status) {
+        this.status = status;
+    }
+
+    public String getDes() {
+        return des;
+    }
+
+    public void setDes(String des) {
+        this.des = des;
+    }
+
+    public Integer getQuestionType() {
+        return questionType;
+    }
+
+    public void setQuestionType(Integer questionType) {
+        this.questionType = questionType;
+    }
+
+    public String getRealExamType() {
+        return realExamType;
+    }
+
+    public void setRealExamType(String realExamType) {
+        this.realExamType = realExamType;
+    }
+
+    public Integer getDifficultyLevel() {
+        return difficultyLevel;
+    }
+
+    public void setDifficultyLevel(Integer difficultyLevel) {
+        this.difficultyLevel = difficultyLevel;
+    }
+
+    public String getTrainingSkill() {
+        return trainingSkill;
+    }
+
+    public void setTrainingSkill(String trainingSkill) {
+        this.trainingSkill = trainingSkill;
+    }
+
+    public int getConciseId() {
+        return conciseId;
+    }
+
+    public void setConciseId(int conciseId) {
+        this.conciseId = conciseId;
+    }
+
+    public int getAnalysisSubmitType() {
+        return analysisSubmitType;
+    }
+
+    public void setAnalysisSubmitType(int analysisSubmitType) {
+        this.analysisSubmitType = analysisSubmitType;
+    }
+
+    public int getUpdateType() {
+        return updateType;
+    }
+
+    public void setUpdateType(int updateType) {
+        this.updateType = updateType;
+    }
+
+    public int getEsLoaded() {
+        return esLoaded;
+    }
+
+    public void setEsLoaded(int esLoaded) {
+        this.esLoaded = esLoaded;
+    }
+
+    public int getEnumerate() {
+        return enumerate;
+    }
+
+    public void setEnumerate(int enumerate) {
+        this.enumerate = enumerate;
+    }
+
+    public String getQuestionPath() {
+        return questionPath;
+    }
+
+    public void setQuestionPath(String questionPath) {
+        this.questionPath = questionPath;
+    }
+}

+ 96 - 0
src/main/java/com/aijia/train/bean/TrTrainUserInfo.java

@@ -0,0 +1,96 @@
+package com.aijia.train.bean;
+
+
+
+import com.aijia.kmt.po.base.BaseEntity;
+
+import javax.persistence.Entity;
+import javax.persistence.Table;
+import java.util.Date;
+
+/**
+ * @author admin
+ */
+@Entity
+@Table(name = "tr_train_user_info")
+public class TrTrainUserInfo extends BaseEntity {
+
+	/**
+	 * userId
+	 */
+	private String userId;
+
+	/**
+	 * 创建时间(学习开始时间)
+	 */
+	private Date createTime;
+
+	/**
+	 * 学习角色
+	 */
+	private int roleType;
+
+	/**
+	 * 学习资料id
+	 */
+	private String fileId;
+
+	/**
+	 * 学科
+	 * @return
+	 */
+	private String subject;
+
+	/**
+	 * 是否有效 1有效 2无效
+	 */
+	private int status;
+
+	public String getUserId() {
+		return userId;
+	}
+
+	public void setUserId(String userId) {
+		this.userId = userId;
+	}
+
+	public Date getCreateTime() {
+		return createTime;
+	}
+
+	public void setCreateTime(Date createTime) {
+		this.createTime = createTime;
+	}
+
+	public int getRoleType() {
+		return roleType;
+	}
+
+	public void setRoleType(int roleType) {
+		this.roleType = roleType;
+	}
+
+	public String getFileId() {
+		return fileId;
+	}
+
+	public void setFileId(String fileId) {
+		this.fileId = fileId;
+	}
+
+	public String getSubject() {
+		return subject;
+	}
+
+	public void setSubject(String subject) {
+		this.subject = subject;
+	}
+
+	public int getStatus() {
+		return status;
+	}
+
+	public void setStatus(int status) {
+		this.status = status;
+	}
+}

+ 123 - 0
src/main/java/com/aijia/train/bean/TrTrainUserQuestionKnow.java

@@ -0,0 +1,123 @@
+package com.aijia.train.bean;
+
+import com.aijia.kmt.po.base.BaseEntity;
+import com.baomidou.mybatisplus.annotation.FieldStrategy;
+import com.baomidou.mybatisplus.annotation.TableField;
+
+import javax.persistence.Column;
+import javax.persistence.Entity;
+import javax.persistence.Table;
+import java.util.Date;
+
+/**
+ * @author sh
+ * @className TrainUserExerciseInfo
+ * @description 用户培训相关
+ * @date 2021/7/27
+ */
+@Entity
+@Table(name="tr_train_user_question_know")
+public class TrTrainUserQuestionKnow extends BaseEntity {
+
+    private String userId;
+    @TableField(updateStrategy = FieldStrategy.NEVER)
+    private String questionId;//题目id
+    private String questionParentId;//大题id
+    private String howDetailsId;//知识点id
+    private String howDetailsKdId;//考点id
+    private Integer loaded;
+    private Integer version;
+    private Date updateTime;//最后一次更新时间
+    private Date createTime;//创建时间
+    private String howDetailSortId;
+    private String howDetailKdSortId;
+
+    @Column(name = "question_id", updatable = false)
+    public String getQuestionId() {
+        return questionId;
+    }
+
+    public void setQuestionId(String questionId) {
+        this.questionId = questionId;
+    }
+
+    public String getQuestionParentId() {
+        return questionParentId;
+    }
+
+    public void setQuestionParentId(String questionParentId) {
+        this.questionParentId = questionParentId;
+    }
+
+    public String getHowDetailsId() {
+        return howDetailsId;
+    }
+
+    public void setHowDetailsId(String howDetailsId) {
+        this.howDetailsId = howDetailsId;
+    }
+
+    public String getHowDetailsKdId() {
+        return howDetailsKdId;
+    }
+
+    public void setHowDetailsKdId(String howDetailsKdId) {
+        this.howDetailsKdId = howDetailsKdId;
+    }
+
+    public Integer getLoaded() {
+        return loaded;
+    }
+
+    public void setLoaded(Integer loaded) {
+        this.loaded = loaded;
+    }
+
+    public Integer getVersion() {
+        return version;
+    }
+
+    public void setVersion(Integer version) {
+        this.version = version;
+    }
+
+    public Date getUpdateTime() {
+        return updateTime;
+    }
+
+    public void setUpdateTime(Date updateTime) {
+        this.updateTime = updateTime;
+    }
+
+    public Date getCreateTime() {
+        return createTime;
+    }
+
+    public void setCreateTime(Date createTime) {
+        this.createTime = createTime;
+    }
+
+    public String getHowDetailSortId() {
+        return howDetailSortId;
+    }
+
+    public void setHowDetailSortId(String howDetailSortId) {
+        this.howDetailSortId = howDetailSortId;
+    }
+
+    public String getHowDetailKdSortId() {
+        return howDetailKdSortId;
+    }
+
+    public void setHowDetailKdSortId(String howDetailKdSortId) {
+        this.howDetailKdSortId = howDetailKdSortId;
+    }
+
+    public String getUserId() {
+        return userId;
+    }
+
+    public void setUserId(String userId) {
+        this.userId = userId;
+    }
+}

+ 399 - 0
src/main/java/com/aijia/train/controller/ApiTrainController.java

@@ -0,0 +1,399 @@
+package com.aijia.train.controller;
+
+import com.aijia.basic.utils.DateHelper;
+import com.aijia.core.utils.StringUtil;
+import com.aijia.core.web.BaseController;
+import com.aijia.core.web.ResponseConstant;
+import com.aijia.core.web.ResponseEntity;
+import com.aijia.kmt.annotation.IgnoreSecurity;
+import com.aijia.kmt.po.FileInfo;
+import com.aijia.kmt.po.base.IdWorker;
+import com.aijia.kmt.service.FileInfoService;
+import com.aijia.kmt.service.TokenManager;
+import com.aijia.kmt.utils.OSSUtils;
+import com.aijia.kmt.utils.PropertiesUtil;
+import com.aijia.train.bean.TrTrainFiles;
+import com.aijia.train.bean.TrTrainPartUser;
+import com.aijia.train.mapper.TrainFileServiceMapper;
+import com.aijia.train.mapper.TrainUserServiceMapper;
+import com.aijia.train.service.ITrainService;
+import com.aijia.train.vo.*;
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import lombok.extern.slf4j.Slf4j;
+import org.apache.commons.lang3.StringUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+import org.springframework.web.multipart.MultipartFile;
+
+import java.util.*;
+
+/**
+ * 
+ * 类描述: 培训系统
+ */
+@Api(value = "培训系统", tags = "培训系统")
+@RestController
+@RequestMapping("/api/part/train")
+@Slf4j
+public class ApiTrainController extends BaseController {
+
+    @Autowired
+    private ITrainService trainService;
+
+    @Autowired
+    private TokenManager tokenManager;
+
+    @Autowired
+    private FileInfoService fileInfoService;
+
+    @Autowired
+    private TrainUserServiceMapper userServiceMapper;
+
+    @Autowired
+    private TrainFileServiceMapper fileServiceMapper;
+
+
+
+
+    @IgnoreSecurity
+    @RequestMapping(value="/sendCode",method = RequestMethod.POST)
+    public ResponseEntity sendCode(@RequestBody TrainLoginVo req){
+        ResponseEntity responseEntity = new ResponseEntity();
+        if(StringUtils.isBlank(req.getMobile())){
+            return responseEntity.failure(ResponseConstant.CODE_000,"请输入电话号码");
+        }
+
+        //查看是否是已经报名成功
+//        String phoneKey = "train202107_"+req.getMobile().trim();
+        try {
+            String codeKey = "trainRepeatCode_".concat(req.getMobile().trim());
+            if(tokenManager.exists(codeKey)){
+                return responseEntity.failure("请于上次发送成功后60秒后再重新尝试!");
+            }
+            responseEntity = trainService.sendSmsV2(req.getMobile().trim());
+        }catch (Exception e){
+            responseEntity.failure(ResponseConstant.CODE_000,"发送短信验证码失败,请稍后重试");
+        }
+
+        return  responseEntity;
+    }
+
+	@IgnoreSecurity
+	@RequestMapping(value = "/login", method = RequestMethod.POST)
+    @ApiOperation(value = "账号短信验证码登录接口", httpMethod = "POST",  notes = "账号密码登录接口")
+    public ResponseEntity login(@RequestBody TrainLoginVo req) {
+        ResponseEntity responseEntity = new ResponseEntity();
+        Map<String, Object> data=new HashMap<String, Object>();
+        try {
+            //判断验证码是否正确
+            if(StringUtils.isBlank(req.getMobile())){
+                return responseEntity.failure(ResponseConstant.CODE_000,"请输入电话号码");
+            }
+            if(StringUtils.isBlank(req.getMsgCode())){
+                return responseEntity.failure(ResponseConstant.CODE_000,"请输入验证码");
+            }
+            responseEntity = trainService.confirmSms(req.getMobile().trim(),req.getMsgCode());
+            if(responseEntity.getCode().equals(ResponseConstant.CODE_999)){
+                //查询此手机用户是否存在,如果不存在则新增一个手机用户,默认密码123456
+                TrTrainPartUser user = trainService.getTrainUserByMobile(req.getMobile(),req.getLoginType());
+                if(Objects.isNull(user)){
+                    responseEntity.failure(ResponseConstant.CODE_500, "您手机号码学习次数或者考核次数也用光,不能再登录!");
+                    return  responseEntity;
+                }
+                if(StringUtils.isBlank(user.getName()) || user.getRoleType()==0 || StringUtils.isBlank(user.getSubject())){
+                    /**
+                     * 资料待补全
+                     */
+                    data.put("userStat",1);
+                }else{
+                    /**
+                     * 资料完善
+                     */
+                    data.put("userStat",2);
+                }
+                //创建token
+                data.put("accessToken",tokenManager.createToken("",user.getId(),"train"));
+                /**
+                 * 0,兼职 1管理员
+                 */
+                data.put("type",user.getManagerType());
+                data.put("roleType",user.getRoleType());
+                data.put("name",StringUtil.isEmpty(user.getName())?"":user.getName());
+                data.put("studyStat",user.getStudyStatus()<3?1:user.getStudyStatus()==3?2:user.getStudyStatus()==4?3:4);
+                responseEntity.success(data,"登录成功!");
+            }
+        } catch (Exception e) {
+            log.error("账号密码登录接口", e);
+            responseEntity.failure(ResponseConstant.CODE_500, "系统繁忙,请稍后重试");
+        }
+        return responseEntity;
+    }
+
+	@RequestMapping(value = "/fileList")
+    @ApiOperation(value = "自主学习-学习内容列表",   notes = "学习中心-学习内容列表")
+    public ResponseEntity fileList(@RequestParam(name = "accessToken") String accessToken,@RequestBody EditVO req) {
+        ResponseEntity responseEntity = new ResponseEntity();
+        Map<String, Object> data=new HashMap<String, Object>();
+        try {
+            String userId = tokenManager.getUserId(accessToken);
+            TrTrainPartUser tbLibManager = trainService.getUserById(userId);
+            if(tbLibManager==null) {
+            	responseEntity.failure("账号无身份权限");
+                return responseEntity;
+            }
+            if(req.getRoleType()==null || req.getRoleType()==0){
+                req.setRoleType(tbLibManager.getRoleType());
+            }
+            List<FileVO> list=trainService.findTrainFileList(userId,req.getRoleType());
+            data.put("list",list);
+            responseEntity.success(data, "查询成功");
+        } catch (Exception e) {
+            log.error("自主学习-选择身份接口", e);
+            responseEntity.failure(ResponseConstant.CODE_500, "系统繁忙,请稍后重试");
+        }
+        return responseEntity;
+    }
+    @RequestMapping(value = "/unlockFile")
+    @ApiOperation(value = "自主学习-解锁下一个",   notes = "自主学习-解锁下一个")
+    public ResponseEntity unlockFile(@RequestParam(name = "accessToken") String accessToken, @RequestBody FileIdVO vo) {
+        ResponseEntity responseEntity = new ResponseEntity();
+        Map<String, Object> data=new HashMap<String, Object>();
+        try {
+            String userId = tokenManager.getUserId(accessToken);
+            TrTrainPartUser user = trainService.getUserById(userId);
+
+            responseEntity = trainService.unlockNextFile(vo.getFileId(),user.getRoleType(),user.getSubject(),userId);
+        } catch (Exception e) {
+            log.error("自主学习-解锁下一个", e);
+            responseEntity.failure(ResponseConstant.CODE_500, "系统繁忙,请稍后重试");
+        }
+        return responseEntity;
+    }
+    @RequestMapping(value = "/startStudy")
+    @ApiOperation(value = "自主学习-开始学习",   notes = "自主学习-开始学习")
+    public ResponseEntity startStudy(@RequestParam(name = "accessToken") String accessToken) {
+        ResponseEntity responseEntity = new ResponseEntity();
+        try {
+            String userId = tokenManager.getUserId(accessToken);
+            TrTrainPartUser user = trainService.getUserById(userId);
+            trainService.startStudy(user.getRoleType(),user.getSubject(),userId);
+            responseEntity.success("成功");
+        } catch (Exception e) {
+            log.error("自主学习-开始学习接口", e);
+            responseEntity.failure(ResponseConstant.CODE_500, "系统繁忙,请稍后重试");
+        }
+        return responseEntity;
+    }
+    @RequestMapping(value = "/partTeacherList")
+    @ApiOperation(value = "老师列表",   notes = "老师列表")
+    public ResponseEntity partTeacherList(@RequestParam(name = "accessToken") String accessToken,@RequestBody TypeVO req) {
+        ResponseEntity responseEntity = new ResponseEntity();
+        try {
+            Map<String,Object> data = new HashMap<>(2);
+            String userId = tokenManager.getUserId(accessToken);
+            TrTrainPartUser user = trainService.getUserById(userId);
+            List<Map<String,Object>> list = trainService.partTeacherList(user.getRoleType(),user.getSubject(),req.getType());
+            data.put("list",list);
+            responseEntity.success(data,"获取老师列表成功");
+        } catch (Exception e) {
+            log.error("老师列表接口", e);
+            responseEntity.failure(ResponseConstant.CODE_500, "系统繁忙,请稍后重试");
+        }
+        return responseEntity;
+    }
+    @RequestMapping(value = "/studyAgain")
+    @ApiOperation(value = "重新学习",   notes = "重新学习")
+    public ResponseEntity studyAgain(@RequestParam(name = "accessToken") String accessToken,@RequestBody UserIdVO req) {
+        ResponseEntity responseEntity = new ResponseEntity();
+        try {
+            trainService.studyAgain(req.getUserId());
+            responseEntity.success("重新学习成功");
+        } catch (Exception e) {
+            log.error("重新学习接口", e);
+            responseEntity.failure(ResponseConstant.CODE_500, "重新学习解锁失败");
+        }
+        return responseEntity;
+    }
+    @RequestMapping(value = "/teacherAudit")
+    @ApiOperation(value = "考核",   notes = "考核")
+    public ResponseEntity teacherAudit(@RequestParam(name = "accessToken") String accessToken,@RequestBody AuditVO req) {
+        ResponseEntity responseEntity = new ResponseEntity();
+        try {
+            /**
+             * type = 1 通过 2 = 不通过
+             */
+
+            trainService.teacherAudit(req.getType(),req.getUserId());
+            responseEntity.success("操作成功");
+        } catch (Exception e) {
+            log.error("考核接口", e);
+            responseEntity.failure(ResponseConstant.CODE_500, "考核操作失败");
+        }
+        return responseEntity;
+    }
+
+    @RequestMapping(value = "/teacherInfoEdit")
+    @ApiOperation(value = "信息编辑保存",   notes = "信息编辑保存")
+    public ResponseEntity teacherInfoEdit(@RequestParam(name = "accessToken") String accessToken,@RequestBody EditVO req) {
+        ResponseEntity responseEntity = new ResponseEntity();
+        try {
+            String userId = tokenManager.getUserId(accessToken);
+
+            responseEntity =  trainService.teacherInfoEdit(userId,req.getName(),req.getRoleType(),req.getSubject());
+        } catch (Exception e) {
+            log.error("信息编辑保存接口", e);
+            responseEntity.failure(ResponseConstant.CODE_500, "信息编辑保存失败");
+        }
+        return responseEntity;
+    }
+
+    @RequestMapping("/upload")
+    @ResponseBody
+    public ResponseEntity uploadFile(@RequestParam(name = "accessToken") String accessToken,
+                                     @RequestParam("roleType") int roleType,
+                                     @RequestParam("fileIndex") int fileIndex,
+                                     @RequestParam("file") MultipartFile file) {
+        ResponseEntity responseEntity = new ResponseEntity();
+        Map<String, MultipartFile> fileList = new HashMap<>();
+        fileList.put("myFile",file);
+        try {
+            String userId = tokenManager.getUserId(accessToken);
+            TrTrainPartUser user = userServiceMapper.selectById(userId);
+            String filepath = "";
+            filepath= PropertiesUtil.getValue("file_save_path") + "/part/peixun/";
+            //文件信息入库
+            List<FileInfo> fileInfos = fileInfoService.uploadFile(userId, fileList, filepath);
+            if(fileInfos==null || fileInfos.size()==0){
+                responseEntity.failure(ResponseConstant.CODE_000, "上传文件失败");
+            }else{
+                FileInfo fileInfo = fileInfos.get(0);
+                Map<String, Object> data = new HashMap<String, Object>();
+                TrTrainFiles trainFiles = new TrTrainFiles();
+                int count = fileServiceMapper.selectCount(new QueryWrapper<TrTrainFiles>().eq("role_type",user.getRoleType()).eq("subject",user.getSubject()));
+                trainFiles.setCreateTime(new Date());
+                trainFiles.setFileIndex(count+1);
+                trainFiles.setFileName(fileInfo.getFileName());
+                trainFiles.setFileType(fileInfo.getFileExt());
+                trainFiles.setRoleType(user.getRoleType());
+                trainFiles.setFileUrl(fileInfo.getFilePath());
+                trainFiles.setSubject(user.getSubject());
+                fileServiceMapper.insert(trainFiles);
+                data.put("fileId", trainFiles.getId());
+                responseEntity.success(data, "上传文件成功 ");
+            }
+
+        }catch (Exception e){
+            responseEntity.failure(ResponseConstant.CODE_000, "上传文件失败");
+        }
+        return responseEntity;
+    }
+
+
+    @RequestMapping(value = "/replaceFile")
+    @ApiOperation(value = "替换文件",   notes = "替换文件")
+    public ResponseEntity replaceFile(@RequestParam(name = "accessToken") String accessToken,@RequestParam(name="fileId") String fileId,@RequestParam(name="file") MultipartFile file) {
+        ResponseEntity responseEntity = new ResponseEntity();
+        Map<String, MultipartFile> fileList = new HashMap<>();
+        fileList.put("myFile",file);
+        try {
+            String userId = tokenManager.getUserId(accessToken);
+            TrTrainFiles trainFiles = fileServiceMapper.selectById(fileId);
+            if(trainFiles == null){
+                return responseEntity.failure("文件不存在,请检查请求参数!");
+            }
+            String filepath =  PropertiesUtil.getValue("file_save_path") + "/part/peixun/";
+            //文件信息入库
+            List<FileInfo> fileInfos = fileInfoService.uploadFile(userId, fileList, filepath);
+            if(fileInfos==null || fileInfos.size()==0){
+                responseEntity.failure(ResponseConstant.CODE_000, "上传文件失败");
+            }else{
+                FileInfo fileInfo = fileInfos.get(0);
+                Map<String, Object> data = new HashMap<String, Object>();
+                //先删除原来的文件
+                fileInfoService.deleteByFilePath(trainFiles.getFileUrl());
+                //保存新的文件
+                trainFiles.setFileName(fileInfo.getFileName());
+                trainFiles.setFileType(fileInfo.getFileExt());
+                trainFiles.setFileUrl(fileInfo.getFilePath());
+                fileServiceMapper.updateById(trainFiles);
+                data.put("fileId", trainFiles.getId());
+                responseEntity.success(data, "替换文件成功 ");
+            }
+
+        }catch (Exception e){
+            responseEntity.failure(ResponseConstant.CODE_000, "替换文件失败");
+        }
+        return responseEntity;
+    }
+    @RequestMapping(value = "/deleteFile")
+    @ApiOperation(value = "删除文件",   notes = "删除文件")
+    public ResponseEntity deleteFile(@RequestParam(name = "accessToken") String accessToken,@RequestBody FileIdVO req) {
+        ResponseEntity responseEntity = new ResponseEntity();
+        try {
+            TrTrainFiles trainFiles = fileServiceMapper.selectById(req.getFileId());
+            if(trainFiles == null){
+                return responseEntity.failure("文件不存在,请检查请求参数!");
+            }
+            List<TrTrainFiles> afterList = fileServiceMapper.selectList(
+                    new QueryWrapper<TrTrainFiles>().eq("role_type",trainFiles.getRoleType())
+                            .eq("subject",trainFiles.getSubject())
+                            .gt("file_index",trainFiles.getFileIndex())
+                            .orderByAsc("file_index")
+            );
+            //删除磁盘文件
+            fileInfoService.deleteByFilePath(trainFiles.getFileUrl());
+            //删除记录
+            fileServiceMapper.deleteById(req.getFileId());
+            //更新排序
+            if(Objects.nonNull(afterList) && afterList.size()>0){
+                afterList.forEach(o->{
+                    o.setFileIndex(o.getFileIndex()-1);
+                    fileServiceMapper.updateById(o);
+                });
+            }
+            responseEntity.success("删除文件成功 ");
+
+        }catch (Exception e){
+            responseEntity.failure(ResponseConstant.CODE_000, "删除文件失败");
+        }
+        return responseEntity;
+    }
+
+    @ApiOperation(value = "退出登录")
+    @RequestMapping(value = "/logout", method = RequestMethod.POST)
+    public ResponseEntity logout(@RequestParam(name = "accessToken") String accessToken) {
+        ResponseEntity responseEntity = new ResponseEntity();
+        tokenManager.removeToken(accessToken, "train");
+        return responseEntity.success("成功");
+    }
+
+    @ApiOperation(value = "获取阿里云OSS上传securityToken,及文件后缀", httpMethod = "POST")
+    @RequestMapping(value = "/getOssfsTokenFileExt", method = RequestMethod.POST)
+    public ResponseEntity getOssfsToken(@RequestParam(name = "accessToken") String accessToken , @RequestBody OssfsTokenReq req) {
+        ResponseEntity responseEntity  =new  ResponseEntity();
+        try {
+            String userId = tokenManager.getUserId(accessToken);
+            Map<String,String>  stsMap= OSSUtils.getSTSSecurityToken();
+            String preffix = "";
+            if (StringUtils.isNotBlank(req.getMiddleDir())){
+                preffix  = "/" + req.getMiddleDir();
+            }
+            stsMap.put("uploadImgPath", preffix + DateHelper.formatDateByFormat(new Date(), "yyyy/MM/dd")+"/"+
+                    IdWorker.generateId()+req.getFileExt());
+
+
+            stsMap.put("bucket",PropertiesUtil.getValue("bucketName"));
+            //  stsMap.put("EndPoint","https://oss-cn-shenzhen.aliyuncs.com");
+
+            stsMap.put("endpoint",PropertiesUtil.getValue("img_url"));
+            stsMap.put("endpointOSS","https://"+PropertiesUtil.getValue("bucketName")+".oss-cn-shenzhen.aliyuncs.com");
+            responseEntity.success(stsMap,"成功");
+        } catch (Exception e) {
+            log.error("获取阿里云OSS上传securityToken", e);
+            responseEntity.failure(ResponseConstant.CODE_500, "暂未加载到数据,请稍后重试");
+        }
+        return responseEntity;
+    }
+}

+ 33 - 0
src/main/java/com/aijia/train/mapper/TrainAllMapper.java

@@ -0,0 +1,33 @@
+package com.aijia.train.mapper;
+
+import com.aijia.train.vo.FileVO;
+import org.apache.ibatis.annotations.Mapper;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.List;
+import java.util.Map;
+
+/**
+ * @author sh
+ * @className TrainAllMapper
+ * @description all
+ * @date 2021/7/26
+ */
+@Mapper
+public interface TrainAllMapper {
+    /**
+     * 查找学习列表
+     * @param userId
+     * @return
+     */
+    List<FileVO> findTrainFileList(@Param("userId") String userId,@Param("roleType") int roleType);
+
+    /**
+     * 查找兼职老师列表
+     * @param roleType 类型
+     * @param subject 科目
+     * @param type 状态类型
+     * @return
+     */
+    List<Map<String, Object>> partTeacherList(@Param("roleType") Integer roleType,@Param("subject") String subject,@Param("type") Integer type);
+}

+ 19 - 0
src/main/java/com/aijia/train/mapper/TrainFileServiceMapper.java

@@ -0,0 +1,19 @@
+package com.aijia.train.mapper;
+
+import com.aijia.train.bean.TrTrainFiles;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import org.apache.ibatis.annotations.Mapper;
+import org.apache.ibatis.annotations.Param;
+import org.apache.ibatis.annotations.Select;
+
+/**
+ * @author sh
+ * @className TrainFileServiceMapper
+ * @description file
+ * @date 2021/7/26
+ */
+@Mapper
+public interface TrainFileServiceMapper extends BaseMapper<TrTrainFiles> {
+    @Select("select * from tr_train_files where file_index=#{index} and role_type=#{roleType} and subject = #{subject}")
+    TrTrainFiles findNextFile(@Param("index")int index, @Param("roleType") Integer roleType, @Param("subject") String subject);
+}

+ 19 - 0
src/main/java/com/aijia/train/mapper/TrainUserExerciseMapper.java

@@ -0,0 +1,19 @@
+package com.aijia.train.mapper;
+
+import com.aijia.train.bean.TrTrainUserExercise;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import org.apache.ibatis.annotations.Mapper;
+import org.apache.ibatis.annotations.Param;
+import org.apache.ibatis.annotations.Select;
+
+/**
+ * @author sh
+ * @className TrainUserExerciseMapper
+ * @description ex
+ * @date 2021/7/29
+ */
+@Mapper
+public interface TrainUserExerciseMapper extends BaseMapper<TrTrainUserExercise> {
+    @Select("delete from  tr_train_user_exercise  where user_id = #{userId}")
+    void updateByUserId(@Param("userId") String userId);
+}

+ 20 - 0
src/main/java/com/aijia/train/mapper/TrainUserInfoServiceMapper.java

@@ -0,0 +1,20 @@
+package com.aijia.train.mapper;
+
+import com.aijia.train.bean.TrTrainUserInfo;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import org.apache.ibatis.annotations.Mapper;
+import org.apache.ibatis.annotations.Param;
+import org.apache.ibatis.annotations.Select;
+
+/**
+ * @author sh
+ * @className TrainUserInfoServcieMapper
+ * @description mapper
+ * @date 2021/7/26
+ */
+@Mapper
+public interface TrainUserInfoServiceMapper extends BaseMapper<TrTrainUserInfo> {
+
+    @Select("update tr_train_user_info set status = 2 where user_id = #{id}")
+    void updateByUserId(@Param("id") String id);
+}

+ 15 - 0
src/main/java/com/aijia/train/mapper/TrainUserQuestionKnowMapper.java

@@ -0,0 +1,15 @@
+package com.aijia.train.mapper;
+
+import com.aijia.train.bean.TrTrainUserQuestionKnow;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import org.apache.ibatis.annotations.Mapper;
+
+/**
+ * @author sh
+ * @className TrainUserQuestionKnowMapper
+ * @description know
+ * @date 2021/8/4
+ */
+@Mapper
+public interface TrainUserQuestionKnowMapper extends BaseMapper<TrTrainUserQuestionKnow> {
+}

+ 20 - 0
src/main/java/com/aijia/train/mapper/TrainUserServiceMapper.java

@@ -0,0 +1,20 @@
+package com.aijia.train.mapper;
+
+import com.aijia.train.bean.TrTrainPartUser;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import org.apache.ibatis.annotations.Mapper;
+import org.apache.ibatis.annotations.Param;
+import org.apache.ibatis.annotations.Select;
+
+/**
+ * @author sh
+ * @className TrainUserServiceMapper
+ * @description mapper
+ * @date 2021/7/26
+ */
+@Mapper
+public interface TrainUserServiceMapper extends BaseMapper<TrTrainPartUser> {
+    @Select("select * from tr_train_part_user where mobile=#{loginName} ")
+    TrTrainPartUser getTrainUserByMobile(@Param("loginName") String loginName);
+
+}

+ 99 - 0
src/main/java/com/aijia/train/service/ITrainService.java

@@ -0,0 +1,99 @@
+package com.aijia.train.service;
+
+import com.aijia.core.web.ResponseEntity;
+import com.aijia.train.bean.TrTrainPartUser;
+import com.aijia.train.vo.FileVO;
+
+import java.util.List;
+import java.util.Map;
+
+/**
+ * @author sh
+ * @className ITrainService
+ * @description service
+ * @date 2021/7/26
+ */
+public interface ITrainService {
+    /**
+     * 根据手机号码查找用户
+     * @param loginName
+     * @return
+     */
+    TrTrainPartUser getTrainUserByMobile(String loginName, int type);
+
+    /**
+     * 发送短信
+     * @param mobile
+     * @return
+     */
+    ResponseEntity sendSmsV2(String mobile);
+
+    /**
+     * 检查短信验证码是否正确
+     * @param trim
+     * @param msgCode
+     * @return
+     */
+    ResponseEntity confirmSms(String trim, String msgCode);
+
+    /**
+     * 根据id查找用户
+     * @param userId
+     * @return
+     */
+    TrTrainPartUser getUserById(String userId);
+
+    /**
+     * 根据用户id查找学习文件列表
+     * @param userId
+     * @return
+     */
+    List<FileVO> findTrainFileList(String userId,int roleType);
+
+    /**
+     * 解锁下个视频
+     * @param id
+     * @param roleType
+     * @param subject
+     */
+    ResponseEntity unlockNextFile(String id, Integer roleType, String subject,String userId);
+
+    /**
+     * 开始学习
+     * @param roleType
+     * @param subject
+     * @param userId
+     */
+    void startStudy(Integer roleType, String subject, String userId);
+
+    /**
+     * 查找各个状态的兼职老师
+     * @param roleType
+     * @param subject
+     * @param type
+     * @return
+     */
+    List<Map<String, Object>> partTeacherList(Integer roleType, String subject, Integer type);
+
+    /**
+     * 重新学习
+     * @param id
+     */
+    void studyAgain(String id);
+
+    /**
+     * 考核
+     * @param type
+     */
+    void teacherAudit(Integer type,String userId);
+
+    /**
+     * 编辑资料
+     * @param userId
+     * @param name
+     * @param roleType
+     * @param subject
+     * @return
+     */
+    ResponseEntity teacherInfoEdit(String userId, String name, Integer roleType, String subject);
+}

+ 264 - 0
src/main/java/com/aijia/train/service/impl/TrainServiceImpl.java

@@ -0,0 +1,264 @@
+package com.aijia.train.service.impl;
+
+import com.aijia.core.web.ResponseEntity;
+import com.aijia.kmt.service.TokenManager;
+import com.aijia.kmt.utils.AliyunSmsUtil;
+import com.aijia.kmt.utils.SystemResourceLocator;
+import com.aijia.train.bean.TrTrainFiles;
+import com.aijia.train.bean.TrTrainPartUser;
+import com.aijia.train.bean.TrTrainUserInfo;
+import com.aijia.train.mapper.*;
+import com.aijia.train.service.ITrainService;
+import com.aijia.train.vo.FileVO;
+import com.aliyuncs.dysmsapi.model.v20170525.SendSmsResponse;
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import org.apache.commons.lang3.StringUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import java.util.Date;
+import java.util.List;
+import java.util.Map;
+import java.util.Objects;
+
+/**
+ * @author sh
+ * @className TrainServiceImpl
+ * @description serviceImpl
+ * @date 2021/7/26
+ */
+@Service
+public class TrainServiceImpl implements ITrainService {
+
+    @Autowired
+    private TrainUserServiceMapper userServiceMapper;
+
+    @Autowired
+    private TokenManager tokenManager;
+
+    @Autowired
+    private TrainAllMapper allMapper;
+
+    @Autowired
+    private TrainFileServiceMapper fileServiceMapper;
+
+    @Autowired
+    private TrainUserInfoServiceMapper userInfoServiceMapper;
+
+    @Autowired
+    private TrainUserExerciseMapper userExerciseMapper;
+
+    @Override
+    public TrTrainPartUser getTrainUserByMobile(String loginName, int type) {
+        TrTrainPartUser user = userServiceMapper.getTrainUserByMobile(loginName);
+        if(Objects.isNull(user)){
+            user = new TrTrainPartUser();
+            user.setMobile(loginName);
+            user.setStatus(1);
+            user.setCreateTime(new Date());
+            user.setRoleType(0);
+            user.setManagerType(type);
+            userServiceMapper.insert(user);
+        }else{
+            if(user.getStatus() == 2){
+                user = null;
+            }
+        }
+        return user;
+    }
+
+    @Override
+    public ResponseEntity sendSmsV2(String phoneNumber) {
+        ResponseEntity responseEntity = new ResponseEntity();
+        try {
+            //获取6位随机验证码
+            String code = AliyunSmsUtil.getRandNum();
+            //所有验证码使用通用验证码:验证码${code},若非本人操作,请勿泄露。
+            SendSmsResponse sm = AliyunSmsUtil.sendSms(phoneNumber, code,"SMS_175541171");
+            if("ok".equals(sm.getCode().toLowerCase())){
+                //发送成功后 60秒内不重新发送
+                tokenManager.setString("trainRepeatCode_".concat(phoneNumber), code, 60);
+                //五分钟后失效
+                tokenManager.setString("trainCacheCode_".concat(phoneNumber), code, 300);
+                responseEntity.success("验证码发送成功");
+            }else{
+                responseEntity.failure("验证码发送失败,".concat(sm.getMessage()));
+            }
+        }catch (Exception e){
+            responseEntity.failure("验证码发送失败,请稍后重新获取");
+        }
+
+        return responseEntity;
+    }
+
+    @Override
+    public ResponseEntity confirmSms(String phoneNumber, String code) {
+        ResponseEntity responseEntity = new ResponseEntity();
+        //判断是否是测试环境,如果是测试环境则跳过验证码校验
+        String sysEnv = (String) SystemResourceLocator.getValue("SYS_ENV");
+        String correctCode;
+        if("2".equals(sysEnv)) {
+            correctCode = code;
+        }else {
+            correctCode = tokenManager.getString("trainCacheCode_".concat(phoneNumber));
+        }
+        if (StringUtils.isBlank(correctCode)) {
+            responseEntity.failure("该验证码已经失效,请重新获取");
+        } else {
+            if (correctCode.equals(code)) {
+                responseEntity.success("校验成功");
+                //移除缓存
+                tokenManager.delString("trainCacheCode_".concat(phoneNumber));
+            } else {
+                responseEntity.failure("验证码不正确,请重新输入");
+            }
+        }
+        return responseEntity;
+    }
+
+    @Override
+    public TrTrainPartUser getUserById(String userId) {
+        return userServiceMapper.selectById(userId);
+    }
+
+    @Override
+    public List<FileVO> findTrainFileList(String userId,int roleType) {
+        return allMapper.findTrainFileList(userId,roleType);
+    }
+
+    @Override
+    public ResponseEntity unlockNextFile(String id, Integer roleType, String subject,String userId) {
+        ResponseEntity responseEntity = new ResponseEntity();
+        TrTrainFiles files = fileServiceMapper.selectById(id);
+        //查看本文件是否解锁
+        TrTrainUserInfo info = userInfoServiceMapper.selectOne(
+                new QueryWrapper<TrTrainUserInfo>().eq("user_id",userId)
+                        .eq("file_id",id)
+        );
+        if(Objects.isNull(info)){
+            return  responseEntity.failure("不能跳过顺序解锁学习进度!");
+        }
+        //查找下一个文件
+        TrTrainFiles nextFiles = fileServiceMapper.findNextFile(files.getFileIndex()+1,roleType,subject);
+        if(Objects.isNull(nextFiles)){
+            //是最后一个文件,进入到考核阶段。改变用户状态
+            TrTrainPartUser user = userServiceMapper.selectById(userId);
+            user.setStudyStatus(3);
+            userServiceMapper.updateById(user);
+        }
+        if(Objects.nonNull(nextFiles)){
+            saveUserInfoData(nextFiles.getId(),roleType,subject,userId);
+        }
+        return  responseEntity.success("解锁成功");
+
+    }
+
+    @Override
+    public void startStudy(Integer roleType, String subject, String userId) {
+        TrTrainFiles firstFiles = fileServiceMapper.findNextFile(1,roleType,subject);
+        if(Objects.nonNull(firstFiles)) {
+            saveUserInfoData(firstFiles.getId(), roleType, subject, userId);
+        }
+    }
+
+    @Override
+    public List<Map<String, Object>> partTeacherList(Integer roleType, String subject, Integer type) {
+        return allMapper.partTeacherList(roleType,subject,type);
+    }
+
+    @Override
+    public void studyAgain(String id) {
+        /**
+         * 更新状态为学习中,学习次数+1
+         */
+        TrTrainPartUser user = userServiceMapper.selectById(id);
+        user.setStudyStatus(1);
+        user.setStudyTimes(1);
+        userServiceMapper.updateById(user);
+        //重新学习,更新学习记录为无效
+        userInfoServiceMapper.updateByUserId(id);
+
+        //插入重新学习记录
+        this.startStudy(user.getRoleType(),user.getSubject(),user.getId());
+    }
+
+    @Override
+    public void teacherAudit(Integer type,String userId) {
+        TrTrainPartUser user = userServiceMapper.selectById(userId);
+        if(type == 1){
+            //审核通过
+            user.setStudyStatus(5);
+            userServiceMapper.updateById(user);
+        }else{
+            userInfoServiceMapper.updateByUserId(userId);
+            userExerciseMapper.updateByUserId(userId);
+            //审核不通过
+            if(user.getCheckTimes() == 1){
+                //两次不通过
+                user.setCheckTimes(2);
+                user.setStatus(2);
+                user.setStudyStatus(6);
+            }else{
+                //重新学习
+                user.setStudyStatus(1);
+                user.setCheckTimes(1);
+            }
+            userServiceMapper.updateById(user);
+            if(user.getCheckTimes() == 1){
+                this.startStudy(user.getRoleType(),user.getSubject(),user.getId());
+            }
+        }
+    }
+
+    @Override
+    public ResponseEntity teacherInfoEdit(String userId, String name, Integer roleType, String subject) {
+        ResponseEntity responseEntity = new ResponseEntity();
+        TrTrainPartUser user = userServiceMapper.selectById(userId);
+        if(user.getStudyStatus()>3){
+            //考核中
+            return  responseEntity.failure("当前处于考核阶段资料料不不可更更改");
+        }
+        //判断角色等是否发生更改
+        if(StringUtils.isBlank(user.getSubject())){
+            //新用户完善资料
+            user.setSubject(subject);
+            user.setRoleType(roleType);
+            user.setName(name);
+            userServiceMapper.updateById(user);
+            return responseEntity.success("完善信息成功!");
+        }
+        //老用户判断是否有修改资料
+        if(!subject.equals(user.getSubject()) || !roleType.equals(user.getRoleType())){
+            //清空学习状态,重新学习
+            user.setStudyStatus(1);
+            user.setSubject(subject);
+            user.setRoleType(roleType);
+            user.setName(name);
+            userServiceMapper.updateById(user);
+            //重新学习,更新学习记录为无效
+            userInfoServiceMapper.updateByUserId(userId);
+
+            //插入重新学习记录
+            this.startStudy(user.getRoleType(),user.getSubject(),user.getId());
+        }
+        return responseEntity.success("完善信息成功!");
+    }
+
+    private void saveUserInfoData(String id,int roleType,String subject,String userId){
+        TrTrainUserInfo info = userInfoServiceMapper.selectOne(
+                new QueryWrapper<TrTrainUserInfo>().eq("user_id",userId)
+                .eq("file_id",id)
+        );
+        if(Objects.isNull(info)){
+            info = new TrTrainUserInfo();
+            info.setFileId(id);
+            info.setCreateTime(new Date());
+            info.setRoleType(roleType);
+            info.setSubject(subject);
+            info.setUserId(userId);
+            info.setStatus(1);
+            userInfoServiceMapper.insert(info);
+        }
+
+    }
+}

+ 31 - 0
src/main/java/com/aijia/train/vo/AuditVO.java

@@ -0,0 +1,31 @@
+package com.aijia.train.vo;
+
+import com.aijia.core.web.BaseRequest;
+
+/**
+ * @author sh
+ * @className TypeVO
+ * @description idvo
+ * @date 2021/7/26
+ */
+public class AuditVO extends BaseRequest {
+
+    private Integer type;
+    private String userId;
+
+    public Integer getType() {
+        return type;
+    }
+
+    public void setType(Integer type) {
+        this.type = type;
+    }
+
+    public String getUserId() {
+        return userId;
+    }
+
+    public void setUserId(String userId) {
+        this.userId = userId;
+    }
+}

+ 42 - 0
src/main/java/com/aijia/train/vo/EditVO.java

@@ -0,0 +1,42 @@
+package com.aijia.train.vo;
+
+import com.aijia.core.web.BaseRequest;
+
+/**
+ * @author sh
+ * @className EditVO
+ * @description EditVO
+ * @date 2021/7/26
+ */
+public class EditVO extends BaseRequest {
+
+    private String subject;
+
+    private Integer roleType;
+
+    private String name;
+
+    public String getSubject() {
+        return subject;
+    }
+
+    public void setSubject(String subject) {
+        this.subject = subject;
+    }
+
+    public Integer getRoleType() {
+        return roleType;
+    }
+
+    public void setRoleType(Integer roleType) {
+        this.roleType = roleType;
+    }
+
+    public String getName() {
+        return name;
+    }
+
+    public void setName(String name) {
+        this.name = name;
+    }
+}

+ 53 - 0
src/main/java/com/aijia/train/vo/FileIdVO.java

@@ -0,0 +1,53 @@
+package com.aijia.train.vo;
+
+import com.aijia.core.web.BaseRequest;
+import org.springframework.web.multipart.MultipartFile;
+
+/**
+ * @author sh
+ * @className FileIdVO
+ * @description idvo
+ * @date 2021/7/26
+ */
+public class FileIdVO extends BaseRequest {
+
+    private String fileId;
+
+    private Integer fileIndex;
+    private Integer roleType;
+
+
+    private MultipartFile file;
+
+    public String getFileId() {
+        return fileId;
+    }
+
+    public void setFileId(String fileId) {
+        this.fileId = fileId;
+    }
+
+    public MultipartFile getFile() {
+        return file;
+    }
+
+    public void setFile(MultipartFile file) {
+        this.file = file;
+    }
+
+    public Integer getFileIndex() {
+        return fileIndex;
+    }
+
+    public void setFileIndex(Integer fileIndex) {
+        this.fileIndex = fileIndex;
+    }
+
+    public Integer getRoleType() {
+        return roleType;
+    }
+
+    public void setRoleType(Integer roleType) {
+        this.roleType = roleType;
+    }
+}

+ 97 - 0
src/main/java/com/aijia/train/vo/FileVO.java

@@ -0,0 +1,97 @@
+package com.aijia.train.vo;
+
+/**
+ * @author sh
+ * @className FileVO
+ * @description file
+ * @date 2021/7/26
+ */
+public class FileVO {
+
+    private String id;
+
+    /**
+     * 文件名
+     */
+    private String fileName;
+    /**
+     * 文件类型
+     */
+    private String fileType;
+    /**
+     * 文件路径
+     */
+    private String fileUrl;
+    /**
+     * 是否解锁 1已解锁 2未解锁
+     */
+    private Integer locking;
+
+    /**
+     * 文件顺序
+     */
+    private Integer fileIndex;
+
+    /**
+     * 是否超时 0正常 1超时
+     */
+    private Integer overTimeStat;
+
+    public String getFileName() {
+        return fileName;
+    }
+
+    public void setFileName(String fileName) {
+        this.fileName = fileName;
+    }
+
+    public String getFileType() {
+        return fileType;
+    }
+
+    public void setFileType(String fileType) {
+        this.fileType = fileType;
+    }
+
+    public String getFileUrl() {
+        return fileUrl;
+    }
+
+    public void setFileUrl(String fileUrl) {
+        this.fileUrl = fileUrl;
+    }
+
+
+    public String getId() {
+        return id;
+    }
+
+    public void setId(String id) {
+        this.id = id;
+    }
+
+    public Integer getLocking() {
+        return locking;
+    }
+
+    public void setLocking(Integer locking) {
+        this.locking = locking;
+    }
+
+    public void setFileIndex(Integer fileIndex) {
+        this.fileIndex = fileIndex;
+    }
+
+    public Integer getOverTimeStat() {
+        return overTimeStat;
+    }
+
+    public void setOverTimeStat(Integer overTimeStat) {
+        this.overTimeStat = overTimeStat;
+    }
+
+
+    public Integer getFileIndex() {
+        return fileIndex;
+    }
+}

+ 32 - 0
src/main/java/com/aijia/train/vo/OssfsTokenReq.java

@@ -0,0 +1,32 @@
+package com.aijia.train.vo;
+
+import io.swagger.annotations.ApiModelProperty;
+import org.hibernate.validator.constraints.NotBlank;
+
+
+public class OssfsTokenReq {
+
+    private static final long serialVersionUID = 1L;
+    @NotBlank(message="文件后缀不能为空")
+    @ApiModelProperty(name = "fileExt", value = "文件后缀", required = true)
+    private String fileExt;
+
+    @ApiModelProperty(name = "middleDir", value = "文件存放位置中间部分", required = false)
+    private String middleDir;
+
+    public String getFileExt() {
+        return fileExt;
+    }
+
+    public void setFileExt(String fileExt) {
+        this.fileExt = fileExt;
+    }
+
+    public String getMiddleDir() {
+        return middleDir;
+    }
+
+    public void setMiddleDir(String middleDir) {
+        this.middleDir = middleDir;
+    }
+}

+ 42 - 0
src/main/java/com/aijia/train/vo/TrainLoginVo.java

@@ -0,0 +1,42 @@
+package com.aijia.train.vo;
+
+
+import com.aijia.core.web.BaseRequest;
+
+public class TrainLoginVo extends BaseRequest {
+	
+	private static final long serialVersionUID = 1L;
+	
+	private String mobile;
+	
+	private String msgCode;
+
+	/**
+	 * 0-兼职登录 1管理员登录
+	 */
+	private Integer loginType;
+
+	public String getMobile() {
+		return mobile;
+	}
+
+	public void setMobile(String mobile) {
+		this.mobile = mobile;
+	}
+
+	public String getMsgCode() {
+		return msgCode;
+	}
+
+	public void setMsgCode(String msgCode) {
+		this.msgCode = msgCode;
+	}
+
+	public Integer getLoginType() {
+		return loginType;
+	}
+
+	public void setLoginType(Integer loginType) {
+		this.loginType = loginType;
+	}
+}

+ 22 - 0
src/main/java/com/aijia/train/vo/TypeVO.java

@@ -0,0 +1,22 @@
+package com.aijia.train.vo;
+
+import com.aijia.core.web.BaseRequest;
+
+/**
+ * @author sh
+ * @className TypeVO
+ * @description idvo
+ * @date 2021/7/26
+ */
+public class TypeVO extends BaseRequest {
+
+    private Integer type;
+
+    public Integer getType() {
+        return type;
+    }
+
+    public void setType(Integer type) {
+        this.type = type;
+    }
+}

+ 22 - 0
src/main/java/com/aijia/train/vo/UserIdVO.java

@@ -0,0 +1,22 @@
+package com.aijia.train.vo;
+
+import com.aijia.core.web.BaseRequest;
+
+/**
+ * @author sh
+ * @className FileIdVO
+ * @description idvo
+ * @date 2021/7/26
+ */
+public class UserIdVO extends BaseRequest {
+
+    private String userId;
+
+    public String getUserId() {
+        return userId;
+    }
+
+    public void setUserId(String userId) {
+        this.userId = userId;
+    }
+}

+ 468 - 0
src/main/java/com/aijia/utils/AIServiceUtils.java

@@ -0,0 +1,468 @@
+package com.aijia.utils;
+
+import com.alibaba.fastjson.JSON;
+import com.alibaba.fastjson.JSONArray;
+import com.alibaba.fastjson.JSONObject;
+import org.apache.http.HttpResponse;
+import org.apache.http.util.EntityUtils;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.Map;
+
+/**
+ * @author yangcan
+ * 类描述:AI识别服务调用工具类
+ * 创建时间:2018年12月26日 下午2:58:57
+
+ */
+public class AIServiceUtils {
+	private static Logger logger = LoggerFactory.getLogger(AIServiceUtils.class);
+
+//	todo 改内网
+	//public static String AI_SERVICE_URL = "http://47.107.225.239:6000";
+	public static String AI_SERVICE_URL = "http://47.119.130.96:6000";
+	
+//	public static String AI_SERVICE_URL = "http://172.18.30.204:6000";
+
+//	private static String AI_KOUSUAN_URL = "http://120.79.54.35:6000";
+	public static String AI_KOUSUAN_URL = "http://172.18.132.214:6000";
+
+
+	/**
+	 * @param filePath
+	 * @return
+	 * @throws Exception
+	
+	 * 方法说明:算数计算识别对错
+	
+	 * 创立日期:2018年12月26日 下午3:35:36
+	 * 创建人:yangcan
+	
+	 */
+	public static String calculateAI(String filePath, String ossPath) throws Exception {
+		String result = null;
+		Map<String, String> querys=new HashMap<String, String>();
+    	querys.put("file_path", filePath);
+    	querys.put("oss_path", ossPath);
+    	HttpResponse response = HttpUtils.doPost(AI_KOUSUAN_URL, "/",
+    			"POST", 
+    			new HashMap<String, String>(),
+    			new HashMap<String, String>(),
+				JSON.toJSONString(querys)
+    			);
+//		System.out.println(response);
+    	if(response.getStatusLine().getStatusCode()==200){
+    		result = EntityUtils.toString(response.getEntity());
+    		if(!"Error".equals(result)){
+    			return result;
+    		}else{
+    			return null;
+    		}
+    	}
+    	return result;
+	}
+	
+	/**
+	 * @param filePath
+	 * @return
+	 * @throws Exception
+	
+	 * 方法说明:答题卡识别(废弃)  返参:{ “Wrong_No.”: [0. 0. 0. 0. 0. 1. 1. 1. 1. 0. 0. 0. 0. 0. 1.]}
+	 * 创立日期:2018年12月26日 下午3:40:42
+	 * 创建人:yangcan
+	
+	 */
+//	public static String answerDetectAI(String filePath) throws Exception {
+//		String result = null;
+//		Map<String,String> querys=new HashMap<String, String>();
+//    	querys.put("file_path", filePath);
+//    	HttpResponse response = HttpUtils.doPost("http://47.112.205.102:8080", "/AnswerDetect",
+//    			"POST", 
+//    			new HashMap<String, String>(), 
+//    			new HashMap<String, String>(), 
+//    			querys
+//    			);
+//    	if(response.getStatusLine().getStatusCode()==200){
+//    		result = EntityUtils.toString(response.getEntity());
+//    		if(!"Error".equals(result)){
+//    			return result;
+//    		}else{
+//    			return null;
+//    		}
+//    	}
+//    	return result;
+//	}
+
+	/**
+	 * @param querys
+	 * @return
+	 * @throws Exception
+
+	 * 方法说明:以题搜题
+
+	 * 创立日期:2018年12月26日 下午3:35:36
+	 * 创建人:yangcan
+
+	 */
+	public static String recognitionExerciseBook (Map<String, Object> querys) throws Exception {
+		String result = null;
+		HttpResponse response = HttpUtils.doPost(AI_SERVICE_URL, "/query",
+				"POST",
+				Collections.emptyMap(),
+				Collections.emptyMap(),
+				JSON.toJSONString(querys)
+		);
+
+
+		logger.info("请求ai返回{}", JSON.toJSONString(response));
+		if(response.getStatusLine().getStatusCode()==200){
+			result = EntityUtils.toString(response.getEntity());
+			if(!"Error".equals(result)){
+				return result;
+			}else{
+				return null;
+			}
+		}
+		return result;
+	}
+
+
+	/**
+	 * @param querys
+	 * @return
+	 * @throws Exception
+
+	 * 方法说明:组卷搜题
+
+	 * 创立日期:2018年12月26日 下午3:35:36
+	 * 创建人:yangcan
+
+	 */
+	public static String recognitionExamPaper (Map<String, Object> querys) throws Exception {
+		String result = null;
+		HttpResponse response = HttpUtils.doPost(AI_SERVICE_URL, "/query_paper",
+				"POST",
+				Collections.emptyMap(),
+				Collections.emptyMap(),
+				JSON.toJSONString(querys)
+		);
+
+
+		logger.info("请求ai返回{}", JSON.toJSONString(response));
+		if(response.getStatusLine().getStatusCode()==200){
+			result = EntityUtils.toString(response.getEntity());
+			if(!"Error".equals(result)){
+				return result;
+			}else{
+				return null;
+			}
+		}
+		return result;
+	}
+
+    /**
+     * 通知AI更新试卷
+     * @param querys
+     * @return
+     * @throws Exception
+     */
+    public static String notifyAIUpdateExaminationPaper (Map<String, Object> querys) throws Exception {
+        String result = null;
+        HttpResponse response = HttpUtils.doPost(AI_SERVICE_URL, "/notifyAIUpdateExaminationPaper",
+                "POST",
+                Collections.emptyMap(),
+                Collections.emptyMap(),
+                JSON.toJSONString(querys)
+        );
+
+
+        logger.info("请求ai返回{}", JSON.toJSONString(response));
+        if(response.getStatusLine().getStatusCode()==200){
+            result = EntityUtils.toString(response.getEntity());
+            if(!"Error".equals(result)){
+                return result;
+            }else{
+                return null;
+            }
+        }
+        return result;
+    }
+	/**
+	 * @param querys
+	 * @return
+	 * @throws Exception
+
+	 * 方法说明: 使用oss网络图片请求识别练习册的接口
+
+	 * 创立日期:2019年10月22日
+	 * 创建人:chchen
+
+	 */
+	public static String recognitionExerciseBookV1 (Map<String, String> querys) throws Exception {
+		String result = null;
+		HttpResponse response = HttpUtils.doPost(AI_SERVICE_URL, "/query_via_oss",
+				"POST",
+				new HashMap<String, String>(),
+				new HashMap<String, String>(),
+				querys
+		);
+
+		logger.info("请求ai返回{}", JSON.toJSONString(response));
+		if(response.getStatusLine().getStatusCode()==200){
+			result = EntityUtils.toString(response.getEntity());
+			if(!"Error".equals(result)){
+				return result;
+			}else{
+				return null;
+			}
+		}
+		return result;
+	}
+
+	/**
+	 * @param querys
+	 * @return
+	 * @throws Exception
+
+	 * 方法说明: 使用oss网络图片请求识别练习册的接口
+
+	 * 创立日期:2019年10月22日
+	 * 创建人:chchen
+
+	 */
+	public static String recognitionExerciseBookV2 (Map<String, String> querys) throws Exception {
+		String result = null;
+		HttpResponse response = HttpUtils.doPost(AI_SERVICE_URL, "/querySimilarQuestionAsync",
+				"POST",
+				new HashMap<String, String>(),
+				new HashMap<String, String>(),
+				querys
+		);
+
+		logger.info("请求ai返回{}", JSON.toJSONString(response));
+		if(response.getStatusLine().getStatusCode()==200){
+			result = EntityUtils.toString(response.getEntity());
+			if(!"Error".equals(result)){
+				return result;
+			}else{
+				return null;
+			}
+		}
+		return result;
+	}
+
+
+	/**
+	 * @param querys
+	 * @return
+	 * @throws Exception
+
+	 * 方法说明: 查询相似题
+
+	 * 创立日期:2019年10月22日
+	 * 创建人:chchen
+
+	 */
+	public static String querySimilarQuestion (Map<String, String> querys) throws Exception {
+		String result = null;
+		HttpResponse response = HttpUtils.doPost(AI_SERVICE_URL, "/querySimilarQuestion",
+				"POST",
+				new HashMap<String, String>(),
+				new HashMap<String, String>(),
+				querys
+		);
+
+		logger.info("请求ai返回{}", JSON.toJSONString(response));
+		if(response.getStatusLine().getStatusCode()==200){
+			result = EntityUtils.toString(response.getEntity());
+			if(!"Error".equals(result)){
+				return result;
+			}else{
+				return null;
+			}
+		}
+		return result;
+	}
+
+	/**
+	 * @param
+	 * @return 
+	 * 方法说明:ai图片识别文本内容
+	 * 创建时间:2019/7/12 11:27
+	 * @author yangcan
+	 */
+	public static String discernPicture(String filePath) throws Exception {
+		String result = null;
+		Map<String, String> querys = new HashMap<String, String>();
+		querys.put("file_path", filePath);
+		HttpResponse response = HttpUtils.doPost(AI_SERVICE_URL, "/discernPicture",
+				"POST",
+				new HashMap<String, String>(),
+				new HashMap<String, String>(),
+				querys
+		);
+		if(response.getStatusLine().getStatusCode()==200){
+			result = EntityUtils.toString(response.getEntity());
+			if(!"Error".equals(result)){
+				JSONObject jsonObject = JSON.parseObject(result);
+				if ("success".equals(jsonObject.getString("status"))){
+					StringBuffer sb = new StringBuffer();
+					JSONArray contentArray = jsonObject.getJSONObject("data").getJSONArray("content");
+					for (int i = 0; i < contentArray.size(); i++) {
+						sb.append(contentArray.get(i).toString());
+					}
+					return sb.toString();
+				}
+			}else{
+				return null;
+			}
+		}
+		return result;
+	}
+	
+	public static void main(String[] args) {
+		try {
+			Map<String, String> querys = new HashMap<>();
+			querys.put("path", "/www/files/data/upload/2020/04/13/e8656971b1634bad87354e9eaf4d4c90.png");
+			querys.put("ossPath", "https://img-sharingschool.oss-cn-shenzhen-internal.aliyuncs.com/2020/04/13/e8656971b1634bad87354e9eaf4d4c90.png");
+			querys.put("subject", "数学");
+			querys.put("grade", "二年级下册");
+			querys.put("version", "");
+			querys.put("mode", "question");
+			long begin = System.currentTimeMillis();
+			String result = AIServiceUtils.recognitionExerciseBookV1(querys);
+			long end = System.currentTimeMillis();
+			System.out.println((end - begin)/1000);
+			System.out.println(result);
+		} catch (Exception e) {
+			e.printStackTrace();
+		}
+
+		System.out.println("线程1开始");
+
+//		try {
+//			Map<String, String> querys = new HashMap<>();
+//			querys.put("path", "/www/files/xtdata/upload/2019/12/11/57f77089f0a14404ab671934ac052b85.jpg");
+//			querys.put("ossPath", "https://xt-sharingschool.oss-cn-shenzhen-internal.aliyuncs.com/2019/12/11/57f77089f0a14404ab671934ac052b85.jpg");
+//			querys.put("subject", "");
+//			querys.put("grade", "");
+////			querys.put("version", "");
+////			querys.put("mode", "question");
+//			System.out.println(JSONObject.toJSON(querys));
+//			long begin = System.currentTimeMillis();
+//			String result = AIServiceUtils.querySimilarQuestion(querys);
+//			long end = System.currentTimeMillis();
+//			System.out.println((end - begin)/1000);
+//			System.out.println(result);
+//		} catch (Exception e) {
+//			e.printStackTrace();
+//		}
+
+//		try {
+//			Map<String, String> querys = new HashMap<>();
+//			querys.put("path", "/www/files/xtdata/upload/2019/12/11/57f77089f0a14404ab671934ac052b85.jpg");
+//			querys.put("ossPath", "https://xt-sharingschool.oss-cn-shenzhen-internal.aliyuncs.com/2019/12/11/57f77089f0a14404ab671934ac052b85.jpg");
+//			querys.put("subject", "");
+//			querys.put("grade", "");
+////			querys.put("version", "");
+////			querys.put("mode", "question");
+//			System.out.println(JSONObject.toJSON(querys));
+//			long begin = System.currentTimeMillis();
+//			String result = AIServiceUtils.querySimilarQuestion(querys);
+//			long end = System.currentTimeMillis();
+//			System.out.println((end - begin)/1000);
+//			System.out.println(result);
+//		} catch (Exception e) {
+//			e.printStackTrace();
+//		}
+
+//        try {
+//            String url = "https://xt.sharingschool.com/sz/api/common/common/uploadForm";
+//            String filePath = "/images/111.png";
+//
+//            RestTemplate rest = new RestTemplate();
+//            FileSystemResource resource = new FileSystemResource(new File(filePath));
+//            MultiValueMap<String, Object> param = new LinkedMultiValueMap<>();
+//            param.add("files", resource);
+//            param.add("accessToken", "FBA31BBCFBDA43ECA57317D384E2FFB9");
+//
+//            String string = rest.postForObject(url, param, String.class);
+//
+//            JSONObject jo = JSONObject.parseObject(string);
+//
+//            String str = jo.getJSONObject("data").getJSONArray("pics").getJSONObject(0).getString("filePath");
+//            System.out.println(str);
+//
+//            Map<String, String> querys = new HashMap<>();
+//			querys.put("path", "/www/files/xtdata/upload" + str);
+//			querys.put("subject", "语文");
+//			querys.put("grade", "六年级上册");
+//			querys.put("version", "");
+//			querys.put("mode", "question");
+//			long begin = System.currentTimeMillis();
+//			String result = AIServiceUtils.recognitionExerciseBook(querys);
+//			long end = System.currentTimeMillis();
+//			System.out.println((end - begin)/1000);
+//			System.out.println(result);
+//
+//        } catch (Exception e){
+//            e.printStackTrace();
+//        }
+
+
+//		System.out.println("----------------------------------------------------------------");
+//		String path = "/www/files/data/upload/2020/01/16/231e263a201e4d5a81aa0a0deed8019a.jpg";
+//        //String path = "";
+//		String ossPath = "https://img.sharingschool.com/2020/01/16/231e263a201e4d5a81aa0a0deed8019a.jpg";
+//		try{
+//			long begin = System.currentTimeMillis();
+//			String result = AIServiceUtils.calculateAI(path, ossPath);
+//			long end = System.currentTimeMillis();
+//			System.out.println((end - begin)/1000);
+//			System.out.println("返回结果:"+result);
+//		} catch (Exception e){
+//			e.printStackTrace();
+//		}
+	}
+
+	/**
+	 * 根据知识点推荐题目,每个知识点推荐指定数量的题目(以大题为单位),每道大题下的小题数量需要做限制(语文、数学科目小于等于3道,英语不限),
+	 * 相似度规则优先于题目数量限制(如果某知识点下只有两道题,但不符合相似度规则,只能二选一)
+	 *
+	 * @param bodyMap post请求的body参数
+	 * @return 查询结果
+	 */
+	public static JSONObject queryTrainingRecommendedQuestions(Map<String, Object> bodyMap) {
+		try {
+			HttpResponse response = HttpUtils.doPost(AI_SERVICE_URL, "/queryTrainingRecommendedQuestions",
+					"POST",
+					Collections.emptyMap(),
+					Collections.emptyMap(),
+					JSON.toJSONString(bodyMap)
+			);
+
+			if (response.getStatusLine().getStatusCode() != 200) {
+				logger.info("调用AI提分训练题目推荐接口失败,bodyMap={},response={}", JSON.toJSONString(bodyMap), JSON.toJSONString(response));
+				return null;
+			}
+			String result = EntityUtils.toString(response.getEntity());
+			if ("Error".equals(result)) {
+				logger.info("调用AI提分训练题目推荐接口失败,bodyMap={},result=Error", JSON.toJSONString(bodyMap));
+				return null;
+			}
+			JSONObject resultMap = JSON.parseObject(result);
+			if (!"success".equals(resultMap.getString("status"))) {
+				logger.info("调用AI提分训练题目推荐接口失败,result={}", result);
+				return null;
+			}
+			return resultMap.getJSONObject("data");
+		} catch (Exception e) {
+			logger.error("bodyMap={}", JSON.toJSONString(bodyMap));
+			logger.error("调用AI提分训练题目推荐接口异常", e);
+		}
+		return null;
+	}
+}

+ 137 - 0
src/main/java/com/aijia/utils/CodecUtil.java

@@ -0,0 +1,137 @@
+package com.aijia.utils;
+
+import org.apache.commons.codec.binary.Base64;
+import org.apache.commons.codec.digest.DigestUtils;
+import org.apache.commons.lang3.RandomStringUtils;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import java.io.UnsupportedEncodingException;
+import java.net.URLDecoder;
+import java.net.URLEncoder;
+import java.util.UUID;
+
+/**
+ * 
+ * 类名称:CodecUtil<br>
+ * 类描述:编码与解码操作工具类<br>
+ * 
+ * @version v1.0
+ *
+ */
+public class CodecUtil {
+
+	private static Logger logger = LoggerFactory.getLogger(CodecUtil.class);
+
+	/**
+	 * 将 URL 编码
+	 */
+	public static String encodeURL(String str) {
+		String target;
+		try {
+			target = URLEncoder.encode(str, "UTF-8");
+		} catch (Exception e) {
+			logger.error("编码出错!", e);
+			throw new RuntimeException(e);
+		}
+		return target;
+	}
+
+	/**
+	 * 将 URL 解码
+	 */
+	public static String decodeURL(String str) {
+		String target;
+		try {
+			target = URLDecoder.decode(str, "UTF-8");
+		} catch (Exception e) {
+			logger.error("解码出错!", e);
+			throw new RuntimeException(e);
+		}
+		return target;
+	}
+
+	/**
+	 * 将字符串 Base64 编码
+	 */
+	public static String encodeBASE64(String str) {
+		String target;
+		try {
+			target = Base64.encodeBase64URLSafeString(str.getBytes("UTF-8"));
+		} catch (UnsupportedEncodingException e) {
+			logger.error("编码出错!", e);
+			throw new RuntimeException(e);
+		}
+		return target;
+	}
+
+	/**
+	 * 将字符串 Base64 解码
+	 */
+	public static String decodeBASE64(String str) {
+		String target;
+		try {
+			target = new String(Base64.decodeBase64(str), "UTF-8");
+		} catch (UnsupportedEncodingException e) {
+			logger.error("解码出错!", e);
+			throw new RuntimeException(e);
+		}
+		return target;
+	}
+
+	/**
+	 * 将字符串 MD5 加密
+	 */
+	public static String encryptMD5(String str) {
+		return DigestUtils.md5Hex(str);
+	}
+
+	/**
+	 *
+	 * @param str 加密数据
+	 * @param key 密钥
+	 * @return
+	 */
+	public static String encryptMD5(String str, String key) {
+		return DigestUtils.md5Hex("SSJ" + str + key);
+	}
+
+	/**
+	 * MD5验证方法
+	 *
+	 * @param str 明文
+	 * @param key 密钥
+	 * @param md5 密文
+	 * @return true/false
+	 */
+	public static boolean verifyMD5(String str, String key, String md5) {
+		// 根据传入的密钥进行验证
+		String md5Text = encryptMD5(str, key);
+		if (md5Text.equalsIgnoreCase(md5)) {
+			return true;
+		}
+		return false;
+	}
+
+	/**
+	 * 将字符串 SHA 加密
+	 */
+	public static String encryptSHA(String str) {
+		return DigestUtils.sha1Hex(str);
+	}
+
+	/**
+	 * 创建随机数
+	 */
+	public static String createRandom(int count) {
+		return RandomStringUtils.randomNumeric(count);
+	}
+
+	/**
+	 * 获取 UUID(32位)
+	 */
+	public static String createUUID() {
+		return UUID.randomUUID().toString().replaceAll("-", "").toUpperCase();
+	}
+
+}

Разница между файлами не показана из-за своего большого размера
+ 1475 - 0
src/main/java/com/aijia/utils/DateUtil.java


+ 282 - 0
src/main/java/com/aijia/utils/HttpUtils.java

@@ -0,0 +1,282 @@
+package com.aijia.utils;
+
+import org.apache.commons.lang3.StringUtils;
+import org.apache.http.HttpResponse;
+import org.apache.http.NameValuePair;
+import org.apache.http.client.HttpClient;
+import org.apache.http.client.config.RequestConfig;
+import org.apache.http.client.entity.UrlEncodedFormEntity;
+import org.apache.http.client.methods.HttpDelete;
+import org.apache.http.client.methods.HttpGet;
+import org.apache.http.client.methods.HttpPost;
+import org.apache.http.client.methods.HttpPut;
+import org.apache.http.entity.ByteArrayEntity;
+import org.apache.http.entity.StringEntity;
+import org.apache.http.impl.client.HttpClients;
+import org.apache.http.message.BasicNameValuePair;
+
+import java.io.UnsupportedEncodingException;
+import java.net.URLEncoder;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Map;
+
+public class HttpUtils {
+
+
+	/**
+	 * get
+	 *
+	 * @param host
+	 * @param path
+	 * @param method
+	 * @param headers
+	 * @param querys
+	 * @return
+	 * @throws Exception
+	 */
+	public static HttpResponse doGet(String host, String path, String method,
+                                     Map<String, String> headers,
+                                     Map<String, String> querys)
+			throws Exception {
+		HttpClient httpClient = wrapClient(host);
+
+		HttpGet request = new HttpGet(buildUrl(host, path, querys));
+		for (Map.Entry<String, String> e : headers.entrySet()) {
+			request.addHeader(e.getKey(), e.getValue());
+		}
+
+		return httpClient.execute(request);
+	}
+
+	/**
+	 * post form
+	 *
+	 * @param host
+	 * @param path
+	 * @param method
+	 * @param headers
+	 * @param querys
+	 * @param bodys
+	 * @return
+	 * @throws Exception
+	 */
+	public static HttpResponse doPost(String host, String path, String method,
+                                      Map<String, String> headers,
+                                      Map<String, String> querys,
+                                      Map<String, String> bodys)
+			throws Exception {
+		HttpClient httpClient = wrapClient(host);
+		//设置默认超时时间
+		int timeout = 100*1000;
+		RequestConfig requestConfig = RequestConfig.custom()
+				.setConnectTimeout(timeout).setConnectionRequestTimeout(timeout)
+				.setSocketTimeout(timeout).build();
+
+		HttpPost request = new HttpPost(buildUrl(host, path, querys));
+		request.setConfig(requestConfig);
+		for (Map.Entry<String, String> e : headers.entrySet()) {
+			request.addHeader(e.getKey(), e.getValue());
+		}
+
+		if (bodys != null) {
+			List<NameValuePair> nameValuePairList = new ArrayList<NameValuePair>();
+
+			for (String key : bodys.keySet()) {
+				nameValuePairList.add(new BasicNameValuePair(key, bodys.get(key)));
+			}
+			UrlEncodedFormEntity formEntity = new UrlEncodedFormEntity(nameValuePairList, "utf-8");
+			formEntity.setContentType("application/json; charset=UTF-8");
+			request.setEntity(formEntity);
+		}
+		System.out.println(request);
+		return httpClient.execute(request);
+	}
+
+	/**
+	 * Post String
+	 *
+	 * @param host
+	 * @param path
+	 * @param method
+	 * @param headers
+	 * @param querys
+	 * @param body
+	 * @return
+	 * @throws Exception
+	 */
+	public static HttpResponse doPost(String host, String path, String method,
+                                      Map<String, String> headers,
+                                      Map<String, String> querys,
+                                      String body)
+			throws Exception {
+		HttpClient httpClient = wrapClient(host);
+
+		HttpPost request = new HttpPost(buildUrl(host, path, querys));
+		for (Map.Entry<String, String> e : headers.entrySet()) {
+			request.addHeader(e.getKey(), e.getValue());
+		}
+
+		if (StringUtils.isNotBlank(body)) {
+			request.setEntity(new StringEntity(body, "utf-8"));
+			request.setHeader("Content-Type", "application/json");
+		}
+
+		return httpClient.execute(request);
+	}
+
+	/**
+	 * Post stream
+	 *
+	 * @param host
+	 * @param path
+	 * @param method
+	 * @param headers
+	 * @param querys
+	 * @param body
+	 * @return
+	 * @throws Exception
+	 */
+	public static HttpResponse doPost(String host, String path, String method,
+                                      Map<String, String> headers,
+                                      Map<String, String> querys,
+                                      byte[] body)
+			throws Exception {
+		HttpClient httpClient = wrapClient(host);
+
+		HttpPost request = new HttpPost(buildUrl(host, path, querys));
+		for (Map.Entry<String, String> e : headers.entrySet()) {
+			request.addHeader(e.getKey(), e.getValue());
+		}
+
+		if (body != null) {
+			request.setEntity(new ByteArrayEntity(body));
+		}
+
+		return httpClient.execute(request);
+	}
+
+	/**
+	 * Put String
+	 * @param host
+	 * @param path
+	 * @param method
+	 * @param headers
+	 * @param querys
+	 * @param body
+	 * @return
+	 * @throws Exception
+	 */
+	public static HttpResponse doPut(String host, String path, String method,
+                                     Map<String, String> headers,
+                                     Map<String, String> querys,
+                                     String body)
+			throws Exception {
+		HttpClient httpClient = wrapClient(host);
+
+		HttpPut request = new HttpPut(buildUrl(host, path, querys));
+		for (Map.Entry<String, String> e : headers.entrySet()) {
+			request.addHeader(e.getKey(), e.getValue());
+		}
+
+		if (StringUtils.isNotBlank(body)) {
+			request.setEntity(new StringEntity(body, "utf-8"));
+		}
+
+		return httpClient.execute(request);
+	}
+
+	/**
+	 * Put stream
+	 * @param host
+	 * @param path
+	 * @param method
+	 * @param headers
+	 * @param querys
+	 * @param body
+	 * @return
+	 * @throws Exception
+	 */
+	public static HttpResponse doPut(String host, String path, String method,
+                                     Map<String, String> headers,
+                                     Map<String, String> querys,
+                                     byte[] body)
+			throws Exception {
+		HttpClient httpClient = wrapClient(host);
+
+		HttpPut request = new HttpPut(buildUrl(host, path, querys));
+		for (Map.Entry<String, String> e : headers.entrySet()) {
+			request.addHeader(e.getKey(), e.getValue());
+		}
+
+		if (body != null) {
+			request.setEntity(new ByteArrayEntity(body));
+		}
+
+		return httpClient.execute(request);
+	}
+
+	/**
+	 * Delete
+	 *
+	 * @param host
+	 * @param path
+	 * @param method
+	 * @param headers
+	 * @param querys
+	 * @return
+	 * @throws Exception
+	 */
+	public static HttpResponse doDelete(String host, String path, String method,
+                                        Map<String, String> headers,
+                                        Map<String, String> querys)
+			throws Exception {
+		HttpClient httpClient = wrapClient(host);
+
+		HttpDelete request = new HttpDelete(buildUrl(host, path, querys));
+		for (Map.Entry<String, String> e : headers.entrySet()) {
+			request.addHeader(e.getKey(), e.getValue());
+		}
+
+		return httpClient.execute(request);
+	}
+
+	private static String buildUrl(String host, String path, Map<String, String> querys) throws UnsupportedEncodingException {
+		StringBuilder sbUrl = new StringBuilder();
+		sbUrl.append(host);
+		if (!StringUtils.isBlank(path)) {
+			sbUrl.append(path);
+		}
+		if (null != querys) {
+			StringBuilder sbQuery = new StringBuilder();
+			for (Map.Entry<String, String> query : querys.entrySet()) {
+				if (0 < sbQuery.length()) {
+					sbQuery.append("&");
+				}
+				if (StringUtils.isBlank(query.getKey()) && !StringUtils.isBlank(query.getValue())) {
+					sbQuery.append(query.getValue());
+				}
+				if (!StringUtils.isBlank(query.getKey())) {
+					sbQuery.append(query.getKey());
+					if (!StringUtils.isBlank(query.getValue())) {
+						sbQuery.append("=");
+						sbQuery.append(URLEncoder.encode(query.getValue(), "utf-8"));
+					}
+				}
+			}
+			if (0 < sbQuery.length()) {
+				sbUrl.append("?").append(sbQuery);
+			}
+		}
+		System.out.println(sbUrl.toString());
+		return sbUrl.toString();
+	}
+
+	private static HttpClient wrapClient(String host) {
+		HttpClient httpClient = HttpClients.createDefault();
+
+		return httpClient;
+	}
+
+
+}

+ 22 - 0
src/main/java/com/aijia/utils/MyX509TrustManager.java

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

+ 57 - 0
src/main/java/com/aijia/utils/PhoneFormatCheckUtils.java

@@ -0,0 +1,57 @@
+package com.aijia.utils;
+
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+import java.util.regex.PatternSyntaxException;
+
+
+public class PhoneFormatCheckUtils {
+	    /**
+	     * ^ 匹配输入字符串开始的位置
+	     * \d 匹配一个或多个数字,其中 \ 要转义,所以是 \\d
+	     * $ 匹配输入字符串结尾的位置
+	     */
+	    private static final Pattern HK_PATTERN = Pattern.compile("^(5|6|8|9)\\d{7}$");
+	    private static final Pattern CHINA_PATTERN = Pattern.compile("^((13[0-9])|(14[0,1,4-9])|(15[0-3,5-9])|(16[2,5,6,7])|(17[0-8])|(18[0-9])|(19[0-3,5-9]))\\d{8}$");
+	    private static final Pattern NUM_PATTERN = Pattern.compile("[0-9]+");
+
+	    /**
+	     * 大陆号码或香港号码均可
+	     */
+	    public static boolean isPhoneLegal(String str) throws PatternSyntaxException {
+	        return isChinaPhoneLegal(str) || isHKPhoneLegal(str);
+	    }
+
+	    /**
+	     * 大陆手机号码11位数,匹配格式:前三位固定格式+后8位任意数
+	     * 此方法中前三位格式有:
+	     * 13+任意数
+	     * 145,147,149
+	     * 15+除4的任意数(不要写^4,这样的话字母也会被认为是正确的)
+	     * 166
+	     * 17+3,5,6,7,8
+	     * 18+任意数
+	     * 198,199
+	     */
+	    public static boolean isChinaPhoneLegal(String str) throws PatternSyntaxException {
+	        Matcher m = CHINA_PATTERN.matcher(str);
+	        return m.matches();
+	    }
+
+	    /**
+	     * 香港手机号码8位数,5|6|8|9开头+7位任意数
+	     */
+	    public static boolean isHKPhoneLegal(String str) throws PatternSyntaxException {
+
+	        Matcher m = HK_PATTERN.matcher(str);
+	        return m.matches();
+	    }
+
+	    /**
+	     * 判断是否是正整数的方法
+	     */
+	    public static boolean isNumeric(String string) {
+	        return NUM_PATTERN.matcher(string).matches();
+	    }
+	}
+

Разница между файлами не показана из-за своего большого размера
+ 172 - 0
src/main/java/com/aijia/utils/RSAUtils.java


+ 68 - 0
src/main/java/com/aijia/utils/SHA1Util.java

@@ -0,0 +1,68 @@
+package com.aijia.utils;
+
+import java.security.MessageDigest;
+import java.security.NoSuchAlgorithmException;
+import java.util.Arrays;
+
+/**
+ *
+ * 类说明:sha1加密
+ */
+public class SHA1Util {
+	 /**
+     * 排序方法
+     *
+     * @param token
+     * @param timestamp
+     * @param nonce
+     * @return
+     */
+    public String sort(String token, String timestamp, String nonce) {
+        String[] strArray = {token, timestamp, nonce};
+        Arrays.sort(strArray);
+        StringBuilder sb = new StringBuilder();
+        for (String str : strArray) {
+            sb.append(str);
+        }
+	
+        return sb.toString();
+    }
+    public String sort(String token, String timestamp, String nonce, String jsUrl) {
+    	String[] strArray = {token, timestamp, nonce,jsUrl};
+    	Arrays.sort(strArray);
+    	StringBuilder sb = new StringBuilder();
+    	for (String str : strArray) {
+    		sb.append(str);
+    	}
+    	
+    	return sb.toString();
+    }
+    /**
+     * 将字符串进行sha1加密
+     *
+     * @param str 需要加密的字符串
+     * @return 加密后的内容
+     */
+    public String sha1(String str) {
+        try {
+            MessageDigest digest = MessageDigest.getInstance("SHA-1");
+            digest.update(str.getBytes());
+            byte messageDigest[] = digest.digest();
+            // Create Hex String
+            StringBuffer hexString = new StringBuffer();
+            // 字节数组转换为 十六进制 数
+            for (int i = 0; i < messageDigest.length; i++) {
+                String shaHex = Integer.toHexString(messageDigest[i] & 0xFF);
+                if (shaHex.length() < 2) {
+                    hexString.append(0);
+                }
+                hexString.append(shaHex);
+            }
+            return hexString.toString();
+
+        } catch (NoSuchAlgorithmException e) {
+            e.printStackTrace();
+        }
+        return "";
+    }
+}

+ 34 - 0
src/main/java/com/aijia/utils/SessionKey.java

@@ -0,0 +1,34 @@
+package com.aijia.utils;
+
+import java.io.Serializable;
+
+public class SessionKey implements Serializable {
+
+	/**
+	 * 
+	 */
+	private static final long serialVersionUID = -5541622729079727380L;
+	private String sessionKey;
+	private String openId;
+	private String unionid;
+	public String getSessionKey() {
+		return sessionKey;
+	}
+	public void setSessionKey(String sessionKey) {
+		this.sessionKey = sessionKey;
+	}
+	public String getOpenId() {
+		return openId;
+	}
+	public void setOpenId(String openId) {
+		this.openId = openId;
+	}
+	public String getUnionid() {
+		return unionid;
+	}
+	public void setUnionid(String unionid) {
+		this.unionid = unionid;
+	}
+	
+	
+}

+ 46 - 0
src/main/java/com/aijia/utils/StringUtil.java

@@ -0,0 +1,46 @@
+package com.aijia.utils;
+
+import java.util.Collection;
+import java.util.Map;
+
+public class StringUtil extends org.apache.commons.lang3.StringUtils {
+
+	public static <T> boolean isEmpty(T[] obj) {
+		return (obj == null) || (obj.length == 0);
+	}
+
+	public static boolean isEmpty(Object obj) {
+		if (obj == null) {
+			return true;
+		}
+		if ((obj instanceof String)) {
+			return (String.valueOf(obj)).trim().isEmpty();
+		}
+		if (obj instanceof CharSequence) {
+			return ((CharSequence) obj).length() == 0;
+		}
+		if (obj instanceof Number) {
+			return false;
+		}
+		return false;
+	}
+
+	public static String formateStr(String str) {
+		if (isEmpty(str)) {
+			return "";
+		} else {
+			return str;
+		}
+	}
+
+	@SuppressWarnings("rawtypes")
+	public static boolean isEmpty(Collection obj) {
+		return (obj == null) || (obj.isEmpty());
+	}
+
+	@SuppressWarnings("rawtypes")
+	public static boolean isEmpty(Map obj) {
+		return (obj == null) || (obj.isEmpty());
+	}
+
+}

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

@@ -1,27 +0,0 @@
-spring:
-  datasource:
-    url: jdbc:mysql://8.135.141.120:9906/aijia?useSSL=false
-    username: root
-    password: ZnjyAi@629_db
-    driver-class-name: com.mysql.cj.jdbc.Driver
-  thymeleaf:
-    check-template: false
-    check-template-location: false
-  redis:
-    host: 47.119.147.170
-    port: 7000
-    password: aijia@78342
-    connect-timeout: 60000ms
-    jedis:
-      pool:
-        max-active: 200
-        max-wait: -1
-        max-idle: 10
-        min-idle: 0
-
-mybatis:
-  mapper-locations: classpath:mapper/*.xml
-  type-aliases-package: com.aijia.peixun.entity
-#  config-location:
-
-

+ 0 - 166
src/main/resources/mapper/FileMapper.xml

@@ -1,166 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
-<mapper namespace="com.aijia.peixun.dao.FileMapper">
-  <resultMap id="BaseResultMap" type="com.aijia.peixun.entity.File">
-    <constructor>
-      <idArg column="id" javaType="java.lang.Integer" jdbcType="INTEGER" />
-      <arg column="filename" javaType="java.lang.String" jdbcType="VARCHAR" />
-      <arg column="filetype" javaType="java.lang.Integer" jdbcType="INTEGER" />
-      <arg column="uploadetime" javaType="java.lang.String" jdbcType="VARCHAR" />
-      <arg column="uploadeuser" javaType="java.lang.String" jdbcType="VARCHAR" />
-      <arg column="filestate" javaType="java.lang.Integer" jdbcType="INTEGER" />
-      <arg column="backup1" javaType="java.lang.String" jdbcType="VARCHAR" />
-      <arg column="backup2" javaType="java.lang.String" jdbcType="VARCHAR" />
-      <arg column="backup3" javaType="java.lang.String" jdbcType="VARCHAR" />
-      <arg column="backup4" javaType="java.lang.String" jdbcType="VARCHAR" />
-      <arg column="backup5" javaType="java.lang.String" jdbcType="VARCHAR" />
-    </constructor>
-  </resultMap>
-  <sql id="Base_Column_List">
-    id, filename, filetype, uploadetime, uploadeuser, filestate, backup1, backup2, backup3, 
-    backup4, backup5
-  </sql>
-  <select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
-    select 
-    <include refid="Base_Column_List" />
-    from jianzhi_peixun_file
-    where id = #{id,jdbcType=INTEGER}
-  </select>
-  <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
-    delete from jianzhi_peixun_file
-    where id = #{id,jdbcType=INTEGER}
-  </delete>
-  <insert id="insert" parameterType="com.aijia.peixun.entity.File">
-    insert into jianzhi_peixun_file (id, filename, filetype, 
-      uploadetime, uploadeuser, filestate, 
-      backup1, backup2, backup3, 
-      backup4, backup5)
-    values (#{id,jdbcType=INTEGER}, #{filename,jdbcType=VARCHAR}, #{filetype,jdbcType=INTEGER}, 
-      #{uploadetime,jdbcType=VARCHAR}, #{uploadeuser,jdbcType=VARCHAR}, #{filestate,jdbcType=INTEGER}, 
-      #{backup1,jdbcType=VARCHAR}, #{backup2,jdbcType=VARCHAR}, #{backup3,jdbcType=VARCHAR}, 
-      #{backup4,jdbcType=VARCHAR}, #{backup5,jdbcType=VARCHAR})
-  </insert>
-  <insert id="insertSelective" parameterType="com.aijia.peixun.entity.File">
-    insert into jianzhi_peixun_file
-    <trim prefix="(" suffix=")" suffixOverrides=",">
-      <if test="id != null">
-        id,
-      </if>
-      <if test="filename != null">
-        filename,
-      </if>
-      <if test="filetype != null">
-        filetype,
-      </if>
-      <if test="uploadetime != null">
-        uploadetime,
-      </if>
-      <if test="uploadeuser != null">
-        uploadeuser,
-      </if>
-      <if test="filestate != null">
-        filestate,
-      </if>
-      <if test="backup1 != null">
-        backup1,
-      </if>
-      <if test="backup2 != null">
-        backup2,
-      </if>
-      <if test="backup3 != null">
-        backup3,
-      </if>
-      <if test="backup4 != null">
-        backup4,
-      </if>
-      <if test="backup5 != null">
-        backup5,
-      </if>
-    </trim>
-    <trim prefix="values (" suffix=")" suffixOverrides=",">
-      <if test="id != null">
-        #{id,jdbcType=INTEGER},
-      </if>
-      <if test="filename != null">
-        #{filename,jdbcType=VARCHAR},
-      </if>
-      <if test="filetype != null">
-        #{filetype,jdbcType=INTEGER},
-      </if>
-      <if test="uploadetime != null">
-        #{uploadetime,jdbcType=VARCHAR},
-      </if>
-      <if test="uploadeuser != null">
-        #{uploadeuser,jdbcType=VARCHAR},
-      </if>
-      <if test="filestate != null">
-        #{filestate,jdbcType=INTEGER},
-      </if>
-      <if test="backup1 != null">
-        #{backup1,jdbcType=VARCHAR},
-      </if>
-      <if test="backup2 != null">
-        #{backup2,jdbcType=VARCHAR},
-      </if>
-      <if test="backup3 != null">
-        #{backup3,jdbcType=VARCHAR},
-      </if>
-      <if test="backup4 != null">
-        #{backup4,jdbcType=VARCHAR},
-      </if>
-      <if test="backup5 != null">
-        #{backup5,jdbcType=VARCHAR},
-      </if>
-    </trim>
-  </insert>
-  <update id="updateByPrimaryKeySelective" parameterType="com.aijia.peixun.entity.File">
-    update jianzhi_peixun_file
-    <set>
-      <if test="filename != null">
-        filename = #{filename,jdbcType=VARCHAR},
-      </if>
-      <if test="filetype != null">
-        filetype = #{filetype,jdbcType=INTEGER},
-      </if>
-      <if test="uploadetime != null">
-        uploadetime = #{uploadetime,jdbcType=VARCHAR},
-      </if>
-      <if test="uploadeuser != null">
-        uploadeuser = #{uploadeuser,jdbcType=VARCHAR},
-      </if>
-      <if test="filestate != null">
-        filestate = #{filestate,jdbcType=INTEGER},
-      </if>
-      <if test="backup1 != null">
-        backup1 = #{backup1,jdbcType=VARCHAR},
-      </if>
-      <if test="backup2 != null">
-        backup2 = #{backup2,jdbcType=VARCHAR},
-      </if>
-      <if test="backup3 != null">
-        backup3 = #{backup3,jdbcType=VARCHAR},
-      </if>
-      <if test="backup4 != null">
-        backup4 = #{backup4,jdbcType=VARCHAR},
-      </if>
-      <if test="backup5 != null">
-        backup5 = #{backup5,jdbcType=VARCHAR},
-      </if>
-    </set>
-    where id = #{id,jdbcType=INTEGER}
-  </update>
-  <update id="updateByPrimaryKey" parameterType="com.aijia.peixun.entity.File">
-    update jianzhi_peixun_file
-    set filename = #{filename,jdbcType=VARCHAR},
-      filetype = #{filetype,jdbcType=INTEGER},
-      uploadetime = #{uploadetime,jdbcType=VARCHAR},
-      uploadeuser = #{uploadeuser,jdbcType=VARCHAR},
-      filestate = #{filestate,jdbcType=INTEGER},
-      backup1 = #{backup1,jdbcType=VARCHAR},
-      backup2 = #{backup2,jdbcType=VARCHAR},
-      backup3 = #{backup3,jdbcType=VARCHAR},
-      backup4 = #{backup4,jdbcType=VARCHAR},
-      backup5 = #{backup5,jdbcType=VARCHAR}
-    where id = #{id,jdbcType=INTEGER}
-  </update>
-</mapper>

+ 0 - 260
src/main/resources/mapper/UserMapper.xml

@@ -1,260 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
-<mapper namespace="com.aijia.peixun.dao.UserMapper">
-  <resultMap id="BaseResultMap" type="com.aijia.peixun.entity.User">
-    <constructor>
-      <idArg column="id" javaType="java.lang.Integer" jdbcType="INTEGER" />
-      <arg column="name" javaType="java.lang.String" jdbcType="VARCHAR" />
-      <arg column="telephoneNo" javaType="java.lang.String" jdbcType="VARCHAR" />
-      <arg column="email" javaType="java.lang.String" jdbcType="VARCHAR" />
-      <arg column="sex" javaType="java.lang.String" jdbcType="VARCHAR" />
-      <arg column="age" javaType="java.lang.String" jdbcType="VARCHAR" />
-      <arg column="correctingsub" javaType="java.lang.String" jdbcType="VARCHAR" />
-      <arg column="typeofjob" javaType="java.lang.Integer" jdbcType="INTEGER" />
-      <arg column="createtime" javaType="java.util.Date" jdbcType="TIMESTAMP" />
-      <arg column="userstate" javaType="java.lang.Integer" jdbcType="INTEGER" />
-      <arg column="area" javaType="java.lang.String" jdbcType="VARCHAR" />
-      <arg column="typeofuser" javaType="java.lang.Integer" jdbcType="INTEGER" />
-      <arg column="examinetime" javaType="java.util.Date" jdbcType="TIMESTAMP" />
-      <arg column="examinenum" javaType="java.lang.Integer" jdbcType="INTEGER" />
-      <arg column="backup1" javaType="java.lang.String" jdbcType="VARCHAR" />
-      <arg column="backup2" javaType="java.lang.String" jdbcType="VARCHAR" />
-      <arg column="backup3" javaType="java.lang.String" jdbcType="VARCHAR" />
-      <arg column="backup4" javaType="java.lang.String" jdbcType="VARCHAR" />
-      <arg column="backup5" javaType="java.lang.String" jdbcType="VARCHAR" />
-    </constructor>
-  </resultMap>
-  <sql id="Base_Column_List">
-    id, name, telephoneNo, email, sex, age, correctingsub, typeofjob, createtime, userstate, 
-    area, typeofuser, examinetime, examinenum, backup1, backup2, backup3, backup4, backup5
-  </sql>
-  <select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
-    select 
-    <include refid="Base_Column_List" />
-    from jianzhi_peixun_user
-    where id = #{id,jdbcType=INTEGER}
-  </select>
-  <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
-    delete from jianzhi_peixun_user
-    where id = #{id,jdbcType=INTEGER}
-  </delete>
-  <insert id="insert" parameterType="com.aijia.peixun.entity.User">
-    insert into jianzhi_peixun_user (id, name, telephoneNo, 
-      email, sex, age, correctingsub, 
-      typeofjob, createtime, userstate, 
-      area, typeofuser, examinetime, 
-      examinenum, backup1, backup2, 
-      backup3, backup4, backup5
-      )
-    values (#{id,jdbcType=INTEGER}, #{name,jdbcType=VARCHAR}, #{telephoneno,jdbcType=VARCHAR}, 
-      #{email,jdbcType=VARCHAR}, #{sex,jdbcType=VARCHAR}, #{age,jdbcType=VARCHAR}, #{correctingsub,jdbcType=VARCHAR}, 
-      #{typeofjob,jdbcType=INTEGER}, #{createtime,jdbcType=TIMESTAMP}, #{userstate,jdbcType=INTEGER}, 
-      #{area,jdbcType=VARCHAR}, #{typeofuser,jdbcType=INTEGER}, #{examinetime,jdbcType=TIMESTAMP}, 
-      #{examinenum,jdbcType=INTEGER}, #{backup1,jdbcType=VARCHAR}, #{backup2,jdbcType=VARCHAR}, 
-      #{backup3,jdbcType=VARCHAR}, #{backup4,jdbcType=VARCHAR}, #{backup5,jdbcType=VARCHAR}
-      )
-  </insert>
-  <insert id="insertSelective" parameterType="com.aijia.peixun.entity.User">
-    insert into jianzhi_peixun_user
-    <trim prefix="(" suffix=")" suffixOverrides=",">
-      <if test="id != null">
-        id,
-      </if>
-      <if test="name != null">
-        name,
-      </if>
-      <if test="telephoneno != null">
-        telephoneNo,
-      </if>
-      <if test="email != null">
-        email,
-      </if>
-      <if test="sex != null">
-        sex,
-      </if>
-      <if test="age != null">
-        age,
-      </if>
-      <if test="correctingsub != null">
-        correctingsub,
-      </if>
-      <if test="typeofjob != null">
-        typeofjob,
-      </if>
-      <if test="createtime != null">
-        createtime,
-      </if>
-      <if test="userstate != null">
-        userstate,
-      </if>
-      <if test="area != null">
-        area,
-      </if>
-      <if test="typeofuser != null">
-        typeofuser,
-      </if>
-      <if test="examinetime != null">
-        examinetime,
-      </if>
-      <if test="examinenum != null">
-        examinenum,
-      </if>
-      <if test="backup1 != null">
-        backup1,
-      </if>
-      <if test="backup2 != null">
-        backup2,
-      </if>
-      <if test="backup3 != null">
-        backup3,
-      </if>
-      <if test="backup4 != null">
-        backup4,
-      </if>
-      <if test="backup5 != null">
-        backup5,
-      </if>
-    </trim>
-    <trim prefix="values (" suffix=")" suffixOverrides=",">
-      <if test="id != null">
-        #{id,jdbcType=INTEGER},
-      </if>
-      <if test="name != null">
-        #{name,jdbcType=VARCHAR},
-      </if>
-      <if test="telephoneno != null">
-        #{telephoneno,jdbcType=VARCHAR},
-      </if>
-      <if test="email != null">
-        #{email,jdbcType=VARCHAR},
-      </if>
-      <if test="sex != null">
-        #{sex,jdbcType=VARCHAR},
-      </if>
-      <if test="age != null">
-        #{age,jdbcType=VARCHAR},
-      </if>
-      <if test="correctingsub != null">
-        #{correctingsub,jdbcType=VARCHAR},
-      </if>
-      <if test="typeofjob != null">
-        #{typeofjob,jdbcType=INTEGER},
-      </if>
-      <if test="createtime != null">
-        #{createtime,jdbcType=TIMESTAMP},
-      </if>
-      <if test="userstate != null">
-        #{userstate,jdbcType=INTEGER},
-      </if>
-      <if test="area != null">
-        #{area,jdbcType=VARCHAR},
-      </if>
-      <if test="typeofuser != null">
-        #{typeofuser,jdbcType=INTEGER},
-      </if>
-      <if test="examinetime != null">
-        #{examinetime,jdbcType=TIMESTAMP},
-      </if>
-      <if test="examinenum != null">
-        #{examinenum,jdbcType=INTEGER},
-      </if>
-      <if test="backup1 != null">
-        #{backup1,jdbcType=VARCHAR},
-      </if>
-      <if test="backup2 != null">
-        #{backup2,jdbcType=VARCHAR},
-      </if>
-      <if test="backup3 != null">
-        #{backup3,jdbcType=VARCHAR},
-      </if>
-      <if test="backup4 != null">
-        #{backup4,jdbcType=VARCHAR},
-      </if>
-      <if test="backup5 != null">
-        #{backup5,jdbcType=VARCHAR},
-      </if>
-    </trim>
-  </insert>
-  <update id="updateByPrimaryKeySelective" parameterType="com.aijia.peixun.entity.User">
-    update jianzhi_peixun_user
-    <set>
-      <if test="name != null">
-        name = #{name,jdbcType=VARCHAR},
-      </if>
-      <if test="telephoneno != null">
-        telephoneNo = #{telephoneno,jdbcType=VARCHAR},
-      </if>
-      <if test="email != null">
-        email = #{email,jdbcType=VARCHAR},
-      </if>
-      <if test="sex != null">
-        sex = #{sex,jdbcType=VARCHAR},
-      </if>
-      <if test="age != null">
-        age = #{age,jdbcType=VARCHAR},
-      </if>
-      <if test="correctingsub != null">
-        correctingsub = #{correctingsub,jdbcType=VARCHAR},
-      </if>
-      <if test="typeofjob != null">
-        typeofjob = #{typeofjob,jdbcType=INTEGER},
-      </if>
-      <if test="createtime != null">
-        createtime = #{createtime,jdbcType=TIMESTAMP},
-      </if>
-      <if test="userstate != null">
-        userstate = #{userstate,jdbcType=INTEGER},
-      </if>
-      <if test="area != null">
-        area = #{area,jdbcType=VARCHAR},
-      </if>
-      <if test="typeofuser != null">
-        typeofuser = #{typeofuser,jdbcType=INTEGER},
-      </if>
-      <if test="examinetime != null">
-        examinetime = #{examinetime,jdbcType=TIMESTAMP},
-      </if>
-      <if test="examinenum != null">
-        examinenum = #{examinenum,jdbcType=INTEGER},
-      </if>
-      <if test="backup1 != null">
-        backup1 = #{backup1,jdbcType=VARCHAR},
-      </if>
-      <if test="backup2 != null">
-        backup2 = #{backup2,jdbcType=VARCHAR},
-      </if>
-      <if test="backup3 != null">
-        backup3 = #{backup3,jdbcType=VARCHAR},
-      </if>
-      <if test="backup4 != null">
-        backup4 = #{backup4,jdbcType=VARCHAR},
-      </if>
-      <if test="backup5 != null">
-        backup5 = #{backup5,jdbcType=VARCHAR},
-      </if>
-    </set>
-    where id = #{id,jdbcType=INTEGER}
-  </update>
-  <update id="updateByPrimaryKey" parameterType="com.aijia.peixun.entity.User">
-    update jianzhi_peixun_user
-    set name = #{name,jdbcType=VARCHAR},
-      telephoneNo = #{telephoneno,jdbcType=VARCHAR},
-      email = #{email,jdbcType=VARCHAR},
-      sex = #{sex,jdbcType=VARCHAR},
-      age = #{age,jdbcType=VARCHAR},
-      correctingsub = #{correctingsub,jdbcType=VARCHAR},
-      typeofjob = #{typeofjob,jdbcType=INTEGER},
-      createtime = #{createtime,jdbcType=TIMESTAMP},
-      userstate = #{userstate,jdbcType=INTEGER},
-      area = #{area,jdbcType=VARCHAR},
-      typeofuser = #{typeofuser,jdbcType=INTEGER},
-      examinetime = #{examinetime,jdbcType=TIMESTAMP},
-      examinenum = #{examinenum,jdbcType=INTEGER},
-      backup1 = #{backup1,jdbcType=VARCHAR},
-      backup2 = #{backup2,jdbcType=VARCHAR},
-      backup3 = #{backup3,jdbcType=VARCHAR},
-      backup4 = #{backup4,jdbcType=VARCHAR},
-      backup5 = #{backup5,jdbcType=VARCHAR}
-    where id = #{id,jdbcType=INTEGER}
-  </update>
-</mapper>

+ 0 - 203
src/main/resources/mapper/examinationMapper.xml

@@ -1,203 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
-<mapper namespace="com.aijia.peixun.dao.examinationMapper">
-  <resultMap id="BaseResultMap" type="com.aijia.peixun.entity.examination">
-    <constructor>
-      <idArg column="id" javaType="java.lang.String" jdbcType="CHAR" />
-      <arg column="user_id" javaType="java.lang.String" jdbcType="CHAR" />
-      <arg column="grade" javaType="java.lang.String" jdbcType="VARCHAR" />
-      <arg column="subject" javaType="java.lang.String" jdbcType="VARCHAR" />
-      <arg column="version" javaType="java.lang.Byte" jdbcType="TINYINT" />
-      <arg column="name" javaType="java.lang.String" jdbcType="VARCHAR" />
-      <arg column="pdf_without_answer_url" javaType="java.lang.String" jdbcType="VARCHAR" />
-      <arg column="pdf_with_answer_url" javaType="java.lang.String" jdbcType="VARCHAR" />
-      <arg column="status" javaType="java.lang.Byte" jdbcType="TINYINT" />
-      <arg column="description" javaType="java.lang.String" jdbcType="VARCHAR" />
-      <arg column="answer_time" javaType="java.lang.Byte" jdbcType="TINYINT" />
-      <arg column="deleted" javaType="java.lang.Boolean" jdbcType="BIT" />
-      <arg column="update_time" javaType="java.util.Date" jdbcType="TIMESTAMP" />
-      <arg column="create_time" javaType="java.util.Date" jdbcType="TIMESTAMP" />
-    </constructor>
-  </resultMap>
-  <sql id="Base_Column_List">
-    id, user_id, grade, subject, version, name, pdf_without_answer_url, pdf_with_answer_url, 
-    status, description, answer_time, deleted, update_time, create_time
-  </sql>
-  <select id="selectByPrimaryKey" parameterType="java.lang.String" resultMap="BaseResultMap">
-    select 
-    <include refid="Base_Column_List" />
-    from tb_examination_paper
-    where id = #{id,jdbcType=CHAR}
-  </select>
-  <delete id="deleteByPrimaryKey" parameterType="java.lang.String">
-    delete from tb_examination_paper
-    where id = #{id,jdbcType=CHAR}
-  </delete>
-  <insert id="insert" parameterType="com.aijia.peixun.entity.examination">
-    insert into tb_examination_paper (id, user_id, grade, 
-      subject, version, name, 
-      pdf_without_answer_url, pdf_with_answer_url, 
-      status, description, answer_time, 
-      deleted, update_time, create_time
-      )
-    values (#{id,jdbcType=CHAR}, #{userId,jdbcType=CHAR}, #{grade,jdbcType=VARCHAR}, 
-      #{subject,jdbcType=VARCHAR}, #{version,jdbcType=TINYINT}, #{name,jdbcType=VARCHAR}, 
-      #{pdfWithoutAnswerUrl,jdbcType=VARCHAR}, #{pdfWithAnswerUrl,jdbcType=VARCHAR}, 
-      #{status,jdbcType=TINYINT}, #{description,jdbcType=VARCHAR}, #{answerTime,jdbcType=TINYINT}, 
-      #{deleted,jdbcType=BIT}, #{updateTime,jdbcType=TIMESTAMP}, #{createTime,jdbcType=TIMESTAMP}
-      )
-  </insert>
-  <insert id="insertSelective" parameterType="com.aijia.peixun.entity.examination">
-    insert into tb_examination_paper
-    <trim prefix="(" suffix=")" suffixOverrides=",">
-      <if test="id != null">
-        id,
-      </if>
-      <if test="userId != null">
-        user_id,
-      </if>
-      <if test="grade != null">
-        grade,
-      </if>
-      <if test="subject != null">
-        subject,
-      </if>
-      <if test="version != null">
-        version,
-      </if>
-      <if test="name != null">
-        name,
-      </if>
-      <if test="pdfWithoutAnswerUrl != null">
-        pdf_without_answer_url,
-      </if>
-      <if test="pdfWithAnswerUrl != null">
-        pdf_with_answer_url,
-      </if>
-      <if test="status != null">
-        status,
-      </if>
-      <if test="description != null">
-        description,
-      </if>
-      <if test="answerTime != null">
-        answer_time,
-      </if>
-      <if test="deleted != null">
-        deleted,
-      </if>
-      <if test="updateTime != null">
-        update_time,
-      </if>
-      <if test="createTime != null">
-        create_time,
-      </if>
-    </trim>
-    <trim prefix="values (" suffix=")" suffixOverrides=",">
-      <if test="id != null">
-        #{id,jdbcType=CHAR},
-      </if>
-      <if test="userId != null">
-        #{userId,jdbcType=CHAR},
-      </if>
-      <if test="grade != null">
-        #{grade,jdbcType=VARCHAR},
-      </if>
-      <if test="subject != null">
-        #{subject,jdbcType=VARCHAR},
-      </if>
-      <if test="version != null">
-        #{version,jdbcType=TINYINT},
-      </if>
-      <if test="name != null">
-        #{name,jdbcType=VARCHAR},
-      </if>
-      <if test="pdfWithoutAnswerUrl != null">
-        #{pdfWithoutAnswerUrl,jdbcType=VARCHAR},
-      </if>
-      <if test="pdfWithAnswerUrl != null">
-        #{pdfWithAnswerUrl,jdbcType=VARCHAR},
-      </if>
-      <if test="status != null">
-        #{status,jdbcType=TINYINT},
-      </if>
-      <if test="description != null">
-        #{description,jdbcType=VARCHAR},
-      </if>
-      <if test="answerTime != null">
-        #{answerTime,jdbcType=TINYINT},
-      </if>
-      <if test="deleted != null">
-        #{deleted,jdbcType=BIT},
-      </if>
-      <if test="updateTime != null">
-        #{updateTime,jdbcType=TIMESTAMP},
-      </if>
-      <if test="createTime != null">
-        #{createTime,jdbcType=TIMESTAMP},
-      </if>
-    </trim>
-  </insert>
-  <update id="updateByPrimaryKeySelective" parameterType="com.aijia.peixun.entity.examination">
-    update tb_examination_paper
-    <set>
-      <if test="userId != null">
-        user_id = #{userId,jdbcType=CHAR},
-      </if>
-      <if test="grade != null">
-        grade = #{grade,jdbcType=VARCHAR},
-      </if>
-      <if test="subject != null">
-        subject = #{subject,jdbcType=VARCHAR},
-      </if>
-      <if test="version != null">
-        version = #{version,jdbcType=TINYINT},
-      </if>
-      <if test="name != null">
-        name = #{name,jdbcType=VARCHAR},
-      </if>
-      <if test="pdfWithoutAnswerUrl != null">
-        pdf_without_answer_url = #{pdfWithoutAnswerUrl,jdbcType=VARCHAR},
-      </if>
-      <if test="pdfWithAnswerUrl != null">
-        pdf_with_answer_url = #{pdfWithAnswerUrl,jdbcType=VARCHAR},
-      </if>
-      <if test="status != null">
-        status = #{status,jdbcType=TINYINT},
-      </if>
-      <if test="description != null">
-        description = #{description,jdbcType=VARCHAR},
-      </if>
-      <if test="answerTime != null">
-        answer_time = #{answerTime,jdbcType=TINYINT},
-      </if>
-      <if test="deleted != null">
-        deleted = #{deleted,jdbcType=BIT},
-      </if>
-      <if test="updateTime != null">
-        update_time = #{updateTime,jdbcType=TIMESTAMP},
-      </if>
-      <if test="createTime != null">
-        create_time = #{createTime,jdbcType=TIMESTAMP},
-      </if>
-    </set>
-    where id = #{id,jdbcType=CHAR}
-  </update>
-  <update id="updateByPrimaryKey" parameterType="com.aijia.peixun.entity.examination">
-    update tb_examination_paper
-    set user_id = #{userId,jdbcType=CHAR},
-      grade = #{grade,jdbcType=VARCHAR},
-      subject = #{subject,jdbcType=VARCHAR},
-      version = #{version,jdbcType=TINYINT},
-      name = #{name,jdbcType=VARCHAR},
-      pdf_without_answer_url = #{pdfWithoutAnswerUrl,jdbcType=VARCHAR},
-      pdf_with_answer_url = #{pdfWithAnswerUrl,jdbcType=VARCHAR},
-      status = #{status,jdbcType=TINYINT},
-      description = #{description,jdbcType=VARCHAR},
-      answer_time = #{answerTime,jdbcType=TINYINT},
-      deleted = #{deleted,jdbcType=BIT},
-      update_time = #{updateTime,jdbcType=TIMESTAMP},
-      create_time = #{createTime,jdbcType=TIMESTAMP}
-    where id = #{id,jdbcType=CHAR}
-  </update>
-</mapper>

+ 36 - 0
src/main/resources/mybatis/mapper/TrainMapper.xml

@@ -0,0 +1,36 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
+<mapper namespace="com.aijia.train.mapper.TrainAllMapper">
+
+    <select id="findTrainFileList" resultType="com.aijia.train.vo.FileVO">
+
+        select DISTINCT a.id,a.file_name,file_type,file_url,file_index,
+            case when (c.id is null and a.file_index=1) or c.id is not null then 1 else 2 end locking,
+            (select count(1) from tr_train_user_info c
+              where c.status = 1 and date_add(c.create_time, interval 48 hour) &gt;= now()
+                and  c.role_type=b.role_type and c.subject = b.subject and a.file_index=1
+                and c.file_id = a.id
+                and c.user_id = b.id) as over_time_stat
+        from
+        tr_train_files a
+        join tr_train_part_user b on a.role_type = b.role_type and a.subject = b.subject and b.id = #{userId}
+        left join tr_train_user_info c on b.id = c.user_id and a.id = c.file_id and c.status = 1
+        order by a.file_index asc
+    </select>
+    <select id="partTeacherList" resultType="java.util.Map">
+        select t.id as userId,t.name,t.study_status as studyStatus,t.check_times as checkTimes
+        from  tr_train_part_user t
+        where t.role_type = #{roleType} and t.subject = #{subject} and t.status = 1 and t.manager_type = 0
+        <choose>
+            <when test="type == 1">
+                and t.study_status between 0 and 2
+            </when>
+            <when test="type == 2">
+                and t.study_status between 3 and 4
+            </when>
+            <otherwise>
+                and t.study_status = 5
+            </otherwise>
+        </choose>
+    </select>
+</mapper>