فهرست منبع

Merge remote-tracking branch 'origin/master'

soft5566 2 سال پیش
والد
کامیت
fa298de8ae
100فایلهای تغییر یافته به همراه6369 افزوده شده و 1070 حذف شده
  1. 0 1
      .idea/.name
  2. 0 22
      .idea/compiler.xml
  3. 0 6
      .idea/encodings.xml
  4. 0 451
      .idea/misc.xml
  5. 0 6
      .idea/vcs.xml
  6. 423 369
      .idea/workspace.xml
  7. 30 7
      pom.xml
  8. 1 1
      src/main/java/com/template/AutoCode.java
  9. 18 0
      src/main/java/com/template/annotation/ExcelExport.java
  10. 20 0
      src/main/java/com/template/annotation/ExcelImport.java
  11. 29 0
      src/main/java/com/template/api/HikvisionAPI.java
  12. 4 0
      src/main/java/com/template/api/SmartApplyControllerAPI.java
  13. 1 1
      src/main/java/com/template/api/SmartEvaluateTeacherControllerAPI.java
  14. 14 0
      src/main/java/com/template/api/SmartFaceDiscernControllerAPI.java
  15. 5 0
      src/main/java/com/template/api/SmartIdentityControllerAPI.java
  16. 24 0
      src/main/java/com/template/api/SmartQrcodeControllerAPI.java
  17. 26 4
      src/main/java/com/template/api/SmartUserControllerAPI.java
  18. 35 2
      src/main/java/com/template/api/SmartVisitorControllerAPI.java
  19. 44 1
      src/main/java/com/template/api/SmartWarningControllerAPI.java
  20. 11 2
      src/main/java/com/template/api/WechatScanLoginControllerAPI.java
  21. 1 2
      src/main/java/com/template/common/exception/EmsExceptionHandler.java
  22. 1 0
      src/main/java/com/template/common/result/ResponseStatusEnum.java
  23. 23 0
      src/main/java/com/template/common/utils/AccessToken.java
  24. 75 0
      src/main/java/com/template/common/utils/ExcelClassField.java
  25. 22 0
      src/main/java/com/template/common/utils/ExcelUtil3.java
  26. 1008 0
      src/main/java/com/template/common/utils/ExcelUtils2.java
  27. 109 0
      src/main/java/com/template/common/utils/GetCameraPreviewURL.java
  28. 18 0
      src/main/java/com/template/common/utils/GetVertifyCode.java
  29. 530 0
      src/main/java/com/template/common/utils/HttpsClient.java
  30. 2 2
      src/main/java/com/template/common/utils/JWTUtil.java
  31. 54 0
      src/main/java/com/template/common/utils/Md5Utils.java
  32. 548 0
      src/main/java/com/template/common/utils/Message.java
  33. 78 0
      src/main/java/com/template/common/utils/Message2.java
  34. 23 0
      src/main/java/com/template/common/utils/MyX509TrustManager.java
  35. 42 0
      src/main/java/com/template/common/utils/SHA1.java
  36. 130 7
      src/main/java/com/template/common/utils/SendSms.java
  37. 1 1
      src/main/java/com/template/common/utils/TimeExchange.java
  38. 30 0
      src/main/java/com/template/common/utils/WarningEntity.java
  39. 52 0
      src/main/java/com/template/common/utils/WxConfig.java
  40. 53 0
      src/main/java/com/template/common/utils/WxConstants.java
  41. 385 0
      src/main/java/com/template/common/utils/WxUtil.java
  42. 289 0
      src/main/java/com/template/controller/HikvisionController.java
  43. 1 1
      src/main/java/com/template/controller/LoginController.java
  44. 46 10
      src/main/java/com/template/controller/SmartApplyController.java
  45. 27 3
      src/main/java/com/template/controller/SmartClassController.java
  46. 3 1
      src/main/java/com/template/controller/SmartEvaluateStudentController.java
  47. 10 8
      src/main/java/com/template/controller/SmartEvaluateTeacherController.java
  48. 82 0
      src/main/java/com/template/controller/SmartFaceDiscernController.java
  49. 46 0
      src/main/java/com/template/controller/SmartIdentityController.java
  50. 58 0
      src/main/java/com/template/controller/SmartQrcodeController.java
  51. 7 0
      src/main/java/com/template/controller/SmartScoreController.java
  52. 228 33
      src/main/java/com/template/controller/SmartUserController.java
  53. 153 14
      src/main/java/com/template/controller/SmartVisitorController.java
  54. 269 9
      src/main/java/com/template/controller/SmartWarningController.java
  55. 140 35
      src/main/java/com/template/controller/WechatScanLoginController.java
  56. 32 35
      src/main/java/com/template/core/JwtAuthenticationInterceptor.java
  57. 11 5
      src/main/java/com/template/handler/MyMetaObjectHandler.java
  58. 18 0
      src/main/java/com/template/mapper/SmartFaceDiscernMapper.java
  59. 5 0
      src/main/java/com/template/mapper/SmartIdentityMapper.java
  60. 18 0
      src/main/java/com/template/mapper/SmartQrcodeMapper.java
  61. 9 0
      src/main/java/com/template/mapper/SmartUserMapper.java
  62. 1 1
      src/main/java/com/template/mapper/SmartVisitorMapper.java
  63. 5 0
      src/main/java/com/template/mapper/SmartWarningMapper.java
  64. 10 0
      src/main/java/com/template/model/dto/OperationWarningDto.java
  65. 11 0
      src/main/java/com/template/model/dto/WarningSavePushDto.java
  66. 75 0
      src/main/java/com/template/model/enumModel/eTimeGroup.java
  67. 17 1
      src/main/java/com/template/model/pojo/SmartApply.java
  68. 79 0
      src/main/java/com/template/model/pojo/SmartFaceDiscern.java
  69. 68 0
      src/main/java/com/template/model/pojo/SmartQrcode.java
  70. 6 0
      src/main/java/com/template/model/pojo/SmartScore.java
  71. 12 0
      src/main/java/com/template/model/pojo/SmartUser.java
  72. 3 0
      src/main/java/com/template/model/pojo/SmartVisitor.java
  73. 5 2
      src/main/java/com/template/model/pojo/SmartWarning.java
  74. 6 18
      src/main/java/com/template/model/pojo/SmsCode.java
  75. 42 0
      src/main/java/com/template/model/request/bindStudentRequest.java
  76. 12 0
      src/main/java/com/template/model/request/insertScoreRequest.java
  77. 6 0
      src/main/java/com/template/model/request/insertSmartUserRequest.java
  78. 33 0
      src/main/java/com/template/model/request/turnOnTheDeviceRequest.java
  79. 12 0
      src/main/java/com/template/model/request/updateScoreRequest.java
  80. 10 4
      src/main/java/com/template/model/request/updateSmartUserRequest.java
  81. 22 0
      src/main/java/com/template/model/vo/AffiliateParentVo.java
  82. 10 0
      src/main/java/com/template/model/vo/AffiliateUserVo.java
  83. 42 0
      src/main/java/com/template/model/vo/ApplysVo.java
  84. 18 0
      src/main/java/com/template/model/vo/BaseImageVo.java
  85. 24 0
      src/main/java/com/template/model/vo/BsReservationVo.java
  86. 32 0
      src/main/java/com/template/model/vo/BsVisitorVo.java
  87. 29 0
      src/main/java/com/template/model/vo/IdentityApplyVo.java
  88. 27 0
      src/main/java/com/template/model/vo/QrcodeImageVo.java
  89. 10 0
      src/main/java/com/template/model/vo/ScorePageVo.java
  90. 10 0
      src/main/java/com/template/model/vo/ScoreVo.java
  91. 48 0
      src/main/java/com/template/model/vo/SmartClassPageVo.java
  92. 26 0
      src/main/java/com/template/model/vo/TimeGroupVo.java
  93. 28 0
      src/main/java/com/template/model/vo/TurnOnDeviceVo.java
  94. 18 0
      src/main/java/com/template/model/vo/UserVo.java
  95. 63 5
      src/main/java/com/template/model/vo/VisitorPageVo.java
  96. 202 0
      src/main/java/com/template/model/vo/WechatUserVo.java
  97. 17 0
      src/main/java/com/template/model/vo/qrCodeVo.java
  98. 6 0
      src/main/java/com/template/model/weixin/HttpParame.java
  99. 2 0
      src/main/java/com/template/services/SmartApplyService.java
  100. 0 0
      src/main/java/com/template/services/SmartClassService.java

+ 0 - 1
.idea/.name

@@ -1 +0,0 @@
-mybatis_plus

+ 0 - 22
.idea/compiler.xml

@@ -1,22 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<project version="4">
-  <component name="CompilerConfiguration">
-    <annotationProcessing>
-      <profile default="true" name="Default" enabled="true" />
-      <profile name="Maven default annotation processors profile" enabled="true">
-        <sourceOutputDir name="target/generated-sources/annotations" />
-        <sourceTestOutputDir name="target/generated-test-sources/test-annotations" />
-        <outputRelativeToContentRoot value="true" />
-        <module name="mybatis_plus" />
-      </profile>
-    </annotationProcessing>
-    <bytecodeTargetLevel>
-      <module name="mybatis_plus" target="1.8" />
-    </bytecodeTargetLevel>
-  </component>
-  <component name="JavacSettings">
-    <option name="ADDITIONAL_OPTIONS_OVERRIDE">
-      <module name="mybatis_plus" options="-parameters" />
-    </option>
-  </component>
-</project>

+ 0 - 6
.idea/encodings.xml

@@ -1,6 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<project version="4">
-  <component name="Encoding">
-    <file url="file://$PROJECT_DIR$" charset="UTF-8" />
-  </component>
-</project>

+ 0 - 451
.idea/misc.xml

@@ -1,451 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<project version="4">
-  <component name="MavenProjectsManager">
-    <option name="originalFiles">
-      <list>
-        <option value="$PROJECT_DIR$/pom.xml" />
-      </list>
-    </option>
-  </component>
-  <component name="ProjectInspectionProfilesVisibleTreeState">
-    <entry key="Project Default">
-      <profile-state>
-        <expanded-state>
-          <State />
-          <State>
-            <id>Abstraction issuesJava</id>
-          </State>
-          <State>
-            <id>AccessibilityHTML</id>
-          </State>
-          <State>
-            <id>AccessibilityLintAndroid</id>
-          </State>
-          <State>
-            <id>Android</id>
-          </State>
-          <State>
-            <id>Angular</id>
-          </State>
-          <State>
-            <id>Application Servers</id>
-          </State>
-          <State>
-            <id>Application SizePerformanceLintAndroid</id>
-          </State>
-          <State>
-            <id>Assignment issuesJava</id>
-          </State>
-          <State>
-            <id>Bean Validation</id>
-          </State>
-          <State>
-            <id>Bidirectional TextInternationalizationLintAndroid</id>
-          </State>
-          <State>
-            <id>Bitwise operation issuesJava</id>
-          </State>
-          <State>
-            <id>Bitwise operation issuesJavaScript</id>
-          </State>
-          <State>
-            <id>CDI (Contexts and Dependency Injection)</id>
-          </State>
-          <State>
-            <id>CSS</id>
-          </State>
-          <State>
-            <id>Chrome OSCorrectnessLintAndroid</id>
-          </State>
-          <State>
-            <id>Class metricsJava</id>
-          </State>
-          <State>
-            <id>Class structureJava</id>
-          </State>
-          <State>
-            <id>Cloning issuesJava</id>
-          </State>
-          <State>
-            <id>Code maturityJava</id>
-          </State>
-          <State>
-            <id>Code style issuesJava</id>
-          </State>
-          <State>
-            <id>Code style issuesJavaScript</id>
-          </State>
-          <State>
-            <id>CodeSpring CoreSpring</id>
-          </State>
-          <State>
-            <id>CoffeeScript</id>
-          </State>
-          <State>
-            <id>Compiler issuesJava</id>
-          </State>
-          <State>
-            <id>Control flow issuesGroovy</id>
-          </State>
-          <State>
-            <id>Control flow issuesJava</id>
-          </State>
-          <State>
-            <id>Control flow issuesJavaScript</id>
-          </State>
-          <State>
-            <id>CorrectnessLintAndroid</id>
-          </State>
-          <State>
-            <id>Cucumber</id>
-          </State>
-          <State>
-            <id>Declaration redundancyJava</id>
-          </State>
-          <State>
-            <id>DeclarationGroovy</id>
-          </State>
-          <State>
-            <id>Dependency issuesJava</id>
-          </State>
-          <State>
-            <id>Dockerfile</id>
-          </State>
-          <State>
-            <id>ECMAScript 6 migration aidsJavaScript</id>
-          </State>
-          <State>
-            <id>EditorConfig</id>
-          </State>
-          <State>
-            <id>EncapsulationJava</id>
-          </State>
-          <State>
-            <id>Error handlingGroovy</id>
-          </State>
-          <State>
-            <id>Error handlingJava</id>
-          </State>
-          <State>
-            <id>Error handlingJavaScript</id>
-          </State>
-          <State>
-            <id>Faces Model</id>
-          </State>
-          <State>
-            <id>FreeMarker</id>
-          </State>
-          <State>
-            <id>GPathGroovy</id>
-          </State>
-          <State>
-            <id>GSPGrailsGroovy</id>
-          </State>
-          <State>
-            <id>General</id>
-          </State>
-          <State>
-            <id>GeneralCoffeeScript</id>
-          </State>
-          <State>
-            <id>GeneralJavaScript</id>
-          </State>
-          <State>
-            <id>Google Web Toolkit</id>
-          </State>
-          <State>
-            <id>Gradle</id>
-          </State>
-          <State>
-            <id>GrailsGroovy</id>
-          </State>
-          <State>
-            <id>Groovy</id>
-          </State>
-          <State>
-            <id>Guice</id>
-          </State>
-          <State>
-            <id>HTML</id>
-          </State>
-          <State>
-            <id>Hibernate</id>
-          </State>
-          <State>
-            <id>IconsUsabilityLintAndroid</id>
-          </State>
-          <State>
-            <id>Inheritance issuesJava</id>
-          </State>
-          <State>
-            <id>InitializationJava</id>
-          </State>
-          <State>
-            <id>InternationalizationJava</id>
-          </State>
-          <State>
-            <id>InternationalizationLintAndroid</id>
-          </State>
-          <State>
-            <id>J2ME issuesJava</id>
-          </State>
-          <State>
-            <id>JBoss Seam</id>
-          </State>
-          <State>
-            <id>JPA</id>
-          </State>
-          <State>
-            <id>JSON and JSON5</id>
-          </State>
-          <State>
-            <id>JSP</id>
-          </State>
-          <State>
-            <id>JUnitJava</id>
-          </State>
-          <State>
-            <id>Java</id>
-          </State>
-          <State>
-            <id>Java 11Java language level migration aidsJava</id>
-          </State>
-          <State>
-            <id>Java 5Java language level migration aidsJava</id>
-          </State>
-          <State>
-            <id>Java 7Java language level migration aidsJava</id>
-          </State>
-          <State>
-            <id>Java 8Java language level migration aidsJava</id>
-          </State>
-          <State>
-            <id>Java 9Java language level migration aidsJava</id>
-          </State>
-          <State>
-            <id>Java EE</id>
-          </State>
-          <State>
-            <id>Java interop issuesKotlin</id>
-          </State>
-          <State>
-            <id>Java language level migration aidsJava</id>
-          </State>
-          <State>
-            <id>JavaBeans issuesJava</id>
-          </State>
-          <State>
-            <id>JavaFX</id>
-          </State>
-          <State>
-            <id>JavaScript</id>
-          </State>
-          <State>
-            <id>JavaScript function metricsJavaScript</id>
-          </State>
-          <State>
-            <id>JavadocJava</id>
-          </State>
-          <State>
-            <id>Kotlin</id>
-          </State>
-          <State>
-            <id>Language Injection</id>
-          </State>
-          <State>
-            <id>LintAndroid</id>
-          </State>
-          <State>
-            <id>LoggingJava</id>
-          </State>
-          <State>
-            <id>Lombok</id>
-          </State>
-          <State>
-            <id>Manifest</id>
-          </State>
-          <State>
-            <id>Markdown</id>
-          </State>
-          <State>
-            <id>Maven</id>
-          </State>
-          <State>
-            <id>MavenMigrationKotlin</id>
-          </State>
-          <State>
-            <id>MemoryJava</id>
-          </State>
-          <State>
-            <id>MessagesCorrectnessLintAndroid</id>
-          </State>
-          <State>
-            <id>Method metricsGroovy</id>
-          </State>
-          <State>
-            <id>Method metricsJava</id>
-          </State>
-          <State>
-            <id>MigrationKotlin</id>
-          </State>
-          <State>
-            <id>Modularization issuesJava</id>
-          </State>
-          <State>
-            <id>Naming conventionsGroovy</id>
-          </State>
-          <State>
-            <id>Naming conventionsJava</id>
-          </State>
-          <State>
-            <id>Naming conventionsJavaScript</id>
-          </State>
-          <State>
-            <id>Numeric issuesJava</id>
-          </State>
-          <State>
-            <id>OSGi</id>
-          </State>
-          <State>
-            <id>Packaging issuesJava</id>
-          </State>
-          <State>
-            <id>Pattern Validation</id>
-          </State>
-          <State>
-            <id>PerformanceJava</id>
-          </State>
-          <State>
-            <id>PerformanceLintAndroid</id>
-          </State>
-          <State>
-            <id>Plugin DevKit</id>
-          </State>
-          <State>
-            <id>PortabilityJava</id>
-          </State>
-          <State>
-            <id>Potentially confusing code constructsGroovy</id>
-          </State>
-          <State>
-            <id>Potentially confusing code constructsJavaScript</id>
-          </State>
-          <State>
-            <id>Probable bugsCSS</id>
-          </State>
-          <State>
-            <id>Probable bugsGradle</id>
-          </State>
-          <State>
-            <id>Probable bugsJava</id>
-          </State>
-          <State>
-            <id>Probable bugsJavaScript</id>
-          </State>
-          <State>
-            <id>Probable bugsKotlin</id>
-          </State>
-          <State>
-            <id>Properties Files</id>
-          </State>
-          <State>
-            <id>RELAX NG</id>
-          </State>
-          <State>
-            <id>Reactor</id>
-          </State>
-          <State>
-            <id>Redundant constructsKotlin</id>
-          </State>
-          <State>
-            <id>Reflective accessJava</id>
-          </State>
-          <State>
-            <id>RegExp</id>
-          </State>
-          <State>
-            <id>Resource managementJava</id>
-          </State>
-          <State>
-            <id>SQL</id>
-          </State>
-          <State>
-            <id>SecurityJava</id>
-          </State>
-          <State>
-            <id>SecurityLintAndroid</id>
-          </State>
-          <State>
-            <id>Serialization issuesJava</id>
-          </State>
-          <State>
-            <id>SetupSpring CoreSpring</id>
-          </State>
-          <State>
-            <id>Spring</id>
-          </State>
-          <State>
-            <id>Spring AOPSpring</id>
-          </State>
-          <State>
-            <id>Spring CoreSpring</id>
-          </State>
-          <State>
-            <id>Struts</id>
-          </State>
-          <State>
-            <id>Struts 1Struts</id>
-          </State>
-          <State>
-            <id>Style issuesKotlin</id>
-          </State>
-          <State>
-            <id>TestNGJava</id>
-          </State>
-          <State>
-            <id>Threading issuesGroovy</id>
-          </State>
-          <State>
-            <id>Threading issuesJava</id>
-          </State>
-          <State>
-            <id>TypeScript</id>
-          </State>
-          <State>
-            <id>TypographyUsabilityLintAndroid</id>
-          </State>
-          <State>
-            <id>UI Form</id>
-          </State>
-          <State>
-            <id>UsabilityLintAndroid</id>
-          </State>
-          <State>
-            <id>Velocity</id>
-          </State>
-          <State>
-            <id>Verbose or redundant code constructsJava</id>
-          </State>
-          <State>
-            <id>WebSocket</id>
-          </State>
-          <State>
-            <id>XML</id>
-          </State>
-          <State>
-            <id>XMLSpring CoreSpring</id>
-          </State>
-          <State>
-            <id>XPath</id>
-          </State>
-          <State>
-            <id>YAML</id>
-          </State>
-        </expanded-state>
-      </profile-state>
-    </entry>
-  </component>
-  <component name="ProjectRootManager" version="2" languageLevel="JDK_1_8" project-jdk-name="1.8" project-jdk-type="JavaSDK">
-    <output url="file://$PROJECT_DIR$/classes" />
-  </component>
-</project>

+ 0 - 6
.idea/vcs.xml

@@ -1,6 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<project version="4">
-  <component name="VcsDirectoryMappings">
-    <mapping directory="" vcs="Git" />
-  </component>
-</project>

تفاوت فایلی نمایش داده نمی شود زیرا این فایل بسیار بزرگ است
+ 423 - 369
.idea/workspace.xml


+ 30 - 7
pom.xml

@@ -21,6 +21,26 @@
 
 
     <dependencies>
     <dependencies>
 
 
+
+        <dependency>
+            <groupId>com.google.zxing</groupId>
+            <artifactId>core</artifactId>
+            <version>3.5.1</version>
+        </dependency>
+
+        <dependency>
+            <groupId>com.github.binarywang</groupId>
+            <artifactId>weixin-java-mp</artifactId>
+            <version>4.3.0</version>
+        </dependency>
+
+        <!-- 海康 -->
+        <dependency>
+            <groupId>com.hikvision.ga</groupId>
+            <artifactId>artemis-http-client</artifactId>
+            <version>1.1.3</version>
+        </dependency>
+
         <dependency>
         <dependency>
             <groupId>open.platform</groupId>
             <groupId>open.platform</groupId>
             <artifactId>platform</artifactId>
             <artifactId>platform</artifactId>
@@ -191,13 +211,6 @@
             <version>2.0.2</version>
             <version>2.0.2</version>
         </dependency>
         </dependency>
 
 
-        <!--腾讯云COS-->
-        <dependency>
-            <groupId>com.tencentcloudapi</groupId>
-            <artifactId>tencentcloud-sdk-java</artifactId>
-            <version>3.0.1</version>
-        </dependency>
-
         <dependency>
         <dependency>
             <groupId>com.qcloud</groupId>
             <groupId>com.qcloud</groupId>
             <artifactId>cos_api</artifactId>
             <artifactId>cos_api</artifactId>
@@ -236,6 +249,16 @@
             <artifactId>commons-fileupload</artifactId>
             <artifactId>commons-fileupload</artifactId>
             <version>1.4</version>
             <version>1.4</version>
         </dependency>
         </dependency>
+        <dependency>
+            <groupId>com.alibaba</groupId>
+            <artifactId>druid</artifactId>
+            <version>1.2.16</version>
+        </dependency>
+        <dependency>
+            <groupId>com.alibaba</groupId>
+            <artifactId>easyexcel</artifactId>
+            <version>2.2.11</version>
+        </dependency>
     </dependencies>
     </dependencies>
 
 
     <build>
     <build>

+ 1 - 1
src/main/java/com/template/AutoCode.java

@@ -56,7 +56,7 @@ public class AutoCode {
         mpg.setPackageInfo(pc);
         mpg.setPackageInfo(pc);
         //4、策略配置
         //4、策略配置
         StrategyConfig strategy = new StrategyConfig();
         StrategyConfig strategy = new StrategyConfig();
-        strategy.setInclude("smart_duties"); // 设置要映射的表名"smart_class","smart_grade","smart_attendance"
+        strategy.setInclude("smart_qrcode"); // 设置要映射的表名"smart_class","smart_grade","smart_attendance"
         strategy.setNaming(NamingStrategy.underline_to_camel);//下划线转驼峰
         strategy.setNaming(NamingStrategy.underline_to_camel);//下划线转驼峰
         strategy.setColumnNaming(NamingStrategy.underline_to_camel);//下划线转驼峰
         strategy.setColumnNaming(NamingStrategy.underline_to_camel);//下划线转驼峰
         strategy.setEntityLombokModel(true); // 自动lombok;
         strategy.setEntityLombokModel(true); // 自动lombok;

+ 18 - 0
src/main/java/com/template/annotation/ExcelExport.java

@@ -0,0 +1,18 @@
+package com.template.annotation;
+
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+
+@Target({ElementType.FIELD})
+@Retention(RetentionPolicy.RUNTIME)
+public @interface ExcelExport {
+    String value();
+
+    int sort() default 0;
+
+    String kv() default "";
+
+    String example() default "";
+}

+ 20 - 0
src/main/java/com/template/annotation/ExcelImport.java

@@ -0,0 +1,20 @@
+package com.template.annotation;
+
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+
+@Target({ElementType.FIELD})
+@Retention(RetentionPolicy.RUNTIME)
+public @interface ExcelImport {
+    String value();
+
+    String kv() default "";
+
+    boolean required() default false;
+
+    int maxLength() default 255;
+
+    boolean unique() default false;
+}

+ 29 - 0
src/main/java/com/template/api/HikvisionAPI.java

@@ -0,0 +1,29 @@
+package com.template.api;
+
+import com.alibaba.fastjson.JSONObject;
+import io.swagger.annotations.Api;
+
+import javax.servlet.http.HttpServletRequest;
+
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+
+@RequestMapping({"/eventRcv"})
+@Api(tags = {"HikvisionController"}, value = "海康威视回调地址")
+public interface HikvisionAPI {
+    @PostMapping({"/subscription"})
+    void subscription(HttpServletRequest request);
+
+    @PostMapping({"/faceComparison"})
+    void faceComparison(HttpServletRequest request);
+
+    @PostMapping({"/emphasisFace"})
+    void emphasisFace(HttpServletRequest request);
+
+    @PostMapping({"/playback"})
+    JSONObject playback();
+
+    @PostMapping({"/general"})
+    JSONObject general(@RequestBody JSONObject jsonObject);
+}

+ 4 - 0
src/main/java/com/template/api/SmartApplyControllerAPI.java

@@ -42,4 +42,8 @@ public interface SmartApplyControllerAPI {
     @GetMapping(value = "/deleteSmartApplyById")
     @GetMapping(value = "/deleteSmartApplyById")
     @ApiOperation(value = "根据ID删除指定应用管理", notes = "根据ID删除指定应用管理", httpMethod = "GET")
     @ApiOperation(value = "根据ID删除指定应用管理", notes = "根据ID删除指定应用管理", httpMethod = "GET")
     CommonResult deleteSmartApplyById(@RequestParam int id);
     CommonResult deleteSmartApplyById(@RequestParam int id);
+
+    @GetMapping(value = "/queryAppletApplys")
+    @ApiOperation(value = "获取小程序应用权限", notes = "获取小程序应用权限", httpMethod = "GET")
+    CommonResult queryAppletApplys();
 }
 }

+ 1 - 1
src/main/java/com/template/api/SmartEvaluateTeacherControllerAPI.java

@@ -45,6 +45,6 @@ public interface SmartEvaluateTeacherControllerAPI {
 
 
     @RequestMapping(value = "/getScoreRank")
     @RequestMapping(value = "/getScoreRank")
     @ApiOperation(value = "评分排行", httpMethod = "POST")
     @ApiOperation(value = "评分排行", httpMethod = "POST")
-    public CommonResult getScoreRank(int currentPage, int pageCount,String scoreItem);
+    public CommonResult getScoreRank(int currentPage, int pageCount,String subject);
 
 
 }
 }

+ 14 - 0
src/main/java/com/template/api/SmartFaceDiscernControllerAPI.java

@@ -0,0 +1,14 @@
+package com.template.api;
+
+import com.template.model.result.CommonResult;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestParam;
+
+@RequestMapping("/api/smartFaceDiscern")
+public interface SmartFaceDiscernControllerAPI {
+
+        @GetMapping(value = "/track")
+    CommonResult track(@RequestParam Integer id, @RequestParam int dateTime);
+
+}

+ 5 - 0
src/main/java/com/template/api/SmartIdentityControllerAPI.java

@@ -38,4 +38,9 @@ public interface SmartIdentityControllerAPI {
     @GetMapping(value = "/querySmartIdentitys")
     @GetMapping(value = "/querySmartIdentitys")
     @ApiOperation(value = "获取身份集合", notes = "获取身份集合", httpMethod = "GET")
     @ApiOperation(value = "获取身份集合", notes = "获取身份集合", httpMethod = "GET")
     CommonResult querySmartIdentitys();
     CommonResult querySmartIdentitys();
+
+    @GetMapping(value = "/queryIdentityApplyById")
+    @ApiOperation(value = "根据身份ID查询应用权限", notes = "根据身份ID查询应用权限", httpMethod = "GET")
+    CommonResult queryIdentityApplyById(@RequestParam int id);
+
 }
 }

+ 24 - 0
src/main/java/com/template/api/SmartQrcodeControllerAPI.java

@@ -0,0 +1,24 @@
+package com.template.api;
+
+import com.template.model.pojo.SmartQrcode;
+import com.template.model.result.CommonResult;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import org.springframework.validation.BindingResult;
+import org.springframework.validation.annotation.Validated;
+import org.springframework.web.bind.annotation.*;
+
+/**
+ * @Author: binguo
+ * @Date: 2023/3/30 星期四 17:28
+ * @Description: com.video.api
+ * @Version: 1.0
+ */
+@RequestMapping("/api/smartQrcode")
+@Api(tags = {"SmartQrcodeControllerAPI"}, value = "刷码记录")
+public interface SmartQrcodeControllerAPI {
+
+    @GetMapping(value = "/generateQrcode")
+    @ApiOperation(value = "生成二维码", notes = "生成二维码", httpMethod = "GET")
+    CommonResult generateQrcode(@RequestParam int userId);
+}

+ 26 - 4
src/main/java/com/template/api/SmartUserControllerAPI.java

@@ -1,9 +1,6 @@
 package com.template.api;
 package com.template.api;
 
 
-import com.template.model.request.changeDepartmentRequest;
-import com.template.model.request.insertSmartUserRequest;
-import com.template.model.request.updateSmartUserRequest;
-import com.template.model.request.useridsRequest;
+import com.template.model.request.*;
 import com.template.model.result.CommonResult;
 import com.template.model.result.CommonResult;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
 import io.swagger.annotations.ApiOperation;
@@ -88,6 +85,13 @@ public interface SmartUserControllerAPI {
     CommonResult queryAffiliateUserById(@RequestParam int id);
     CommonResult queryAffiliateUserById(@RequestParam int id);
 
 
     /**
     /**
+     * 时间组数据集合
+     */
+    @GetMapping(value = "/timeGroups")
+    @ApiOperation(value = "时间组数据集合", notes = "时间组数据集合", httpMethod = "GET")
+    CommonResult timeGroups();
+
+    /**
      * 导出人员模板
      * 导出人员模板
      * @return
      * @return
      */
      */
@@ -102,4 +106,22 @@ public interface SmartUserControllerAPI {
     @GetMapping(value = "/queryStudents")
     @GetMapping(value = "/queryStudents")
     @ApiOperation(value = "根据用户ID查询学生", notes = "根据用户ID查询学生", httpMethod = "GET")
     @ApiOperation(value = "根据用户ID查询学生", notes = "根据用户ID查询学生", httpMethod = "GET")
     CommonResult queryStudents(@RequestParam int userId);
     CommonResult queryStudents(@RequestParam int userId);
+
+    /**
+     * 根据数据ID获取用户信息
+     */
+    @GetMapping(value = "/queryInfoData")
+    @ApiOperation(value = "根据数据ID获取用户信息", notes = "根据数据ID获取用户信息", httpMethod = "GET")
+    CommonResult queryInfoData(@RequestParam int id);
+
+    /**
+     * 绑定学生
+     * @param isur
+     * @param bindingResult
+     * @return
+     */
+    @PostMapping(value = "/bindStudent")
+    @ApiOperation(value = "绑定学生", notes = "绑定学生", httpMethod = "POST")
+    CommonResult bindStudent(@Validated @RequestBody bindStudentRequest isur, BindingResult bindingResult);
+
 }
 }

+ 35 - 2
src/main/java/com/template/api/SmartVisitorControllerAPI.java

@@ -1,9 +1,12 @@
 package com.template.api;
 package com.template.api;
 
 
+import com.fasterxml.jackson.core.JsonProcessingException;
 import com.template.model.pojo.SmartVisitor;
 import com.template.model.pojo.SmartVisitor;
 import com.template.model.request.otherAppointmentRequest;
 import com.template.model.request.otherAppointmentRequest;
 import com.template.model.request.parentsAppointmentRequest;
 import com.template.model.request.parentsAppointmentRequest;
+import com.template.model.request.turnOnTheDeviceRequest;
 import com.template.model.result.CommonResult;
 import com.template.model.result.CommonResult;
+import com.template.model.vo.TurnOnDeviceVo;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
 import io.swagger.annotations.ApiOperation;
 import org.springframework.validation.BindingResult;
 import org.springframework.validation.BindingResult;
@@ -59,11 +62,30 @@ public interface SmartVisitorControllerAPI {
      *             待审核:1
      *             待审核:1
      *             已拒绝:2
      *             已拒绝:2
      *             已推送:3
      *             已推送:3
+     *
+     * @return
+     */
+
+    /**
+     * 预约记录分页数据
+     * @param currentPage 当前页数
+     * @param pageCount 一页数据条数
+     * @param userId 用户ID
+     * @param type 类型:
+     *             全部:0
+     *             待审核:1
+     *             已拒绝:2
+     *             已推送:3
+     * @param createStartTime 创建起始时间
+     * @param createEndTime 创建结束时间
+     * @param keyWord 关键字
+     * @param visitorStartTime 来访起始时间
+     * @param visitorEndTime 来访结束时间
      * @return
      * @return
      */
      */
     @GetMapping(value = "/appointmentPageRecord")
     @GetMapping(value = "/appointmentPageRecord")
     @ApiOperation(value = "当前用户的预约记录", notes = "当前用户的预约记录", httpMethod = "GET")
     @ApiOperation(value = "当前用户的预约记录", notes = "当前用户的预约记录", httpMethod = "GET")
-    CommonResult appointmentPageRecord(@RequestParam int currentPage, @RequestParam int pageCount, Integer userId, @RequestParam int type);
+    CommonResult appointmentPageRecord(@RequestParam int currentPage, @RequestParam int pageCount, Integer userId, @RequestParam int type, String createStartTime, String createEndTime, String keyWord, String visitorStartTime,String visitorEndTime);
 
 
     /**
     /**
      * 访客记录审核
      * 访客记录审核
@@ -78,14 +100,25 @@ public interface SmartVisitorControllerAPI {
     CommonResult examineRecord(@RequestParam int id,@RequestParam int type) throws Exception;
     CommonResult examineRecord(@RequestParam int id,@RequestParam int type) throws Exception;
 
 
     /**
     /**
-     * 获取到访记录数据
+     *
      * @param currentPage 当前页
      * @param currentPage 当前页
      * @param pageCount 一页数据条数
      * @param pageCount 一页数据条数
      * @param userId 用户ID
      * @param userId 用户ID
+     * @param type 类型:待审核:1
+     *                  已拒绝:2
+     *                  已推送:3
      * @return
      * @return
      */
      */
     @GetMapping(value = "/visitingAgencys")
     @GetMapping(value = "/visitingAgencys")
     @ApiOperation(value = "获取到访记录数据", notes = "获取到访记录数据", httpMethod = "GET")
     @ApiOperation(value = "获取到访记录数据", notes = "获取到访记录数据", httpMethod = "GET")
     CommonResult visitingAgencys(@RequestParam int currentPage, @RequestParam int pageCount, @RequestParam int userId, @RequestParam int type);
     CommonResult visitingAgencys(@RequestParam int currentPage, @RequestParam int pageCount, @RequestParam int userId, @RequestParam int type);
 
 
+    /**
+     * 其他访客预约
+     * 其他访客预约数据就发给管理员审核
+     */
+    @PostMapping(value = "/turnOnTheDevice")
+    @ApiOperation(value = "其他访客预约", notes = "其他访客预约", httpMethod = "POST")
+    TurnOnDeviceVo turnOnTheDevice(@RequestBody turnOnTheDeviceRequest data) throws JsonProcessingException;
+
 }
 }

+ 44 - 1
src/main/java/com/template/api/SmartWarningControllerAPI.java

@@ -1,5 +1,8 @@
 package com.template.api;
 package com.template.api;
 
 
+import com.baomidou.mybatisplus.extension.api.R;
+import com.template.model.dto.OperationWarningDto;
+import com.template.model.dto.WarningSavePushDto;
 import com.template.model.pojo.SmartWarning;
 import com.template.model.pojo.SmartWarning;
 import com.template.model.result.CommonResult;
 import com.template.model.result.CommonResult;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.Api;
@@ -8,6 +11,8 @@ import org.springframework.validation.BindingResult;
 import org.springframework.validation.annotation.Validated;
 import org.springframework.validation.annotation.Validated;
 import org.springframework.web.bind.annotation.*;
 import org.springframework.web.bind.annotation.*;
 
 
+import javax.servlet.http.HttpServletResponse;
+
 /**
 /**
  * @Author: binguo
  * @Author: binguo
  * @Date: 2023/3/30 星期四 17:28
  * @Date: 2023/3/30 星期四 17:28
@@ -27,9 +32,47 @@ public interface SmartWarningControllerAPI {
 
 
     @GetMapping(value = "/queryPageSmartWarning")
     @GetMapping(value = "/queryPageSmartWarning")
     @ApiOperation(value = "预警信息分页数据", notes = "预警信息分页数据", httpMethod = "GET")
     @ApiOperation(value = "预警信息分页数据", notes = "预警信息分页数据", httpMethod = "GET")
-    CommonResult queryPageSmartWarning(@RequestParam int currentPage, @RequestParam int pageCount, String name);
+    CommonResult queryPageSmartWarning(@RequestParam int currentPage, @RequestParam int pageCount, String name,String state);
 
 
     @GetMapping(value = "/deleteSmartWarningById")
     @GetMapping(value = "/deleteSmartWarningById")
     @ApiOperation(value = "根据ID删除指定预警信息", notes = "根据ID删除指定预警信息", httpMethod = "GET")
     @ApiOperation(value = "根据ID删除指定预警信息", notes = "根据ID删除指定预警信息", httpMethod = "GET")
     CommonResult deleteSmartWarningById(@RequestParam int id);
     CommonResult deleteSmartWarningById(@RequestParam int id);
+
+    @PostMapping(value = "/operation")
+    @ApiOperation(value = "根据ID操作", notes = "根据ID操作", httpMethod = "POST")
+    CommonResult operation(@RequestBody OperationWarningDto operationWarningDto);
+
+    @GetMapping(value = "/excelSmartWarning")
+    @ApiOperation(value = "预警导出", notes = "预警导出", httpMethod = "GET")
+    void excelSmartWarning(HttpServletResponse response,String location,String state);
+
+    @GetMapping(value = "/warningType")
+    @ApiOperation(value = "预警小程序下拉框", notes = "预警小程序下拉框", httpMethod = "GET")
+    CommonResult warningType();
+
+    @GetMapping(value = "/pageWarning")
+    @ApiOperation(value = "预警小程序分页展示", notes = "预警小程序分页展示", httpMethod = "GET")
+    CommonResult pageWarning(@RequestParam int currentPage, @RequestParam int pageCount,@RequestParam String type,@RequestParam String dateTime);
+
+    @GetMapping(value = "/warningDepartmentTree")
+    @ApiOperation(value = "查询部门树形结构数据", notes = "查询部门树形结构数据", httpMethod = "GET")
+    CommonResult warningDepartmentTree();
+
+    @GetMapping(value = "/warningUserList")
+    @ApiOperation(value = "预警推送用户分页", notes = "预警推送用户分页", httpMethod = "GET")
+    CommonResult warningUserList(@RequestParam int currentPage, @RequestParam int pageCount,Integer departmentId,String name);
+
+    @GetMapping(value = "/warningPushList")
+    @ApiOperation(value = "可推送用户展示", notes = "预警推送用户分页", httpMethod = "GET")
+    CommonResult warningPushList();
+
+    @PostMapping(value = "/warningSavePush")
+    @ApiOperation(value = "添加预警可推送用户", notes = "添加预警可推送用户", httpMethod = "POST")
+    CommonResult warningSavePush(@RequestBody WarningSavePushDto warningSavePushDto);
+
+    @GetMapping(value = "/warningDeletePush")
+    @ApiOperation(value = "删除预警可推送用户", notes = "删除预警可推送用户", httpMethod = "GET")
+    CommonResult warningDeletePush(Integer id);
+
+
 }
 }

+ 11 - 2
src/main/java/com/template/api/WechatScanLoginControllerAPI.java

@@ -7,6 +7,7 @@ import io.swagger.annotations.ApiOperation;
 import org.springframework.ui.Model;
 import org.springframework.ui.Model;
 import org.springframework.web.bind.annotation.GetMapping;
 import org.springframework.web.bind.annotation.GetMapping;
 import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestParam;
 import org.springframework.web.bind.annotation.ResponseBody;
 import org.springframework.web.bind.annotation.ResponseBody;
 
 
 import java.io.UnsupportedEncodingException;
 import java.io.UnsupportedEncodingException;
@@ -26,11 +27,11 @@ public interface WechatScanLoginControllerAPI {
 
 
     @RequestMapping(value = "/bind")
     @RequestMapping(value = "/bind")
     @ApiOperation(value = "绑定微信", httpMethod = "GET")
     @ApiOperation(value = "绑定微信", httpMethod = "GET")
-    public String bindUserMac(String cardNo) throws UnsupportedEncodingException;
+    public String bindUserMac(String phone,String messageCode) throws UnsupportedEncodingException;
 
 
     @RequestMapping(value = "/bindcallback")
     @RequestMapping(value = "/bindcallback")
     @ApiOperation(value = "绑定微信回调url", httpMethod = "GET")
     @ApiOperation(value = "绑定微信回调url", httpMethod = "GET")
-    public String bindcallback(String code, String state, String cardNo) throws UnsupportedEncodingException;
+    public String bindcallback(String code, String state, String phone,String messageCode) throws UnsupportedEncodingException;
 
 
     @RequestMapping(value = "/insertMonthMeter")
     @RequestMapping(value = "/insertMonthMeter")
     @ResponseBody
     @ResponseBody
@@ -79,4 +80,12 @@ public interface WechatScanLoginControllerAPI {
     @RequestMapping(value = "/vertify")
     @RequestMapping(value = "/vertify")
     @ResponseBody
     @ResponseBody
     public CommonResult vertify(String code);
     public CommonResult vertify(String code);
+
+    @RequestMapping(value = "/sendMessage")
+    @ResponseBody
+    public CommonResult sendMessage(@RequestParam String phone);
+
+    @RequestMapping(value = "/vertifyMessage")
+    @ResponseBody
+    public CommonResult vertifyMessage(String phone,String code, String wxcode);
 }
 }

+ 1 - 2
src/main/java/com/template/common/exception/EmsExceptionHandler.java

@@ -67,9 +67,8 @@ public class EmsExceptionHandler {
     @ResponseBody
     @ResponseBody
     public CommonResult exception(Exception e) {
     public CommonResult exception(Exception e) {
         e.printStackTrace();
         e.printStackTrace();
-        //String error=e.getFieldError().getDefaultMessage();
         logger.error("错误信息",e.fillInStackTrace());
         logger.error("错误信息",e.fillInStackTrace());
-        return CommonResult.resultValue(ResponseStatusEnum.SYSTEM_ERROR);
+        return CommonResult.fail(e.getMessage());
     }
     }
 
 
     //mysql连接超时
     //mysql连接超时

+ 1 - 0
src/main/java/com/template/common/result/ResponseStatusEnum.java

@@ -38,6 +38,7 @@ public enum ResponseStatusEnum implements Code{
     SYSTEM_TOKEN_ERROR(558,false,"token为空"),
     SYSTEM_TOKEN_ERROR(558,false,"token为空"),
     SYSTEM_LOGIN_ERROR(559,false,"无效token"),
     SYSTEM_LOGIN_ERROR(559,false,"无效token"),
     PARAM_ERROR(560, false, "参数不能为空!"),
     PARAM_ERROR(560, false, "参数不能为空!"),
+    GZH_ERROR(561, false, "设置失败,请先关联公众号!"),
     EXISTS(999,false,"已存在");
     EXISTS(999,false,"已存在");
 
 
     // 响应业务状态
     // 响应业务状态

+ 23 - 0
src/main/java/com/template/common/utils/AccessToken.java

@@ -0,0 +1,23 @@
+package com.template.common.utils;
+
+public class AccessToken {
+	private String access_token;// 网页获取用户信息凭证
+	private String expires_in;// 有效时间
+
+	public String getAccess_token() {
+		return access_token;
+	}
+
+	public void setAccess_token(String access_token) {
+		this.access_token = access_token;
+	}
+
+	public String getExpires_in() {
+		return expires_in;
+	}
+
+	public void setExpires_in(String expires_in) {
+		this.expires_in = expires_in;
+	}
+
+}

+ 75 - 0
src/main/java/com/template/common/utils/ExcelClassField.java

@@ -0,0 +1,75 @@
+package com.template.common.utils;
+ 
+import java.util.LinkedHashMap;
+ 
+/**
+ *  */
+public class ExcelClassField {
+ 
+    /** 字段名称 */
+    private String fieldName;
+ 
+    /** 表头名称 */
+    private String name;
+ 
+    /** 映射关系 */
+    private LinkedHashMap<String, String> kvMap;
+ 
+    /** 示例值 */
+    private Object example;
+ 
+    /** 排序 */
+    private int sort;
+ 
+    /** 是否为注解字段:0-否,1-是 */
+    private int hasAnnotation;
+ 
+    public String getFieldName() {
+        return fieldName;
+    }
+ 
+    public void setFieldName(String fieldName) {
+        this.fieldName = fieldName;
+    }
+ 
+    public String getName() {
+        return name;
+    }
+ 
+    public void setName(String name) {
+        this.name = name;
+    }
+ 
+    public LinkedHashMap<String, String> getKvMap() {
+        return kvMap;
+    }
+ 
+    public void setKvMap(LinkedHashMap<String, String> kvMap) {
+        this.kvMap = kvMap;
+    }
+ 
+    public Object getExample() {
+        return example;
+    }
+ 
+    public void setExample(Object example) {
+        this.example = example;
+    }
+ 
+    public int getSort() {
+        return sort;
+    }
+ 
+    public void setSort(int sort) {
+        this.sort = sort;
+    }
+ 
+    public int getHasAnnotation() {
+        return hasAnnotation;
+    }
+ 
+    public void setHasAnnotation(int hasAnnotation) {
+        this.hasAnnotation = hasAnnotation;
+    }
+ 
+}

+ 22 - 0
src/main/java/com/template/common/utils/ExcelUtil3.java

@@ -0,0 +1,22 @@
+package com.template.common.utils;
+
+
+
+import com.alibaba.excel.EasyExcel;
+import com.alibaba.excel.support.ExcelTypeEnum;
+
+import javax.servlet.http.HttpServletResponse;
+import java.io.IOException;
+import java.net.URLEncoder;
+import java.util.List;
+
+public class ExcelUtil3 {
+
+    public static void process(String fileName, List target, Class clazs , HttpServletResponse response) throws IOException {
+        response.setCharacterEncoding("UTF-8");
+        response.setContentType("application/vnd.ms-excel");
+        response.setHeader("Content-Disposition", "attachment;filename=" + URLEncoder.encode(fileName, "utf-8"));
+        EasyExcel.write(response.getOutputStream(), clazs).excelType(ExcelTypeEnum.XLSX).autoCloseStream(Boolean.TRUE)
+                .sheet("预警报表").doWrite(target);
+    }
+}

تفاوت فایلی نمایش داده نمی شود زیرا این فایل بسیار بزرگ است
+ 1008 - 0
src/main/java/com/template/common/utils/ExcelUtils2.java


+ 109 - 0
src/main/java/com/template/common/utils/GetCameraPreviewURL.java

@@ -0,0 +1,109 @@
+//
+// Source code recreated from a .class file by IntelliJ IDEA
+// (powered by FernFlower decompiler)
+//
+
+package com.template.common.utils;
+
+import com.alibaba.fastjson.JSONArray;
+import com.alibaba.fastjson.JSONObject;
+import com.hikvision.artemis.sdk.ArtemisHttpUtil;
+import com.hikvision.artemis.sdk.config.ArtemisConfig;
+
+import java.util.HashMap;
+import java.util.Map;
+
+/**
+ * 调用海康接口工具类
+ */
+public class GetCameraPreviewURL {
+    public GetCameraPreviewURL() {
+    }
+
+    public static String GetCameraPreviewURL() {
+        ArtemisConfig.host = "192.168.161.72:443";
+        ArtemisConfig.appKey = "29849943";
+        ArtemisConfig.appSecret = "e1eXZtEvJhi4waZmSgmd";
+        String ARTEMIS_PATH = "/artemis";
+        String previewURLsApi = "/artemis/api/eventService/v1/eventSubscriptionByEventTypes";
+        Map<String, String> path = new HashMap<String, String>(2) {
+            {
+                this.put("https://", "/artemis/api/eventService/v1/eventSubscriptionByEventTypes");
+            }
+        };
+        String contentType = "application/json";
+        JSONObject jsonBody = new JSONObject();
+        int[] ingArr = new int[]{131588, 131586, 131587, 131603, 131608, 131604, 930335};
+        jsonBody.put("eventTypes", ingArr);
+        String url = "http://192.168.161.224:8080/wanzai/eventRcv/subscription";
+        jsonBody.put("eventDest", url);
+        String body = jsonBody.toJSONString();
+        String result = ArtemisHttpUtil.doPostStringArtemis(path, body, (Map) null, (String) null, contentType, (Map) null);
+        return result;
+    }
+
+    public static String CameraPreviewURL(String url, JSONObject jsonBody) {
+        ArtemisConfig.host = "192.168.161.72:443";
+        ArtemisConfig.appKey = "29849943";
+        ArtemisConfig.appSecret = "e1eXZtEvJhi4waZmSgmd";
+        String ARTEMIS_PATH = "/artemis";
+        final String previewURLsApi = "/artemis" + url;
+        Map<String, String> path = new HashMap<String, String>(2) {
+            {
+                this.put("https://", previewURLsApi);
+            }
+        };
+        String contentType = "application/json";
+        String body = jsonBody.toJSONString();
+        String result = ArtemisHttpUtil.doPostStringArtemis(path, body, (Map) null, (String) null, contentType, (Map) null);
+        return result;
+    }
+
+    public static String CameraPreviewURL2(String url, JSONArray jsonBody) {
+        ArtemisConfig.host = "192.168.161.72:443";
+        ArtemisConfig.appKey = "29849943";
+        ArtemisConfig.appSecret = "e1eXZtEvJhi4waZmSgmd";
+        String ARTEMIS_PATH = "/artemis";
+        final String previewURLsApi = "/artemis" + url;
+        Map<String, String> path = new HashMap<String, String>(2) {
+            {
+                this.put("https://", previewURLsApi);
+            }
+        };
+        String contentType = "application/json";
+        String body = jsonBody.toString();
+        String result = ArtemisHttpUtil.doPostStringArtemis(path, body, (Map) null, (String) null, contentType, (Map) null);
+        return result;
+    }
+
+    public static void main(String[] args) {
+        JSONObject jsonBody = new JSONObject();
+
+//        人脸比对
+        int[] ingArr=new int[]{131659};
+        String url = "http://192.168.161.224:8080/wanzai/eventRcv/faceComparison";
+//        String url = "https://www.campussmartlife.com/smartApi/wanzai/eventRcv/faceComparison";
+
+//        区域入侵,进入区域,离开区域,倒地
+//        int[] ingArr=new int[]{131588,131586,131587,131605};
+//        String url = "http://192.168.161.224:8080/wanzai/eventRcv/subscription";
+//        String url = "https://www.campussmartlife.com/smartApi/wanzai/eventRcv/subscription";
+
+//        重点人员识别事件
+//        int[] ingArr = new int[]{1644175361};
+//        String url = "http://192.168.161.224:8080/wanzai/eventRcv/emphasisFace";
+//        String url = "https://www.campussmartlife.com/smartApi/wanzai/eventRcv/emphasisFace";
+
+
+        jsonBody.put("eventTypes", ingArr);
+        jsonBody.put("eventDest", url);
+//        订阅
+        String result = CameraPreviewURL("/api/eventService/v1/eventSubscriptionByEventTypes", jsonBody);
+
+//        取消订阅
+//        String result = CameraPreviewURL("/api/eventService/v1/eventUnSubscriptionByEventTypes", jsonBody);
+
+
+        System.out.println("result结果示例: " + result);
+    }
+}

+ 18 - 0
src/main/java/com/template/common/utils/GetVertifyCode.java

@@ -0,0 +1,18 @@
+package com.template.common.utils;
+
+import java.util.Random;
+
+public class GetVertifyCode {
+
+    public static String getRandomNumCode(int number){
+        String codeNum = "";
+        int [] numbers = {0,1,2,3,4,5,6,7,8,9};
+        Random random = new Random();
+        for (int i = 0; i < number; i++) {
+            int next = random.nextInt(10000);
+            codeNum+=numbers[next%10];
+        }
+        return codeNum;
+    }
+
+}

+ 530 - 0
src/main/java/com/template/common/utils/HttpsClient.java

@@ -0,0 +1,530 @@
+package com.template.common.utils;
+
+import com.alibaba.fastjson.JSONObject;
+import com.google.gson.Gson;
+import com.google.gson.reflect.TypeToken;
+import org.apache.commons.lang3.StringUtils;
+import org.apache.http.HttpEntity;
+import org.apache.http.NameValuePair;
+import org.apache.http.client.ClientProtocolException;
+import org.apache.http.client.config.RequestConfig;
+import org.apache.http.client.entity.UrlEncodedFormEntity;
+import org.apache.http.client.methods.CloseableHttpResponse;
+import org.apache.http.client.methods.HttpGet;
+import org.apache.http.client.methods.HttpPost;
+import org.apache.http.entity.ContentType;
+import org.apache.http.entity.mime.MultipartEntityBuilder;
+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.net.ssl.HttpsURLConnection;
+import javax.net.ssl.SSLContext;
+import javax.net.ssl.SSLSocketFactory;
+import javax.net.ssl.TrustManager;
+import java.io.*;
+import java.net.HttpURLConnection;
+import java.net.URL;
+import java.net.URLConnection;
+import java.text.SimpleDateFormat;
+import java.util.*;
+
+/**
+ * HttpsClient类
+ * @author lujunjie
+ * @date   2018/03/01
+ */
+public class HttpsClient {
+
+    /**
+     * GET请求方式
+     */
+    public static final String METHOD_GET = "GET";
+    /**
+     * POST请求方式
+     */
+    public static final String METHOD_POST = "POST";
+    /**
+     * 连接超时时间
+     */
+    private static Integer CONNECTION_TIMEOUT = WxConfig.connectionTimeout;
+    /**
+     * 请求超时时间
+     */
+    private static Integer READ_TIMEOUT = WxConfig.readTimeout;
+
+    /**
+     * 发起https请求
+     * @param requestUrl 请求地址
+     * @param requestMethod 请求方式(Get或者post)
+     * @param postData 提交数据
+     * @return JSONObject
+     */
+    public static JSONObject httpsRequestReturnJSONObject(String requestUrl, String requestMethod, String postData) throws Exception{
+        JSONObject  jsonObject = JSONObject.parseObject(HttpsClient.httpsRequestReturnString(requestUrl,requestMethod,postData));
+        System.out.println("jsonObjectDate:  " + jsonObject);
+        return jsonObject;
+    }
+
+
+    /**
+     * 发起https请求
+     * @param requestUrl 请求地址
+     * @param requestMethod 请求方式(Get或者post)
+     * @param postData 提交数据
+     * @return String
+     */
+    public static String httpsRequestReturnString(String requestUrl, String requestMethod, String postData) throws Exception{
+        String response;
+        HttpsURLConnection httpsUrlConnection = null;
+        try{
+            //创建https请求证书
+            TrustManager[] tm={new MyX509TrustManager()};
+            //创建SSLContext管理器对像,使用我们指定的信任管理器初始化
+            SSLContext sslContext=SSLContext.getInstance("SSL","SunJSSE");
+            sslContext.init(null, tm, new java.security.SecureRandom());
+            SSLSocketFactory ssf=sslContext.getSocketFactory();
+
+            // 创建URL对象
+            URL url= new URL(requestUrl);
+            // 创建HttpsURLConnection对象,并设置其SSLSocketFactory对象
+            httpsUrlConnection=(HttpsURLConnection)url.openConnection();
+            //设置ssl证书
+            httpsUrlConnection.setSSLSocketFactory(ssf);
+
+            //设置header信息
+            httpsUrlConnection.setRequestProperty("Content-Type", "application/x-www-form-urlencoded");
+            //设置User-Agent信息
+            httpsUrlConnection.setRequestProperty("User-Agent", "Mozilla/5.0 (Windows NT 6.3; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/33.0.1750.146 Safari/537.36");
+            //设置可接受信息
+            httpsUrlConnection.setDoOutput(true);
+            //设置可输入信息
+            httpsUrlConnection.setDoInput(true);
+            //不使用缓存
+            httpsUrlConnection.setUseCaches(false);
+            //设置请求方式(GET/POST)
+            httpsUrlConnection.setRequestMethod(requestMethod);
+            //设置连接超时时间
+            if (CONNECTION_TIMEOUT > 0) {
+                httpsUrlConnection.setConnectTimeout(CONNECTION_TIMEOUT);
+            } else {
+                //默认10秒超时
+                httpsUrlConnection.setConnectTimeout(10000);
+            }
+            //设置请求超时
+            if (READ_TIMEOUT > 0) {
+                httpsUrlConnection.setReadTimeout(READ_TIMEOUT);
+            } else {
+                //默认10秒超时
+                httpsUrlConnection.setReadTimeout(10000);
+            }
+            //设置编码
+            httpsUrlConnection.setRequestProperty("Charsert", WxConstants.DEFAULT_CHARSET);
+
+            //判断是否需要提交数据
+            if(StringUtils.equals(requestMethod,HttpsClient.METHOD_POST) && StringUtils.isNotBlank(postData)){
+                //讲参数转换为字节提交
+                byte[] bytes = postData.getBytes(WxConstants.DEFAULT_CHARSET);
+                //设置头信息
+                httpsUrlConnection.setRequestProperty("Content-Length", Integer.toString(bytes.length));
+                //开始连接
+                httpsUrlConnection.connect();
+                //防止中文乱码
+                OutputStream outputStream=httpsUrlConnection.getOutputStream();
+                outputStream.write(postData.getBytes(WxConstants.DEFAULT_CHARSET));
+                outputStream.flush();
+                outputStream.close();
+            }else{
+                //开始连接
+                httpsUrlConnection.connect();
+            }
+            response = WxUtil.getStreamString(httpsUrlConnection.getInputStream());
+        }catch (Exception e){
+            throw new Exception();
+        }finally {
+            if (httpsUrlConnection != null) {
+                // 关闭连接
+                httpsUrlConnection.disconnect();
+            }
+        }
+        return response;
+    }
+
+
+    public static String get(String url, Map<String, String> params){
+        CloseableHttpClient httpClient = null;
+        HttpGet httpGet = null;
+        StringBuffer str = new StringBuffer("");
+        try {
+            httpClient = HttpClients.createDefault();
+            RequestConfig requestConfig = RequestConfig.custom().setSocketTimeout(20000).setConnectTimeout(20000).build();
+            String ps = "";
+            for (String pKey : params.keySet()) {
+                if(!"".equals(ps)){
+                    ps = ps + "&";
+                }
+                ps = pKey+"="+params.get(pKey);
+            }
+            if(!"".equals(ps)){
+                url = url + "?" + ps;
+            }
+            httpGet = new HttpGet(url);
+            httpGet.setConfig(requestConfig);
+            CloseableHttpResponse response = httpClient.execute(httpGet);
+            HttpEntity httpEntity = response.getEntity();
+            str.append(EntityUtils.toString(httpEntity,"utf-8"));
+        } catch (ClientProtocolException e) {
+            e.printStackTrace();
+        } catch (IOException e) {
+            e.printStackTrace();
+        }finally{
+            try {
+                if(httpGet!=null){
+                    httpGet.releaseConnection();
+                }
+                if(httpClient!=null){
+                    httpClient.close();
+                }
+            } catch (IOException e) {
+                e.printStackTrace();
+            }
+        }
+        return str.toString();
+    }
+
+    public static String get(String strURL) throws Exception{
+
+        URL url = new URL(strURL);
+        HttpURLConnection httpConn = (HttpURLConnection)
+                url.openConnection();
+        httpConn.setRequestMethod("GET");
+        httpConn.connect();
+        System.out.println("bbb: "+httpConn.getResponseCode());
+        BufferedReader reader = new BufferedReader(new InputStreamReader(
+                httpConn.getInputStream(),"utf-8"));
+        String line;
+        StringBuffer buffer = new StringBuffer();
+        while ((line = reader.readLine()) != null) {
+            buffer.append(line);
+        }
+        reader.close();
+        httpConn.disconnect();
+
+        return buffer.toString();
+    }
+
+    /**
+     * 发送 post请求
+     * @param
+     * @param
+     */
+    public static String post(String url, Map<String, String> params){
+        CloseableHttpClient httpClient = null;
+        HttpPost httpPost = null;
+        StringBuilder sb = new StringBuilder("");
+        try {
+            httpClient = HttpClients.createDefault();
+            RequestConfig requestConfig = RequestConfig.custom().setSocketTimeout(20000).setConnectTimeout(20000).build();
+            httpPost = new HttpPost(url);
+            httpPost.setConfig(requestConfig);
+            List<NameValuePair> ps = new ArrayList<NameValuePair>();
+            for (String pKey : params.keySet()) {
+                ps.add(new BasicNameValuePair(pKey, params.get(pKey)));
+            }
+            httpPost.setEntity(new UrlEncodedFormEntity(ps));
+            CloseableHttpResponse response = httpClient.execute(httpPost);
+            HttpEntity httpEntity = response.getEntity();
+            sb.append(EntityUtils.toString(httpEntity,"utf-8"));
+        } catch (ClientProtocolException e) {
+            e.printStackTrace();
+        } catch (IOException e) {
+            e.printStackTrace();
+        }finally{
+            try {
+                if(httpPost!=null){
+                    httpPost.releaseConnection();
+                }
+                if(httpClient!=null){
+                    httpClient.close();
+                }
+            } catch (IOException e) {
+                e.printStackTrace();
+            }
+        }
+        return sb.toString();
+    }
+
+    public static String postFile(String url, File file){
+
+        CloseableHttpClient httpClient = null;
+        HttpPost httpPost = null;
+        StringBuilder sb = new StringBuilder("");
+        try {
+            MultipartEntityBuilder builder = MultipartEntityBuilder.create();
+            builder.addBinaryBody("files", file, ContentType.DEFAULT_BINARY, file.getName());
+            httpClient = HttpClients.createDefault();
+            RequestConfig requestConfig = RequestConfig.custom().setSocketTimeout(20000).setConnectTimeout(20000).build();
+            httpPost = new HttpPost(url);
+            httpPost.setConfig(requestConfig);
+            httpPost.setEntity(builder.build());
+            CloseableHttpResponse response = httpClient.execute(httpPost);
+            HttpEntity httpEntity = response.getEntity();
+            sb.append(EntityUtils.toString(httpEntity,"utf-8"));
+        } catch (ClientProtocolException e) {
+            e.printStackTrace();
+        } catch (IOException e) {
+            e.printStackTrace();
+        }finally{
+            try {
+                if(httpPost!=null){
+                    httpPost.releaseConnection();
+                }
+                if(httpClient!=null){
+                    httpClient.close();
+                }
+            } catch (IOException e) {
+                e.printStackTrace();
+            }
+        }
+        JSONObject  jsonObject = JSONObject.parseObject(sb.toString());
+        return jsonObject.get("data").toString();
+    }
+
+    //url表示请求链接,param表示json格式的请求参数		//自定义菜单创建访问方式
+    public static String sendPost(String url, String param) {
+        PrintWriter out = null;
+        BufferedReader in = null;
+        String result = "";
+        try {
+            URL realUrl = new URL(url);
+            // 打开和URL之间的连接
+            URLConnection conn = realUrl.openConnection();
+            // 设置通用的请求属性 注意Authorization生成
+            // conn.setRequestProperty("Content-Type",
+            // "application/x-www-form-urlencoded");
+            // 发送POST请求必须设置如下两行
+            conn.setDoOutput(true);
+            conn.setDoInput(true);
+            // 获取URLConnection对象对应的输出流
+            out = new PrintWriter(new OutputStreamWriter(conn.getOutputStream(),"utf-8"));
+            // 发送请求参数
+            out.print("&"+param);
+            // flush输出流的缓冲
+            out.flush();
+            // 定义BufferedReader输入流来读取URL的响应
+            in = new BufferedReader(
+                    new InputStreamReader(conn.getInputStream(),"utf-8"));
+            String line;
+            while ((line = in.readLine()) != null) {
+                result += line;
+            }
+        } catch (Exception e) {
+            System.out.println("发送 请求出现异常!" + e);
+            e.printStackTrace();
+        }
+        // 使用finally块来关闭输出流、输入流
+        finally {
+            try {
+                if (out != null) {
+                    out.close();
+                }
+                if (in != null) {
+                    in.close();
+                }
+            } catch (IOException ex) {
+                ex.printStackTrace();
+            }
+        }
+        return result;
+    }
+
+
+    //url表示请求链接,param表示json格式的请求参数		//自定义菜单创建访问方式
+    public static String sendPost2(String url, String param) {
+        PrintWriter out = null;
+        BufferedReader in = null;
+        String result = "";
+        try {
+            HttpsURLConnection httpsUrlConnection = null;
+            //创建https请求证书
+            TrustManager[] tm={new MyX509TrustManager()};
+            //创建SSLContext管理器对像,使用我们指定的信任管理器初始化
+            SSLContext sslContext=SSLContext.getInstance("SSL","SunJSSE");
+            sslContext.init(null, tm, new java.security.SecureRandom());
+            SSLSocketFactory ssf=sslContext.getSocketFactory();
+            // 创建URL对象
+            URL realUrl= new URL(url);
+            // 创建HttpsURLConnection对象,并设置其SSLSocketFactory对象,
+            // 打开和URL之间的连接
+            httpsUrlConnection=(HttpsURLConnection)realUrl.openConnection();
+            //设置ssl证书
+            httpsUrlConnection.setSSLSocketFactory(ssf);
+            // 设置通用的请求属性 注意Authorization生成
+            // conn.setRequestProperty("Content-Type",
+            // "application/x-www-form-urlencoded");
+            // 发送POST请求必须设置如下两行
+            httpsUrlConnection.setRequestMethod("POST");
+            httpsUrlConnection.setDoOutput(true);
+            httpsUrlConnection.setDoInput(true);
+            // 获取URLConnection对象对应的输出流
+            out = new PrintWriter(new OutputStreamWriter(httpsUrlConnection.getOutputStream(),"utf-8"));
+            // 发送请求参数
+            out.print("&"+param);
+            // flush输出流的缓冲
+            out.flush();
+            if (httpsUrlConnection.getResponseCode()==200) {
+                // 定义BufferedReader输入流来读取URL的响应
+                in = new BufferedReader(
+                        new InputStreamReader(httpsUrlConnection.getInputStream(), "utf-8"));
+                String line;
+                while ((line = in.readLine()) != null) {
+                    result += line;
+                }
+            }else {
+                result = "获取输入流异常!";
+            }
+        } catch (Exception e) {
+            System.out.println("发送 请求出现异常!" + e);
+            e.printStackTrace();
+        }
+        // 使用finally块来关闭输出流、输入流
+        finally {
+            try {
+                if (out != null) {
+                    out.close();
+                }
+                if (in != null) {
+                    in.close();
+                }
+            } catch (IOException ex) {
+                ex.printStackTrace();
+            }
+        }
+        return result;
+    }
+
+    public static String dateToStamp(String s) throws Exception {
+        String res = "";
+        SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
+        Date date = simpleDateFormat.parse(s);
+        long time = date.getTime();
+        res = String.valueOf(time);
+        return res;
+    }
+
+    /*
+     * 将时间戳转换为时间
+     */
+    public static String stampToDate(String s){
+        String res;
+        SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
+        long lt = new Long(s);
+        Date date = new Date(lt);
+        res = simpleDateFormat.format(date);
+        return res;
+    }
+
+    public static String sendJson(String request_url, JSONObject json) {
+        OutputStreamWriter out = null;
+        InputStream is = null;
+        String result = "";
+        try {
+            URL url = new URL(request_url);// 创建连接
+            HttpURLConnection connection = (HttpURLConnection) url.openConnection();
+            connection.setDoOutput(true);
+            connection.setDoInput(true);
+            connection.setUseCaches(false);
+            connection.setInstanceFollowRedirects(true);
+            connection.setRequestMethod("POST"); // 设置请求方式
+            // 设置接收数据的格式
+            connection.setRequestProperty("Accept", "application/json");
+            // 设置发送数据的格式
+            connection.setRequestProperty("Content-Type", "application/json");
+            connection.connect();
+            out = new OutputStreamWriter(connection.getOutputStream(), "UTF-8");
+            out.append(json.toString());
+            out.flush();
+            out.close();
+            // 读取响应
+            is = connection.getInputStream();
+            int length = (int) connection.getContentLength();// 获取字节长度
+            System.out.println(length);
+            if (length != -1) {
+                byte[] data = new byte[length];
+                byte[] temp = new byte[512];
+                int readLen = 0;
+                int destPos = 0;
+                while ((readLen = is.read(temp)) > 0) {
+                    System.arraycopy(temp, 0, data, destPos, readLen);
+                    destPos += readLen;
+                }
+                result = new String(data, "UTF-8"); // utf-8编码
+            }
+        } catch (IOException e) {
+            e.printStackTrace();
+        } finally {
+            try {
+                is.close();
+                out.close();
+            } catch (IOException e) {
+                e.printStackTrace();
+            }
+        }
+        return result;
+    }
+
+    /**
+     * post请求
+     * @param request_url
+     * @param json
+     * @return
+     */
+    public static String sendJson2(String request_url, JSONObject json) {
+        OutputStreamWriter out = null;
+        InputStream is = null;
+        String result = "";
+        try {
+            URL url = new URL(request_url);// 创建连接
+            HttpURLConnection connection = (HttpURLConnection) url.openConnection();
+            connection.setDoOutput(true);
+            connection.setDoInput(true);
+            connection.setUseCaches(false);
+            connection.setInstanceFollowRedirects(true);
+            connection.setRequestMethod("POST"); // 设置请求方式
+            // 设置接收数据的格式
+            connection.setRequestProperty("Accept", "application/json");
+            // 设置发送数据的格式
+            connection.setRequestProperty("Content-Type", "application/json");
+            connection.connect();
+            out = new OutputStreamWriter(connection.getOutputStream(), "UTF-8");
+            out.append(json.toString());
+            out.flush();
+            out.close();
+            // 读取响应
+            is = connection.getInputStream();
+            BufferedReader in = new BufferedReader(new InputStreamReader(is));
+            result = in.readLine();
+        } catch (IOException e) {
+            e.printStackTrace();
+        } finally {
+            try {
+                is.close();
+                out.close();
+            } catch (IOException e) {
+                e.printStackTrace();
+            }
+        }
+        return result;
+    }
+
+    public static void main(String[] args) throws Exception {
+        JSONObject json = new JSONObject();
+        json.put("buildCode", "5栋");
+        json.put("currentAggr", "20");
+        json.put("energyType", "2");
+        json.put("updateTime", "2021-09-09 10:15:33");
+        String msg = sendJson2("https://chtech.ncjti.edu.cn/bigdata-api/api/energy/energyDataUpload", json);
+        System.out.println(msg);
+    }
+}

+ 2 - 2
src/main/java/com/template/common/utils/JWTUtil.java

@@ -32,7 +32,7 @@ public class JWTUtil {
      * 生成token 有过期时间
      * 生成token 有过期时间
      * @return 返回token
      * @return 返回token
      */
      */
-    public static String getToken(SmartUser user){
+    public static String getToken(SmartUser user, Long expired){
 
 
         // 签发时间
         // 签发时间
         Date iatDate = new Date();
         Date iatDate = new Date();
@@ -48,7 +48,7 @@ public class JWTUtil {
         String token = JWT.create()
         String token = JWT.create()
                 .withHeader(map) // header
                 .withHeader(map) // header
                 .withClaim("cardNo", user.getCardNo()) // 账号
                 .withClaim("cardNo", user.getCardNo()) // 账号
-                .withExpiresAt(new Date(CommonUtil.getCurrentTimestamp() + EXPIRED)) // 设置过期时间。过期时间要大于签发时间
+                .withExpiresAt(new Date(CommonUtil.getCurrentTimestamp() + (expired == null ? EXPIRED : expired))) // 设置过期时间。过期时间要大于签发时间
                 .withIssuedAt(iatDate) // 设置签发时间
                 .withIssuedAt(iatDate) // 设置签发时间
                 .sign(Algorithm.HMAC256(SIGNATURE)); // 加密
                 .sign(Algorithm.HMAC256(SIGNATURE)); // 加密
         return token;
         return token;

+ 54 - 0
src/main/java/com/template/common/utils/Md5Utils.java

@@ -0,0 +1,54 @@
+package com.template.common.utils;
+
+import com.alibaba.druid.util.Utils;
+
+import java.math.BigInteger;
+import java.security.MessageDigest;
+import java.security.NoSuchAlgorithmException;
+
+public class Md5Utils {
+
+    public static String md5One(String passWord) {
+        byte[] secretBytes = null;
+        try {
+            secretBytes = MessageDigest.getInstance("md5").digest(
+                    passWord.getBytes());
+        } catch (NoSuchAlgorithmException e) {
+            throw new RuntimeException("没有md5这个算法!");
+        }
+        String md5code = new BigInteger(1, secretBytes).toString(16);// 16进制数字
+        // 如果生成数字未满32位,需要前面补0
+        for (int i = 0; i < 32 - md5code.length(); i++) {
+            md5code = "0" + md5code;
+        }
+        return md5code;
+    }
+
+    /**
+     * 工具类md5加密
+     * @param password
+     * @return
+     */
+    public static  String md5Two(String password){
+        String s = Utils.md5(password);
+        return s;
+    }
+
+    /**
+     * 可逆的的加密解密方法;两次是解密,一次是加密
+     * @param inStr
+     * @return
+     */
+    public static String convertMD5(String inStr){
+
+        char[] a = inStr.toCharArray();
+        for (int i = 0; i < a.length; i++){
+            a[i] = (char) (a[i] ^ 't');
+        }
+        String s = new String(a);
+        return s;
+
+    }
+
+
+}

+ 548 - 0
src/main/java/com/template/common/utils/Message.java

@@ -0,0 +1,548 @@
+package com.template.common.utils;
+
+import com.alibaba.fastjson.JSON;
+import com.alibaba.fastjson.JSONObject;
+import com.google.gson.Gson;
+import com.google.gson.reflect.TypeToken;
+
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.Map;
+
+// 小程序消息通知
+public class Message {
+
+    /**
+     * hotel_name酒店名称
+     * order_status订单状态,用中文表示
+     * live_time入住时间
+     * end_time离店时间
+     * dom_name房间名称
+     * **/
+
+    public static String send(String openid,String hotel_name,
+                              String order_status,String live_time,
+                              String end_time,String dom_name)
+            throws Exception {
+        JSONObject jsonObject = new JSONObject();
+        jsonObject.put("grant_type", "client_credential");
+        jsonObject.put("appid", "");
+        jsonObject.put("secret","");
+        String msg3 = HttpsClient.sendJson2("https://api.weixin.qq.com/cgi-bin/stable_token",jsonObject);
+        Gson gson = new Gson();
+        HashMap<String, String> userMap = gson.fromJson(msg3.toString(), new TypeToken<HashMap<String, String>>() {}.getType());
+        JSONObject message = new JSONObject();
+        String token = userMap.get("access_token");
+        message.put("touser", openid);
+        message.put("template_id", "c9whRYC3d8ebNI_RdyG2X_1BBDwy2625hHmRWlW5Z9U");
+        message.put("page", "/pages/orderManage/orderManage");
+        message.put("miniprogram_state", "formal");
+        message.put("lang", "zh_CN");
+        JSONObject data = new JSONObject();
+        // 酒店名称
+        JSONObject string1 = new JSONObject();
+        string1.put("value", hotel_name);
+        // 订单状态
+        JSONObject phrase2 = new JSONObject();
+        phrase2.put("value", "");
+        // 到店时间
+        JSONObject date5 = new JSONObject();
+        date5.put("value", live_time);
+        // 离店时间
+        JSONObject date6 = new JSONObject();
+        date6.put("value", end_time);
+        // 房间名称
+        JSONObject thing27 = new JSONObject();
+        thing27.put("value", dom_name);
+        // 酒店名称
+        data.put("thing1",string1);
+        // 订单状态
+        data.put("phrase2",phrase2);
+        // 入住日期
+        data.put("date5",date5);
+        // 离店日期
+        data.put("date6",date6);
+        // 房间名称
+        data.put("thing27",thing27);
+        message.put("data", data);
+        String msg = HttpsClient.sendJson("https://api.weixin.qq.com/cgi-bin/message/subscribe/send?access_token="+token, message);
+        System.out.println("小程序端消息发生:"+msg);
+        return msg;
+    }
+
+    public static String wxErrorMsg(String mag) {
+        Map mapType = JSON.parseObject(mag, Map.class);
+        Integer errorcode = (Integer) mapType.get("errcode");
+        String errmsg = "";
+        switch (errorcode) {
+            case -1:
+                errmsg = "系统繁忙";
+                break;
+            case 0:
+                errmsg = "请求成功";
+                break;
+            case 40001:
+                errmsg = "获取access_token时Secret错误,或者access_token无效";
+                break;
+            case 40002:
+                errmsg = "不合法的凭证类型";
+                break;
+            case 40003:
+                errmsg = "不合法的UserID";
+                break;
+            case 40004:
+                errmsg = "不合法的媒体文件类型 ";
+                break;
+            case 40005:
+                errmsg = "不合法的文件类型 ";
+                break;
+            case 40006:
+                errmsg = "不合法的文件大小";
+                break;
+            case 40007:
+                errmsg = "不合法的媒体文件id";
+                break;
+            case 40008:
+                errmsg = "不合法的消息类型 ";
+                break;
+            case 40013:
+                errmsg = "不合法的corpid ";
+                break;
+            case 40014:
+                errmsg = "不合法的access_token";
+                break;
+            case 40015:
+                errmsg = "不合法的菜单类型";
+                break;
+            case 40016:
+                errmsg = "不合法的按钮个数";
+                break;
+            case 40017:
+                errmsg = "不合法的按钮类型";
+                break;
+            case 40018:
+                errmsg = "不合法的按钮名字长度";
+                break;
+            case 40019:
+                errmsg = "不合法的按钮KEY长度";
+                break;
+            case 40020:
+                errmsg = "不合法的按钮URL长度 ";
+                break;
+            case 40021:
+                errmsg = "不合法的菜单版本号 ";
+                break;
+            case 40022:
+                errmsg = "不合法的子菜单级数";
+                break;
+            case 40023:
+                errmsg = "不合法的子菜单按钮个数";
+                break;
+            case 40024:
+                errmsg = "不合法的子菜单按钮类型";
+                break;
+            case 40025:
+                errmsg = "不合法的子菜单按钮名字长度";
+                break;
+            case 40026:
+                errmsg = "不合法的子菜单按钮KEY长度";
+                break;
+            case 40027:
+                errmsg = "不合法的子菜单按钮URL长度";
+                break;
+            case 40028:
+                errmsg = "不合法的自定义菜单使用员工";
+                break;
+            case 40029:
+                errmsg = "不合法的oauth_code";
+                break;
+            case 40031:
+                errmsg = "不合法的UserID列表";
+                break;
+            case 40032:
+                errmsg = "不合法的UserID列表长度";
+                break;
+            case 40033:
+                errmsg = "不合法的请求字符,不能包含\\uxxxx格式的字符 ";
+                break;
+            case 40035:
+                errmsg = "不合法的参数 ";
+                break;
+            case 40038:
+                errmsg = "不合法的请求格式 ";
+                break;
+            case 40039:
+                errmsg = "不合法的URL长度";
+                break;
+            case 40040:
+                errmsg = "不合法的插件token";
+                break;
+            case 40041:
+                errmsg = "不合法的插件id";
+                break;
+            case 40042:
+                errmsg = "不合法的插件会话";
+                break;
+            case 40048:
+                errmsg = "url中包含不合法domain";
+                break;
+            case 40054:
+                errmsg = "不合法的子菜单url域名";
+                break;
+            case 40055:
+                errmsg = "不合法的按钮url域名 ";
+                break;
+            case 40056:
+                errmsg = "不合法的agentid";
+                break;
+            case 40057:
+                errmsg = "不合法的callbackurl";
+                break;
+            case 40058:
+                errmsg = "不合法的红包参数 ";
+                break;
+            case 40059:
+                errmsg = "不合法的上报地理位置标志位 ";
+                break;
+            case 40060:
+                errmsg = "设置上报地理位置标志位时没有设置callbackurl";
+                break;
+            case 40061:
+                errmsg = "设置应用头像失败";
+                break;
+            case 40062:
+                errmsg = "不合法的应用模式";
+                break;
+            case 40063:
+                errmsg = "红包参数为空";
+                break;
+            case 40064:
+                errmsg = "管理组名字已存在";
+                break;
+            case 40065:
+                errmsg = "不合法的管理组名字长度";
+                break;
+            case 40066:
+                errmsg = "不合法的部门列表";
+                break;
+            case 40067:
+                errmsg = "标题长度不合法 ";
+                break;
+            case 40068:
+                errmsg = "不合法的标签ID";
+                break;
+            case 40069:
+                errmsg = "不合法的标签ID列表";
+                break;
+            case 40070:
+                errmsg = "列表中所有标签(用户)ID都不合法  ";
+                break;
+            case 40071:
+                errmsg = "不合法的标签名字,标签名字已经存在 ";
+                break;
+            case 40072:
+                errmsg = "不合法的标签名字长度";
+                break;
+            case 40073:
+                errmsg = "不合法的openid";
+                break;
+            case 40074:
+                errmsg = "news消息不支持指定为高保密消息";
+                break;
+            case 41001:
+                errmsg = "缺少access_token参数 ";
+                break;
+            case 41002:
+                errmsg = "缺少corpid参数";
+                break;
+            case 41003:
+                errmsg = "缺少refresh_token参数";
+                break;
+            case 41004:
+                errmsg = "缺少secret参数";
+                break;
+            case 41005:
+                errmsg = "缺少多媒体文件数据";
+                break;
+            case 41006:
+                errmsg = "缺少media_id参数";
+                break;
+            case 41007:
+                errmsg = "缺少子菜单数据";
+                break;
+            case 41008:
+                errmsg = "缺少oauth code";
+                break;
+            case 41009:
+                errmsg = "缺少UserID";
+                break;
+            case 41010:
+                errmsg = "缺少url";
+                break;
+            case 41011:
+                errmsg = "缺少agentid";
+                break;
+            case 41012:
+                errmsg = "缺少应用头像mediaid";
+                break;
+            case 41013:
+                errmsg = "缺少应用名字";
+                break;
+            case 41014:
+                errmsg = "缺少应用描述";
+                break;
+            case 41015:
+                errmsg = "缺少Content";
+                break;
+            case 41016:
+                errmsg = "缺少标题";
+                break;
+            case 41017:
+                errmsg = "缺少标签ID";
+                break;
+            case 41018:
+                errmsg = "缺少标签名字 ";
+                break;
+            case 42001:
+                errmsg = "access_token超时 ";
+                break;
+            case 42002:
+                errmsg = "refresh_token超时";
+                break;
+            case 42003:
+                errmsg = "oauth_code超时 ";
+                break;
+            case 42004:
+                errmsg = "插件token超时";
+                break;
+            case 43001:
+                errmsg = "需要GET请求";
+                break;
+            case 43002:
+                errmsg = "需要POST请求";
+                break;
+            case 43003:
+                errmsg = "需要HTTPS";
+                break;
+            case 43004:
+                errmsg = "需要接收者关注";
+                break;
+            case 43005:
+                errmsg = "需要好友关系";
+                break;
+            case 43006:
+                errmsg = "需要订阅";
+                break;
+            case 43007:
+                errmsg = "需要授权";
+                break;
+            case 43008:
+                errmsg = "需要支付授权";
+                break;
+            case 43009:
+                errmsg = "需要员工已关注";
+                break;
+            case 43010:
+                errmsg = "需要处于回调模式";
+                break;
+            case 43011:
+                errmsg = "需要企业授权";
+                break;
+            case 43101:
+                errmsg = "用户拒绝接受消息,如果用户之前曾经订阅过,则表示用户取消了订阅关系";
+                break;
+            case 44001:
+                errmsg = "多媒体文件为空";
+                break;
+            case 44002:
+                errmsg = "POST的数据包为空";
+                break;
+            case 44003:
+                errmsg = "图文消息内容为空";
+                break;
+            case 44004:
+                errmsg = "文本消息内容为空";
+                break;
+            case 45001:
+                errmsg = "多媒体文件大小超过限制";
+                break;
+            case 45002:
+                errmsg = "消息内容超过限制";
+                break;
+            case 45003:
+                errmsg = "标题字段超过限制";
+                break;
+            case 45004:
+                errmsg = "描述字段超过限制";
+                break;
+            case 45005:
+                errmsg = "链接字段超过限制";
+                break;
+            case 45006:
+                errmsg = "图片链接字段超过限制";
+                break;
+            case 45007:
+                errmsg = "语音播放时间超过限制";
+                break;
+            case 45008:
+                errmsg = "图文消息超过限制";
+                break;
+            case 45009:
+                errmsg = "接口调用超过限制";
+                break;
+            case 45010:
+                errmsg = "创建菜单个数超过限制";
+                break;
+            case 45015:
+                errmsg = "回复时间超过限制";
+                break;
+            case 45016:
+                errmsg = "系统分组,不允许修改";
+                break;
+            case 45017:
+                errmsg = "分组名字过长";
+                break;
+            case 45018:
+                errmsg = "分组数量超过上限";
+                break;
+            case 45024:
+                errmsg = "账号数量超过上限";
+                break;
+            case 46001:
+                errmsg = "不存在媒体数据";
+                break;
+            case 46002:
+                errmsg = "不存在的菜单版本";
+                break;
+            case 46003:
+                errmsg = "不存在的菜单数据";
+                break;
+            case 46004:
+                errmsg = "不存在的员工";
+                break;
+            case 47001:
+                errmsg = "解析JSON/XML内容错误";
+                break;
+            case 48002:
+                errmsg = "Api禁用";
+                break;
+            case 50001:
+                errmsg = "redirect_uri未授权";
+                break;
+            case 50002:
+                errmsg = "员工不在权限范围";
+                break;
+            case 50003:
+                errmsg = "应用已停用";
+                break;
+            case 50004:
+                errmsg = "员工状态不正确(未关注状态) ";
+                break;
+            case 50005:
+                errmsg = "企业已禁用";
+                break;
+            case 60001:
+                errmsg = "部门长度不符合限制";
+                break;
+            case 60002:
+                errmsg = "部门层级深度超过限制";
+                break;
+            case 60003:
+                errmsg = "部门不存在";
+                break;
+            case 60004:
+                errmsg = "父亲部门不存在";
+                break;
+            case 60005:
+                errmsg = "不允许删除有成员的部门";
+                break;
+            case 60006:
+                errmsg = "不允许删除有子部门的部门";
+                break;
+            case 60007:
+                errmsg = "不允许删除根部门";
+                break;
+            case 60008:
+                errmsg = "部门名称已存在";
+                break;
+            case 60009:
+                errmsg = "部门名称含有非法字符";
+                break;
+            case 60010:
+                errmsg = "部门存在循环关系";
+                break;
+            case 60011:
+                errmsg = "管理员权限不足,(user/department/agent)无权限";
+                break;
+            case 60012:
+                errmsg = "不允许删除默认应用";
+                break;
+            case 60013:
+                errmsg = "不允许关闭应用";
+                break;
+            case 60014:
+                errmsg = "不允许开启应用";
+                break;
+            case 60015:
+                errmsg = "不允许修改默认应用可见范围";
+                break;
+            case 60016:
+                errmsg = "不允许删除存在成员的标签";
+                break;
+            case 60017:
+                errmsg = "不允许设置企业";
+                break;
+            case 60102:
+                errmsg = "UserID已存在";
+                break;
+            case 60103:
+                errmsg = "手机号码不合法";
+                break;
+            case 60104:
+                errmsg = "手机号码已存在";
+                break;
+            case 60105:
+                errmsg = "邮箱不合法";
+                break;
+            case 60106:
+                errmsg = "邮箱已存在";
+                break;
+            case 60107:
+                errmsg = "微信号不合法";
+                break;
+            case 60108:
+                errmsg = "微信号已存在";
+                break;
+            case 60109:
+                errmsg = "QQ号已存在";
+                break;
+            case 60110:
+                errmsg = "部门个数超出限制";
+                break;
+            case 60111:
+                errmsg = "UserID不存在";
+                break;
+            case 60112:
+                errmsg = "成员姓名不合法";
+                break;
+            case 60113:
+                errmsg = "身份认证信息(微信号/手机/邮箱)不能同时为空 ";
+                break;
+            case 60114:
+                errmsg = "性别不合法";
+                break;
+
+            default:
+                errmsg = "没有此错误码! ";
+                break;
+        }
+        return errmsg;
+    }
+
+
+    public static void main(String[] args) throws Exception {
+        System.out.println(send("ou2uV5DGDxJ7BouxiAZZigGQFIHU","测试","测试",
+                "2023-08-25","2023-08-26","cesss"));
+    }
+}

+ 78 - 0
src/main/java/com/template/common/utils/Message2.java

@@ -0,0 +1,78 @@
+package com.template.common.utils;
+
+import com.alibaba.fastjson.JSONObject;
+import com.google.gson.Gson;
+import com.google.gson.reflect.TypeToken;
+
+
+import java.util.HashMap;
+
+/**
+ * 公众号,推送信息,推给商家信息
+ */
+public class Message2 {
+
+    /** 公众号推送消息
+     * openid:用户小程序openid, order_num订单号,
+     *  h_type房型, live_end入住和离店日期:2023-08-02~2023-08-06
+     *  user_name:用户名, hotel_name:酒店名
+     * **/
+    public static String send(String openid,String order_num,
+                              String h_type,String live_end,
+                              String user_name,String hotel_name,String id)
+            throws Exception {
+        Gson gson = new Gson();
+        String access_token = "";
+        JSONObject json = new JSONObject();
+        json.put("grant_type", "client_credential");
+//        公众号
+        json.put("appid","wxa46ef222053a1047");
+        json.put("secret","16f74a1265c314fd79fdf90670173467");
+        String url = "https://api.weixin.qq.com/cgi-bin/stable_token";
+        access_token = HttpsClient.sendJson(url,json);
+        access_token = gson.fromJson(access_token, AccessToken.class).getAccess_token();
+        JSONObject message = new JSONObject();
+        message.put("touser", openid);
+        message.put("template_id", "pQLY-9pKW-lD-6PuOlxieatGmuCHOezubTxI99cs7Zo");
+
+//        JSONObject small = new JSONObject();
+//        small.put("appid", "wx2fc3f45732fae5d3");
+//        small.put("pagepath", "/pages/push/push?id=" + id);
+//        message.put("miniprogram", small);
+        // 订单号
+        JSONObject character_string1_ = new JSONObject();
+        character_string1_.put("value", order_num);
+        character_string1_.put("color", "#173177");
+        // 房型名称
+        JSONObject thing6 = new JSONObject();
+        thing6.put("value", h_type);
+        thing6.put("color", "#0000FF");
+        // 入离时间
+        JSONObject time11 = new JSONObject();
+        time11.put("value", live_end);
+        time11.put("color", "#173177");
+        // 客户名称
+        JSONObject thing10 = new JSONObject();
+        thing10.put("value", user_name);
+        thing10.put("color", "#173177");
+        // 酒店名称
+        JSONObject thing9_ = new JSONObject();
+        thing9_.put("value", hotel_name);
+        thing9_.put("color", "#173177");
+        // 封装data
+        JSONObject data = new JSONObject();
+        // 订单号
+        data.put("character_string1",character_string1_);
+        // 房型名称
+        data.put("thing6",thing6);
+        // 入离时间
+        data.put("time11",time11);
+        // 客户名称
+        data.put("thing10",thing10);
+        // 酒店名称
+        data.put("thing9",thing9_);
+        message.put("data",data);
+        return HttpsClient.sendJson("https://api.weixin.qq.com/cgi-bin/message/template/send?access_token="+access_token, message);
+    }
+
+}

+ 23 - 0
src/main/java/com/template/common/utils/MyX509TrustManager.java

@@ -0,0 +1,23 @@
+package com.template.common.utils;
+
+import javax.net.ssl.X509TrustManager;
+import java.security.cert.CertificateException;
+import java.security.cert.X509Certificate;
+
+/**
+ * X509TrustManager用于实现SSL证书的安全校验
+ * @author lujunjie
+ * @date   2018/03/01
+ */
+public class MyX509TrustManager implements X509TrustManager {
+    @Override
+    public void checkClientTrusted(X509Certificate[] chain, String authType) throws CertificateException {}
+
+    @Override
+    public void checkServerTrusted(X509Certificate[] chain, String authType) throws CertificateException {}
+
+    @Override
+    public X509Certificate[] getAcceptedIssuers() {
+        return null;
+    }
+}

+ 42 - 0
src/main/java/com/template/common/utils/SHA1.java

@@ -0,0 +1,42 @@
+package com.template.common.utils;
+import java.security.MessageDigest;
+
+/**
+ * 微信SHA1算法
+ * @author lujunjie
+ * @date   2018/03/01
+ */
+public final class SHA1 {
+
+    private static final char[] HEX_DIGITS = {'0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'a', 'b', 'c', 'd', 'e', 'f'};
+
+    /**
+     *  将字节并格式化
+     * @param bytes 原始字节
+     * @return 格式化字节
+     */
+    private static String getFormattedText(byte[] bytes) {
+        int len = bytes.length;
+        StringBuilder buf = new StringBuilder(len * 2);
+        // 把密文转换成十六进制的字符串形式
+        for (int j = 0; j < len; j++) {
+            buf.append(HEX_DIGITS[(bytes[j] >> 4) & 0x0f]);
+            buf.append(HEX_DIGITS[bytes[j] & 0x0f]);
+        }
+        return buf.toString();
+    }
+
+    public static String encode(String str) {
+        if (str == null) {
+            return null;
+        }
+        try {
+            MessageDigest messageDigest = MessageDigest.getInstance("SHA1");
+            messageDigest.update(str.getBytes());
+            return getFormattedText(messageDigest.digest());
+        } catch (Exception e) {
+            throw new RuntimeException(e);
+        }
+    }
+
+}

+ 130 - 7
src/main/java/com/template/common/utils/SendSms.java

@@ -1,5 +1,6 @@
 package com.template.common.utils;
 package com.template.common.utils;
 
 
+
 import com.tencentcloudapi.common.Credential;
 import com.tencentcloudapi.common.Credential;
 import com.tencentcloudapi.common.exception.TencentCloudSDKException;
 import com.tencentcloudapi.common.exception.TencentCloudSDKException;
 
 
@@ -8,21 +9,24 @@ import com.tencentcloudapi.common.profile.ClientProfile;
 import com.tencentcloudapi.common.profile.HttpProfile;
 import com.tencentcloudapi.common.profile.HttpProfile;
 
 
 // 导入对应SMS模块的client
 // 导入对应SMS模块的client
+import com.tencentcloudapi.sms.v20210111.SmsClient;
 
 
 // 导入要请求接口对应的request response类
 // 导入要请求接口对应的request response类
-import com.template.config.smsConfig;
+import com.tencentcloudapi.sms.v20210111.models.SendSmsRequest;
+import com.tencentcloudapi.sms.v20210111.models.SendSmsResponse;
+import com.tencentcloudapi.sms.v20210111.models.SendStatus;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.annotation.Value;
+
+import java.util.Date;
 
 
 /**
 /**
  * Tencent Cloud Sms Sendsms
  * Tencent Cloud Sms Sendsms
  */
  */
 public class SendSms {
 public class SendSms {
 
 
-    @Autowired
-    private static smsConfig smsConfig;
 
 
     //腾讯云上的签名
     //腾讯云上的签名
-
     private static String secretID="AKIDDPo13qZCZqtgJsGQL7AyYu1wc7QVMyLl";
     private static String secretID="AKIDDPo13qZCZqtgJsGQL7AyYu1wc7QVMyLl";
     //腾讯云上的密钥
     //腾讯云上的密钥
 
 
@@ -41,13 +45,132 @@ public class SendSms {
     private static String smsMin="1";
     private static String smsMin="1";
 
 
 
 
+    public static String sendSms(String phoneNumber,String code) {
+        String returString= "";
+        try {
+            /* 必要步骤:
+             * 实例化一个认证对象,入参需要传入腾讯云账户密钥对secretId,secretKey。
+             * 这里采用的是从环境变量读取的方式,需要在环境变量中先设置这两个值。
+             * 你也可以直接在代码中写死密钥对,但是小心不要将代码复制、上传或者分享给他人,
+             * 以免泄露密钥对危及你的财产安全。
+             * SecretId、SecretKey 查询: https://console.cloud.tencent.com/cam/capi */
+//            Credential cred = new Credential(smsConfig.getSecretID(), smsConfig.getSecretKey());
+            Credential cred = new Credential(secretID,secretKey);
+
+            // 实例化一个http选项,可选,没有特殊需求可以跳过
+            HttpProfile httpProfile = new HttpProfile();
+            // 设置代理(无需要直接忽略)
+            // httpProfile.setProxyHost("真实代理ip");
+            // httpProfile.setProxyPort(真实代理端口);
+            /* SDK默认使用POST方法。
+             * 如果你一定要使用GET方法,可以在这里设置。GET方法无法处理一些较大的请求 */
+            httpProfile.setReqMethod("POST");
+            /* SDK有默认的超时时间,非必要请不要进行调整
+             * 如有需要请在代码中查阅以获取最新的默认值 */
+            httpProfile.setConnTimeout(60);
+            /* 指定接入地域域名,默认就近地域接入域名为 sms.tencentcloudapi.com ,也支持指定地域域名访问,例如广州地域的域名为 sms.ap-guangzhou.tencentcloudapi.com */
+            httpProfile.setEndpoint("sms.tencentcloudapi.com");
+
+            /* 非必要步骤:
+             * 实例化一个客户端配置对象,可以指定超时时间等配置 */
+            ClientProfile clientProfile = new ClientProfile();
+            /* SDK默认用TC3-HMAC-SHA256进行签名
+             * 非必要请不要修改这个字段 */
+            clientProfile.setSignMethod("HmacSHA256");
+            clientProfile.setHttpProfile(httpProfile);
+            /* 实例化要请求产品(以sms为例)的client对象
+             * 第二个参数是地域信息,可以直接填写字符串ap-guangzhou,支持的地域列表参考 https://cloud.tencent.com/document/api/382/52071#.E5.9C.B0.E5.9F.9F.E5.88.97.E8.A1.A8 */
+            SmsClient client = new SmsClient(cred, "ap-guangzhou", clientProfile);
+            /* 实例化一个请求对象,根据调用的接口和实际情况,可以进一步设置请求参数
+             * 你可以直接查询SDK源码确定接口有哪些属性可以设置
+             * 属性可能是基本类型,也可能引用了另一个数据结构
+             * 推荐使用IDE进行开发,可以方便的跳转查阅各个接口和数据结构的文档说明 */
+            SendSmsRequest req = new SendSmsRequest();
+
+            /* 填充请求参数,这里request对象的成员变量即对应接口的入参
+             * 你可以通过官网接口文档或跳转到request对象的定义处查看请求参数的定义
+             * 基本类型的设置:
+             * 帮助链接:
+             * 短信控制台: https://console.cloud.tencent.com/smsv2
+             * 腾讯云短信小助手: https://cloud.tencent.com/document/product/382/3773#.E6.8A.80.E6.9C.AF.E4.BA.A4.E6.B5.81 */
+
+            /* 短信应用ID: 短信SdkAppId在 [短信控制台] 添加应用后生成的实际SdkAppId,示例如1400006666 */
+            // 应用 ID 可前往 [短信控制台](https://console.cloud.tencent.com/smsv2/app-manage) 查看
+//            String sdkAppId = "1400009099";
+//            req.setSmsSdkAppId(smsConfig.getSdkAppid());
+            req.setSmsSdkAppId(sdkAppid);
+
+            /* 短信签名内容: 使用 UTF-8 编码,必须填写已审核通过的签名 */
+            // 签名信息可前往 [国内短信](https://console.cloud.tencent.com/smsv2/csms-sign) 或 [国际/港澳台短信](https://console.cloud.tencent.com/smsv2/isms-sign) 的签名管理查看
+//            String signName = "腾讯云";
+//            req.setSignName(smsConfig.getSignName());
+            req.setSignName(signName);
+
+            /* 模板 ID: 必须填写已审核通过的模板 ID */
+            // 模板 ID 可前往 [国内短信](https://console.cloud.tencent.com/smsv2/csms-template) 或 [国际/港澳台短信](https://console.cloud.tencent.com/smsv2/isms-template) 的正文模板管理查看
+//            String templateId = "449739";
+//            req.setTemplateId(smsConfig.getTemplateId());
+            req.setTemplateId(templateId);
+
+
+            /* 模板参数: 模板参数的个数需要与 TemplateId 对应模板的变量个数保持一致,若无模板参数,则设置为空 */
+//           第一个为验证码,第二个为有效时间
+//            String[] templateParamSet = {code,smsConfig.getSmsMin()};
+            String[] templateParamSet = {code,"1"};
+            req.setTemplateParamSet(templateParamSet);
+
+            /* 下发手机号码,采用 E.164 标准,+[国家或地区码][手机号]
+             * 示例如:+8613711112222, 其中前面有一个+号 ,86为国家码,13711112222为手机号,最多不要超过200个手机号 */
+//            String[] phoneNumberSet = {"+8621212313123", "+8612345678902", "+8612345678903"};
+            String[] phoneNumbers = {phoneNumber};
+            req.setPhoneNumberSet(phoneNumbers);
+
+            /* 用户的 session 内容(无需要可忽略): 可以携带用户侧 ID 等上下文信息,server 会原样返回 */
+//            String sessionContext = "";
+//            req.setSessionContext(sessionContext);
+
+            /* 短信码号扩展号(无需要可忽略): 默认未开通,如需开通请联系 [腾讯云短信小助手] */
+//            String extendCode = "";
+//            req.setExtendCode(extendCode);
+
+            /* 国际/港澳台短信 SenderId(无需要可忽略): 国内短信填空,默认未开通,如需开通请联系 [腾讯云短信小助手] */
+//            String senderid = "";
+//            req.setSenderId(senderid);
+
+            /* 通过 client 对象调用 SendSms 方法发起请求。注意请求方法名与请求对象是对应的
+             * 返回的 res 是一个 SendSmsResponse 类的实例,与请求对象对应 */
+            SendSmsResponse res = client.SendSms(req);
+
+            // 输出json格式的字符串回包
+//            System.out.println(SendSmsResponse.toJsonString(res));
+
+            // 也可以取出单个值,你可以通过官网接口文档或跳转到response对象的定义处查看返回字段的定义
+            // System.out.println(res.getRequestId());
+
+            /* 当出现以下错误码时,快速解决方案参考
+             * [FailedOperation.SignatureIncorrectOrUnapproved](https://cloud.tencent.com/document/product/382/9558#.E7.9F.AD.E4.BF.A1.E5.8F.91.E9.80.81.E6.8F.90.E7.A4.BA.EF.BC.9Afailedoperation.signatureincorrectorunapproved-.E5.A6.82.E4.BD.95.E5.A4.84.E7.90.86.EF.BC.9F)
+             * [FailedOperation.TemplateIncorrectOrUnapproved](https://cloud.tencent.com/document/product/382/9558#.E7.9F.AD.E4.BF.A1.E5.8F.91.E9.80.81.E6.8F.90.E7.A4.BA.EF.BC.9Afailedoperation.templateincorrectorunapproved-.E5.A6.82.E4.BD.95.E5.A4.84.E7.90.86.EF.BC.9F)
+             * [UnauthorizedOperation.SmsSdkAppIdVerifyFail](https://cloud.tencent.com/document/product/382/9558#.E7.9F.AD.E4.BF.A1.E5.8F.91.E9.80.81.E6.8F.90.E7.A4.BA.EF.BC.9Aunauthorizedoperation.smssdkappidverifyfail-.E5.A6.82.E4.BD.95.E5.A4.84.E7.90.86.EF.BC.9F)
+             * [UnsupportedOperation.ContainDomesticAndInternationalPhoneNumber](https://cloud.tencent.com/document/product/382/9558#.E7.9F.AD.E4.BF.A1.E5.8F.91.E9.80.81.E6.8F.90.E7.A4.BA.EF.BC.9Aunsupportedoperation.containdomesticandinternationalphonenumber-.E5.A6.82.E4.BD.95.E5.A4.84.E7.90.86.EF.BC.9F)
+             * 更多错误,可咨询[腾讯云助手](https://tccc.qcloud.com/web/im/index.html#/chat?webAppId=8fa15978f85cb41f7e2ea36920cb3ae1&title=Sms)
+             */
+            SendStatus sendStatus = res.getSendStatusSet()[0];
+            System.out.println(sendStatus.getMessage());
+//            System.out.println("sendStatus = " + sendStatus);
+            returString=sendStatus.getMessage();
+        } catch (TencentCloudSDKException e) {
+            e.printStackTrace();
+        }
+        return returString;
+    }
+
 
 
     public static  void main(String[] args) throws TencentCloudSDKException{
     public static  void main(String[] args) throws TencentCloudSDKException{
         //这里定义一个存储电话号码的数组
         //这里定义一个存储电话号码的数组
 
 
-       String tels="+8615779633758"; // 手机号前面记得带上国家区域编码
-//        SendStatus[] test = sendSms(tels);
+        String tels="+8615779633758"; // 手机号前面记得带上国家区域编码
+        String test = sendSms("18679823739","123456");
 
 
     }
     }
 
 
-}
+}

+ 1 - 1
src/main/java/com/template/common/utils/TimeExchange.java

@@ -183,7 +183,7 @@ public class TimeExchange {
     }
     }
 
 
     // 当前时间加2分钟
     // 当前时间加2分钟
-    public static String TimeRangeI10(String time, int m) throws ParseException {
+    public static String TimeRangeI10(String time, int m) {
         Calendar nowTime2 = Calendar.getInstance();
         Calendar nowTime2 = Calendar.getInstance();
         nowTime2.setTime(StringToDate(time, "yyyy-MM-dd HH:mm:ss"));
         nowTime2.setTime(StringToDate(time, "yyyy-MM-dd HH:mm:ss"));
         nowTime2.add(Calendar.SECOND, m);//10分钟前的时间
         nowTime2.add(Calendar.SECOND, m);//10分钟前的时间

+ 30 - 0
src/main/java/com/template/common/utils/WarningEntity.java

@@ -0,0 +1,30 @@
+package com.template.common.utils;
+
+import com.alibaba.excel.annotation.ExcelProperty;
+import lombok.Data;
+
+@Data
+public class WarningEntity {
+
+    @ExcelProperty("姓名")
+    private String name;
+
+    @ExcelProperty("事件")
+    private String type;
+
+    @ExcelProperty("地点")
+    private String location;
+
+    @ExcelProperty("时间")
+    private String dateTime;
+
+    @ExcelProperty("备注")
+    private String remark;
+
+    @ExcelProperty("状态")
+    private String state;
+
+    @ExcelProperty("图片")
+    private String image;
+
+}

+ 52 - 0
src/main/java/com/template/common/utils/WxConfig.java

@@ -0,0 +1,52 @@
+package com.template.common.utils;
+
+import org.springframework.stereotype.Component;
+
+import java.util.HashMap;
+
+/**
+ * 微信公众号开发配置类
+ * @author lujunjie
+ * @date   2018/03/01
+ */
+@Component
+public class WxConfig {
+
+    /**
+     * 开发者ID
+     */
+    public static String apicode = "CS0001";
+
+    /**
+     * 商户号
+     */
+    public static String apikey  = "XMZnRsZe61hEXyYa7JuAtUupJZ2Q5byc";
+
+
+    /**
+     * 统一下单-通知链接
+     */
+    public static String unifiedorderNotifyUrl = "https://app.dev.9kbs.com/";
+
+
+    /**
+     * 连接超时时间
+     */
+    public static Integer connectionTimeout = 15000;
+
+    /**
+     * 连接超时时间
+     */
+    public static Integer readTimeout = 15000;
+
+    //支付map缓存处理
+    private static HashMap<String,String> payMap = new HashMap<String,String>();
+    public static String getPayMap(String key) {
+        return payMap.get(key);
+    }
+    public static void setPayMap(String key,String value) {
+        payMap.put(key,value);
+    }
+
+
+}

+ 53 - 0
src/main/java/com/template/common/utils/WxConstants.java

@@ -0,0 +1,53 @@
+package com.template.common.utils;
+
+/**
+ * 微信公众号常量类
+ * @author lujunjie
+ * @date   2018/06/28
+ */
+public class WxConstants {
+
+    /**
+     * 默认编码
+     */
+    public static final String DEFAULT_CHARSET = "UTF-8";
+
+    /**
+     * 统一下单-扫描支付
+     */
+    public static String PAY_UNIFIEDORDER = "https://app.dev.9kbs.com/shopOpenApi/services/deviceAntiScode/getStartCode";
+
+    public static String Test = "http://localhost:8088/HotWaters/userget_stu.action";
+
+    public static String Test2 = "http://localhost:8088/HotWaters/userstu_info.action";
+
+    /**
+     * 请求成功返回码
+     */
+    public final static String ERRCODE_OK_CODE = "0";
+    /**
+     * 错误的返回码的Key
+     */
+    public final static String ERRCODE = "errcode";
+
+    /**
+     * 返回状态码
+     */
+    public final static String RETURN_CODE= "return_code";
+
+    /**
+     * access_token 字符串
+     */
+    public final static String ACCESS_TOKEN = "access_token";
+
+    /**
+     * 签名类型 MD5
+     */
+    public final static String SING_MD5 = "MD5";
+
+    /**
+     * 签名类型 HMAC-SHA256
+     */
+    public final static String SING_HMACSHA256 = "HMAC-SHA256";
+
+}

+ 385 - 0
src/main/java/com/template/common/utils/WxUtil.java

@@ -0,0 +1,385 @@
+package com.template.common.utils;
+
+
+import org.w3c.dom.Node;
+import org.w3c.dom.NodeList;
+
+import javax.crypto.Mac;
+import javax.crypto.spec.SecretKeySpec;
+import javax.servlet.ServletOutputStream;
+import javax.servlet.http.HttpServletResponse;
+import javax.xml.parsers.DocumentBuilder;
+import javax.xml.parsers.DocumentBuilderFactory;
+import javax.xml.transform.OutputKeys;
+import javax.xml.transform.Transformer;
+import javax.xml.transform.TransformerFactory;
+import javax.xml.transform.dom.DOMSource;
+import javax.xml.transform.stream.StreamResult;
+import java.io.*;
+import java.security.MessageDigest;
+import java.text.SimpleDateFormat;
+import java.util.*;
+
+/**
+ * 微信公众号接口工具类
+ * @author lujunjie
+ * @date   2018/03/01
+ */
+public class WxUtil {
+
+	/**
+	 * 加密/校验流程如下:
+	 * 1. 将token、timestamp、nonce三个参数进行字典序排序<br>
+	 * 2. 将三个参数字符串拼接成一个字符串进行sha1加密<br>
+	 * 3. 开发者获得加密后的字符串可与signature对比,标识该请求来源于微信<br>
+	 *
+	 * @param token Token验证密钥
+	 * @param signature 微信加密签名,signature结合了开发者填写的token参数和请求中的timestamp参数,nonce参数
+	 * @param timestamp 时间戳
+	 * @param nonce 随机数
+	 * @return 验证成功返回:true,失败返回:false
+	 */
+	public static boolean checkSignature(String token, String signature, String timestamp, String nonce) {
+		List<String> params = new ArrayList<String>();
+		params.add(token);
+		params.add(timestamp);
+		params.add(nonce);
+		//1. 将token、timestamp、nonce三个参数进行字典序排序
+		Collections.sort(params, new Comparator<String>() {
+			@Override
+			public int compare(String o1, String o2) {
+				return o1.compareTo(o2);
+			}
+		});
+		//2. 将三个参数字符串拼接成一个字符串进行sha1加密
+		String temp = SHA1.encode(params.get(0) + params.get(1) + params.get(2));
+		//3. 开发者获得加密后的字符串可与signature对比,标识该请求来源于微信
+		return temp.equals(signature);
+	}
+
+	/**
+	 * 输入流转化为字符串
+	 * @param inputStream 流
+	 * @return String 字符串
+	 * @throws Exception
+	 */
+	public static String getStreamString(InputStream inputStream) throws Exception{
+		StringBuffer buffer=new StringBuffer();
+		InputStreamReader inputStreamReader = null;
+		BufferedReader bufferedReader = null;
+		try{
+			inputStreamReader=new InputStreamReader(inputStream, WxConstants.DEFAULT_CHARSET);
+			bufferedReader=new BufferedReader(inputStreamReader);
+			String line;
+			while((line=bufferedReader.readLine())!=null){
+				buffer.append(line);
+			}
+		}catch(Exception e){
+			throw new Exception();
+		}finally {
+			if(bufferedReader != null){
+				bufferedReader.close();
+			}
+			if(inputStreamReader != null){
+				inputStreamReader.close();
+			}
+			if(inputStream != null){
+				inputStream.close();
+			}
+		}
+		return buffer.toString();
+	}
+
+	/**
+	 * 获取随机字符串 Nonce Str
+	 * @return String 随机字符串
+	 */
+	public static String getNonceStr() {
+		return UUID.randomUUID().toString().replaceAll("-", "").substring(0, 32);
+	}
+
+	/**
+	 * 生成签名. 注意,若含有sign_type字段,必须和signType参数保持一致。
+	 * @param data 待签名数据
+	 * @param apikey API密钥
+	 * @return 签名
+	 */
+	public static String getSignature(final Map<String, String> data, String apikey,
+				String signType) throws Exception {
+		Set<String> keySet = data.keySet();
+		String[] keyArray = keySet.toArray(new String[keySet.size()]);
+		Arrays.sort(keyArray);
+		StringBuilder sb = new StringBuilder();
+		sb.append(apikey);
+		sb.append("amount10apicodeCS0001collect_code");
+		sb.append(data.get("collect_code").trim());
+		sb.append("order_no");
+		sb.append(data.get("order_no").trim());
+        sb.append("timestamp");
+        sb.append(data.get("timestamp").trim());
+        sb.append(apikey);
+		System.out.println(sb);
+		if (signType.equals(WxConstants.SING_MD5)) {
+			System.out.println(MD5(sb.toString()).toUpperCase());
+			return MD5(sb.toString()).toLowerCase();
+		}
+		else if (signType.equals(WxConstants.SING_HMACSHA256)) {
+			return HMACSHA256(sb.toString(), apikey);
+		}
+		else {
+			throw new Exception(String.format("Invalid sign_type: %s", signType));
+		}
+	}
+
+	/**
+	 * 生成 MD5
+	 * @param data 待处理数据
+	 * @return MD5结果
+	 */
+	public static String MD5(String data) throws Exception {
+		MessageDigest md = MessageDigest.getInstance("MD5");
+		byte[] array = md.digest(data.getBytes("UTF-8"));
+		StringBuilder sb = new StringBuilder();
+		for (byte item : array) {
+			sb.append(Integer.toHexString((item & 0xFF) | 0x100).substring(1, 3));
+		}
+		return sb.toString().toUpperCase();
+	}
+
+	/**
+	 * 生成 HMACSHA256
+	 * @param data 待处理数据
+	 * @param key 密钥
+	 * @return 加密结果
+	 * @throws Exception
+	 */
+	public static String HMACSHA256(String data, String key) throws Exception {
+		Mac sha256_HMAC = Mac.getInstance("HmacSHA256");
+		SecretKeySpec secret_key = new SecretKeySpec(key.getBytes("UTF-8"), "HmacSHA256");
+		sha256_HMAC.init(secret_key);
+		byte[] array = sha256_HMAC.doFinal(data.getBytes("UTF-8"));
+		StringBuilder sb = new StringBuilder();
+		for (byte item : array) {
+			sb.append(Integer.toHexString((item & 0xFF) | 0x100).substring(1, 3));
+		}
+		return sb.toString().toUpperCase();
+	}
+
+	/**
+	 * @param data Map类型数据
+	 * @return XML格式的字符串
+	 * @throws Exception
+	 */
+	public static String mapToXml(Map<String, String> data) throws Exception {
+		DocumentBuilderFactory documentBuilderFactory = DocumentBuilderFactory.newInstance();
+		DocumentBuilder documentBuilder= documentBuilderFactory.newDocumentBuilder();
+		org.w3c.dom.Document document = documentBuilder.newDocument();
+		org.w3c.dom.Element root = document.createElement("xml");
+		document.appendChild(root);
+		for (String key: data.keySet()) {
+			String value = data.get(key);
+			if (value == null) {
+				value = "";
+			}
+			value = value.trim();
+			org.w3c.dom.Element filed = document.createElement(key);
+			filed.appendChild(document.createTextNode(value));
+			root.appendChild(filed);
+		}
+		TransformerFactory tf = TransformerFactory.newInstance();
+		Transformer transformer = tf.newTransformer();
+		DOMSource source = new DOMSource(document);
+		transformer.setOutputProperty(OutputKeys.ENCODING, "UTF-8");
+		transformer.setOutputProperty(OutputKeys.INDENT, "yes");
+		StringWriter writer = new StringWriter();
+		StreamResult result = new StreamResult(writer);
+		transformer.transform(source, result);
+		String output = writer.getBuffer().toString(); //.replaceAll("\n|\r", "");
+		try {
+			writer.close();
+		}
+		catch (Exception ex) {
+		}
+		return output;
+	}
+
+	/**
+	 * 处理 HTTPS API返回数据,转换成Map对象。return_code为SUCCESS时,验证签名。
+	 * @param xmlStr API返回的XML格式数据
+	 * @return Map类型数据
+	 * @throws Exception
+	 */
+	public static Map<String, String> processResponseXml(String xmlStr,String signType) throws Exception {
+		String RETURN_CODE = WxConstants.RETURN_CODE;
+		String return_code;
+		Map<String, String> respData = xmlToMap(xmlStr);
+		if (respData.containsKey(RETURN_CODE)) {
+			return_code = respData.get(RETURN_CODE);
+		}
+		else {
+			throw new Exception(String.format("No `return_code` in XML: %s", xmlStr));
+		}
+
+		if (return_code.equals("FAIL")) {
+			return respData;
+		}
+		else if (return_code.equals("SUCCESS")) {
+			if (isResponseSignatureValid(respData,signType)) {
+				return respData;
+			}
+			else {
+				throw new Exception(String.format("Invalid sign value in XML: %s", xmlStr));
+			}
+		}
+		else {
+			throw new Exception(String.format("return_code value %s is invalid in XML: %s", return_code, xmlStr));
+		}
+	}
+
+
+	/**
+	 * XML格式字符串转换为Map
+	 * @param strXML XML字符串
+	 * @return XML数据转换后的Map
+	 * @throws Exception
+	 */
+	public static Map<String, String> xmlToMap(String strXML) throws Exception {
+		try {
+			Map<String, String> data = new HashMap<String, String>();
+			DocumentBuilderFactory documentBuilderFactory = DocumentBuilderFactory.newInstance();
+
+			String FEATURE = "http://apache.org/xml/features/disallow-doctype-decl";
+			documentBuilderFactory.setFeature(FEATURE, true);
+
+			FEATURE = "http://xml.org/sax/features/external-general-entities";
+			documentBuilderFactory.setFeature(FEATURE, false);
+
+			FEATURE = "http://xml.org/sax/features/external-parameter-entities";
+			documentBuilderFactory.setFeature(FEATURE, false);
+
+			FEATURE = "http://apache.org/xml/features/nonvalidating/load-external-dtd";
+			documentBuilderFactory.setFeature(FEATURE, false);
+
+			documentBuilderFactory.setXIncludeAware(false);
+			documentBuilderFactory.setExpandEntityReferences(false);
+			DocumentBuilder documentBuilder = documentBuilderFactory.newDocumentBuilder();
+			InputStream stream = new ByteArrayInputStream(strXML.getBytes("UTF-8"));
+			org.w3c.dom.Document doc = documentBuilder.parse(stream);
+			doc.getDocumentElement().normalize();
+			NodeList nodeList = doc.getDocumentElement().getChildNodes();
+			for (int idx = 0; idx < nodeList.getLength(); ++idx) {
+				Node node = nodeList.item(idx);
+				if (node.getNodeType() == Node.ELEMENT_NODE) {
+					org.w3c.dom.Element element = (org.w3c.dom.Element) node;
+					data.put(element.getNodeName(), element.getTextContent());
+				}
+			}
+			try {
+				stream.close();
+			} catch (Exception ex) {
+				// do nothing
+			}
+			return data;
+		} catch (Exception ex) {
+			throw ex;
+		}
+	}
+
+	/**
+	 * 判断xml数据的sign是否有效,必须包含sign字段,否则返回false。
+	 * @param reqData 向wxpay post的请求数据
+	 * @return 签名是否有效
+	 * @throws Exception
+	 */
+	private static boolean isResponseSignatureValid(final Map<String, String> reqData,String signType) throws Exception {
+		// 返回数据的签名方式和请求中给定的签名方式是一致的
+		return isSignatureValid(reqData,WxConfig.apikey,signType);
+	}
+
+	/**
+	 * 判断签名是否正确,必须包含sign字段,否则返回false。
+	 * @param data Map类型数据
+	 * @param key API密钥
+	 * @param signType 签名方式
+	 * @return 签名是否正确
+	 * @throws Exception
+	 */
+	public static boolean isSignatureValid(Map<String, String> data, String key, String signType) throws Exception {
+		if (!data.containsKey("sign")) {
+			return false;
+		}
+		String sign = data.get("sign");
+		return getSignature(data, key, signType).equals(sign);
+	}
+
+//	/**
+//	 * 生成支付二维码
+//	 * @param response 响应
+//	 * @param contents url链接
+//	 * @throws Exception
+//	 */
+//	public static void writerPayImage(HttpServletResponse response, String contents) throws Exception{
+//		ServletOutputStream out = response.getOutputStream();
+//		try {
+//			Map<EncodeHintType,Object> hints = new HashMap<EncodeHintType,Object>();
+//			hints.put(EncodeHintType.CHARACTER_SET,"UTF-8");
+//			hints.put(EncodeHintType.ERROR_CORRECTION, ErrorCorrectionLevel.L);
+//			hints.put(EncodeHintType.MARGIN, 0);
+//			BitMatrix bitMatrix = new MultiFormatWriter().encode(contents, BarcodeFormat.QR_CODE,300,300,hints);
+//			MatrixToImageWriter.writeToStream(bitMatrix,"jpg",out);
+//		}catch (Exception e){
+//			throw new Exception("生成二维码失败!");
+//		}finally {
+//			if(out != null){
+//				out.flush();
+//				out.close();
+//			}
+//		}
+//	}
+
+	/**
+	 * 生成商户订单号
+	 * @return String
+	 */
+	public static String mchOrderNo(){
+		SimpleDateFormat sdf = new SimpleDateFormat("yyMMddHHmmss");
+		String date = sdf.format(new Date());
+
+		Random random = new Random();
+		String fourRandom = String.valueOf(random.nextInt(10000));
+		int randLength = fourRandom.length();
+		//不足4位继续补充
+		if(randLength<4){
+			for(int remain = 1; remain <= 4 - randLength; remain ++ ){
+				fourRandom += random.nextInt(10)  ;
+			}
+		}
+		return date+fourRandom;
+	}
+
+	/**
+	 * 生成默认用户名
+	 * @return String
+	 */
+	public static String createDefaultUserName(){
+		SimpleDateFormat sdf = new SimpleDateFormat("ddHHmmss");
+		String date = sdf.format(new Date());
+		return "微信用户" + date;
+	}
+
+	/**
+	 * 返回信息给微信
+	 * @param response
+	 * @param content 内容
+	 * @throws Exception
+	 */
+	public static void responsePrint(HttpServletResponse response, String content) throws Exception{
+		response.setCharacterEncoding("UTF-8");
+		response.setContentType("text/xml");
+		response.getWriter().print(content);
+		response.getWriter().flush();
+		response.getWriter().close();
+	}
+
+
+}

+ 289 - 0
src/main/java/com/template/controller/HikvisionController.java

@@ -0,0 +1,289 @@
+package com.template.controller;
+
+import com.alibaba.fastjson.JSONArray;
+import com.alibaba.fastjson.JSONObject;
+import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
+import com.template.api.HikvisionAPI;
+import com.template.common.utils.GetCameraPreviewURL;
+import com.template.model.pojo.SmartFaceDiscern;
+import com.template.model.pojo.SmartWarning;
+import com.template.services.SmartFaceDiscernService;
+import com.template.services.SmartWarningService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.RestController;
+
+import javax.servlet.http.HttpServletRequest;
+import java.io.BufferedReader;
+import java.io.InputStreamReader;
+
+@RestController
+public class HikvisionController implements HikvisionAPI {
+
+    @Autowired
+    SmartWarningService smartWarningService;
+
+    @Autowired
+    SmartFaceDiscernService smartFaceDiscernService;
+
+
+    /**
+     * 事件订阅
+     * @param request
+     */
+    @Override
+    public void subscription(HttpServletRequest request) {
+        try {
+            BufferedReader streamReader = new BufferedReader(new InputStreamReader(request.getInputStream(), "UTF-8"));
+            StringBuilder responseStrBuilder = new StringBuilder();
+            String inputStr;
+            while ((inputStr = streamReader.readLine()) != null) {
+                responseStrBuilder.append(inputStr);
+            }
+            JSONObject jsonObject = JSONObject.parseObject(responseStrBuilder.toString());
+//            System.out.println("jsonObject = " + jsonObject);
+            JSONObject params = jsonObject.getJSONObject("params");
+
+            JSONArray events = params.getJSONArray("events");
+
+            JSONObject jsonObject1 = events.getJSONObject(0);
+//            类型
+            String eventType = jsonObject1.getString("eventType");
+
+//            时间
+            String happenTime = jsonObject1.getString("happenTime");
+
+            SmartWarning smartWarning = new SmartWarning();
+            smartWarning.setDateTime(happenTime);
+            smartWarning.setStatu(0);
+            JSONObject data = jsonObject1.getJSONObject("data");
+
+//                地点
+            String srcName = jsonObject1.getString("srcName");
+            smartWarning.setLocation(srcName);
+
+            if ("131588".equals(eventType)) {
+
+                smartWarning.setType("区域入侵");
+
+                JSONArray fielddetection = data.getJSONArray("fielddetection");
+
+                JSONObject jsonObject2 = fielddetection.getJSONObject(0);
+//                图片
+                String imageUrl = jsonObject2.getString("imageUrl");
+                smartWarning.setImage(imageUrl);
+
+            }else if ("131586".equals(eventType)){
+                smartWarning.setType("进入区域");
+
+                JSONArray regionEntrance = data.getJSONArray("regionEntrance");
+
+                JSONObject jsonObject2 = regionEntrance.getJSONObject(0);
+//                图片
+                String imageUrl = jsonObject2.getString("imageUrl");
+                smartWarning.setImage(imageUrl);
+
+            }else if ("131587".equals(eventType)){
+                smartWarning.setType("离开区域");
+
+                JSONArray regionExiting = data.getJSONArray("regionExiting");
+
+                JSONObject jsonObject2 = regionExiting.getJSONObject(0);
+//                图片
+                String imageUrl = jsonObject2.getString("imageUrl");
+                smartWarning.setImage(imageUrl);
+
+            }else if ("131605".equals(eventType)){
+                smartWarning.setType("倒地");
+
+                JSONArray fallDown = data.getJSONArray("fallDown");
+
+                JSONObject jsonObject2 = fallDown.getJSONObject(0);
+//                图片
+                String imageUrl = jsonObject2.getString("imageUrl");
+                smartWarning.setImage(imageUrl);
+
+            }
+
+            smartWarningService.save(smartWarning);
+
+
+
+
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+    }
+
+    /**
+     * 人脸比对
+     * @param request
+     */
+    @Override
+    public void faceComparison(HttpServletRequest request) {
+        try {
+            BufferedReader streamReader = new BufferedReader(new InputStreamReader(request.getInputStream(), "UTF-8"));
+            StringBuilder responseStrBuilder = new StringBuilder();
+            String inputStr;
+            while ((inputStr = streamReader.readLine()) != null) {
+                responseStrBuilder.append(inputStr);
+            }
+            JSONObject jsonObject = JSONObject.parseObject(responseStrBuilder.toString());
+
+//            System.out.println("jsonObject = " + jsonObject);
+
+            JSONObject params = jsonObject.getJSONObject("params");
+
+            JSONArray events = params.getJSONArray("events");
+
+            JSONObject jsonObject1 = events.getJSONObject(0);
+//            类型
+            String eventType = jsonObject1.getString("eventType");
+
+//            时间
+            String happenTime = jsonObject1.getString("happenTime");
+
+            SmartFaceDiscern smartFaceDiscern = new SmartFaceDiscern();
+            smartFaceDiscern.setDateTime(happenTime);
+
+            JSONObject data = jsonObject1.getJSONObject("data");
+
+//            地点
+            String channelName = data.getString("channelName");
+            smartFaceDiscern.setLocation(channelName);
+
+
+            if ("131659".equals(eventType)) {
+                smartFaceDiscern.setType("人脸比对");
+
+                JSONArray alarmResult = data.getJSONArray("alarmResult");
+                JSONObject jsonObject2 = alarmResult.getJSONObject(0);
+
+                JSONObject targetAttrs = jsonObject2.getJSONObject("targetAttrs");
+                String bkgUrl = targetAttrs.getString("bkgUrl");
+                smartFaceDiscern.setImage(bkgUrl);
+
+//                获取人脸信息
+                JSONArray faces = jsonObject2.getJSONArray("faces");
+                JSONObject jsonObject3 = faces.getJSONObject(0);
+//                对比成功的图片
+                JSONArray identify = jsonObject3.getJSONArray("identify");
+                if (ObjectUtils.isNotEmpty(identify)&&identify.size()>0) {
+//                    取对比成功的第一张
+                    JSONObject jsonObject4 = identify.getJSONObject(0);
+                    JSONArray candidate = jsonObject4.getJSONArray("candidate");
+                    JSONObject jsonObject5 = candidate.getJSONObject(0);
+                    JSONObject reserve_field = jsonObject5.getJSONObject("reserve_field");
+//                    证件号
+                    String certificateNumber = reserve_field.getString("certificateNumber");
+//                    名字
+                    String name = reserve_field.getString("name");
+                    smartFaceDiscern.setName(name);
+
+//                  todo  通过身份证查询是谁
+
+                    smartFaceDiscernService.save(smartFaceDiscern);
+
+                }
+
+
+            }
+
+
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+    }
+
+    /**
+     * 重点人员
+     * @param request
+     */
+    @Override
+    public void emphasisFace(HttpServletRequest request) {
+        try {
+            BufferedReader streamReader = new BufferedReader(new InputStreamReader(request.getInputStream(), "UTF-8"));
+            StringBuilder responseStrBuilder = new StringBuilder();
+            String inputStr;
+            while ((inputStr = streamReader.readLine()) != null) {
+                responseStrBuilder.append(inputStr);
+            }
+            JSONObject jsonObject = JSONObject.parseObject(responseStrBuilder.toString());
+
+            System.out.println("jsonObject = " + jsonObject);
+
+            JSONObject params = jsonObject.getJSONObject("params");
+
+            JSONArray events = params.getJSONArray("events");
+
+            JSONObject jsonObject1 = events.getJSONObject(0);
+//            类型
+            String eventType = jsonObject1.getString("eventType");
+
+//            时间
+            String happenTime = jsonObject1.getString("happenTime");
+
+            SmartWarning smartWarning = new SmartWarning();
+            smartWarning.setDateTime(happenTime);
+            smartWarning.setStatu(0);
+            JSONObject data = jsonObject1.getJSONObject("data");
+
+//            获取地点
+            JSONArray resInfo = data.getJSONArray("resInfo");
+            JSONObject jsonObject3 = resInfo.getJSONObject(0);
+            String cn = jsonObject3.getString("cn");
+            smartWarning.setLocation(cn);
+
+
+            if ("1644175361".equals(eventType)) {
+                smartWarning.setType("重点人员识别");
+
+                JSONObject faceRecognitionResult = data.getJSONObject("faceRecognitionResult");
+
+//                获取图片
+                JSONObject snap = faceRecognitionResult.getJSONObject("snap");
+                String bkgUrl = snap.getString("bkgUrl");
+                smartWarning.setImage(bkgUrl);
+
+//                获取重点人员身份
+                JSONArray faceMatch = faceRecognitionResult.getJSONArray("faceMatch");
+                JSONObject jsonObject2 = faceMatch.getJSONObject(0);
+//                名字
+                String faceInfoName = jsonObject2.getString("faceInfoName");
+                smartWarning.setWarningName(faceInfoName);
+//                证件号码
+                String certificate = jsonObject2.getString("certificate");
+
+
+                smartWarningService.save(smartWarning);
+            }
+
+
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+    }
+
+    @Override
+    public JSONObject playback() {
+        String url="/api/video/v2/cameras/playbackURLs";
+        JSONObject jsonBoxdy = new JSONObject();
+        jsonBoxdy.put("cameraIndexCode","ff2a2978a71c4ba0ac43a1a6be97a1a1");
+        jsonBoxdy.put("streamType",0);
+        jsonBoxdy.put("protocol","rtsp");
+        jsonBoxdy.put("transmode",1);
+        String s =GetCameraPreviewURL.CameraPreviewURL(url, jsonBoxdy);
+
+        JSONObject jsonObject1 = JSONObject.parseObject(s);
+        return jsonObject1;
+
+    }
+
+    @Override
+    public JSONObject general(JSONObject jsonObject) {
+        String url = jsonObject.getString("url");
+        JSONObject jsonBoxdy = jsonObject.getJSONObject("jsonBoxdy");
+        String s = GetCameraPreviewURL.CameraPreviewURL(url, jsonBoxdy);
+        JSONObject jsonObject1 = JSONObject.parseObject(s);
+        return jsonObject1;
+    }
+}

+ 1 - 1
src/main/java/com/template/controller/LoginController.java

@@ -108,7 +108,7 @@ public class LoginController implements LoginControllerAPI {
             return CommonResult.fail("密码错误");
             return CommonResult.fail("密码错误");
         }
         }
         SmartUser user = new SmartUser();
         SmartUser user = new SmartUser();
-        String token = JWTUtil.getToken(user);
+        String token = JWTUtil.getToken(user,null);
         LoginVO login = new LoginVO();
         LoginVO login = new LoginVO();
         login.setToken(token);
         login.setToken(token);
         login.setTokenTtl(JWTUtil.getExpired());
         login.setTokenTtl(JWTUtil.getExpired());

+ 46 - 10
src/main/java/com/template/controller/SmartApplyController.java

@@ -8,18 +8,23 @@ import com.template.model.pojo.SmartIdentity;
 import com.template.model.result.CommonResult;
 import com.template.model.result.CommonResult;
 import com.template.model.result.PageUtils;
 import com.template.model.result.PageUtils;
 import com.template.model.vo.ApplyVo;
 import com.template.model.vo.ApplyVo;
+import com.template.model.vo.ApplysVo;
 import com.template.services.SmartApplyService;
 import com.template.services.SmartApplyService;
+import com.template.services.SmartIdentityService;
+import org.apache.commons.lang3.StringUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.validation.BindingResult;
 import org.springframework.validation.BindingResult;
 import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RequestMapping;
 
 
 import org.springframework.web.bind.annotation.RestController;
 import org.springframework.web.bind.annotation.RestController;
 
 
+import java.util.ArrayList;
 import java.util.List;
 import java.util.List;
+import java.util.stream.Collectors;
 
 
 /**
 /**
  * <p>
  * <p>
- *  前端控制器
+ * 前端控制器
  * </p>
  * </p>
  *
  *
  * @author ceshi
  * @author ceshi
@@ -31,8 +36,12 @@ public class SmartApplyController implements SmartApplyControllerAPI {
     @Autowired
     @Autowired
     private SmartApplyService smartApplyService;
     private SmartApplyService smartApplyService;
 
 
+    @Autowired
+    private SmartIdentityService smartIdentityService;
+
     /**
     /**
      * 查询应用管理
      * 查询应用管理
+     *
      * @return
      * @return
      */
      */
     @Override
     @Override
@@ -43,7 +52,8 @@ public class SmartApplyController implements SmartApplyControllerAPI {
 
 
     /**
     /**
      * 新增应用管理
      * 新增应用管理
-     * @param smartApply 应用管理数据
+     *
+     * @param smartApply    应用管理数据
      * @param bindingResult
      * @param bindingResult
      * @return
      * @return
      */
      */
@@ -55,7 +65,7 @@ public class SmartApplyController implements SmartApplyControllerAPI {
         }
         }
 
 
         SmartApply data = smartApplyService.queryApplyByName(smartApply.getName());
         SmartApply data = smartApplyService.queryApplyByName(smartApply.getName());
-        if(data != null){
+        if (data != null) {
             return CommonResult.fail("该应用管理已存在");
             return CommonResult.fail("该应用管理已存在");
         }
         }
 
 
@@ -67,7 +77,8 @@ public class SmartApplyController implements SmartApplyControllerAPI {
 
 
     /**
     /**
      * 更新应用管理
      * 更新应用管理
-     * @param sa 应用管理数据
+     *
+     * @param sa            应用管理数据
      * @param bindingResult
      * @param bindingResult
      * @return
      * @return
      */
      */
@@ -79,14 +90,14 @@ public class SmartApplyController implements SmartApplyControllerAPI {
         }
         }
 
 
         SmartApply oldData = smartApplyService.getSmartById(sa.getId());
         SmartApply oldData = smartApplyService.getSmartById(sa.getId());
-        if(oldData == null){
+        if (oldData == null) {
             return CommonResult.fail("应用管理数据无效,修改失败");
             return CommonResult.fail("应用管理数据无效,修改失败");
         }
         }
 
 
-        if(sa.getName() != null && !sa.getName().equals(oldData.getName())){
+        if (sa.getName() != null && !sa.getName().equals(oldData.getName())) {
             //查看是否存在相同身份的数据
             //查看是否存在相同身份的数据
             SmartApply data = smartApplyService.queryApplyByName(sa.getName());
             SmartApply data = smartApplyService.queryApplyByName(sa.getName());
-            if(data != null){
+            if (data != null) {
                 return CommonResult.fail("该应用管理已存在");
                 return CommonResult.fail("该应用管理已存在");
             }
             }
         }
         }
@@ -97,9 +108,10 @@ public class SmartApplyController implements SmartApplyControllerAPI {
 
 
     /**
     /**
      * 应用管理分页数据查询
      * 应用管理分页数据查询
+     *
      * @param currentPage 当前页数
      * @param currentPage 当前页数
-     * @param pageCount 一页数据条数
-     * @param name 查询名称
+     * @param pageCount   一页数据条数
+     * @param name        查询名称
      * @return
      * @return
      */
      */
     @Override
     @Override
@@ -115,13 +127,37 @@ public class SmartApplyController implements SmartApplyControllerAPI {
 
 
         SmartApply data = smartApplyService.getSmartById(id);
         SmartApply data = smartApplyService.getSmartById(id);
 
 
-        if(data == null){
+        if (data == null) {
             return CommonResult.fail("当前数据不存在,删除失败!");
             return CommonResult.fail("当前数据不存在,删除失败!");
         }
         }
 
 
+        //查看被删除的应用管理有没有绑定身份数据 有的话提示无法删除
+        List<SmartIdentity> identitys = smartIdentityService.querySmartIdentityDatas(id);
+        if (identitys != null && identitys.size() > 0) {
+            String name = StringUtils.join(identitys.stream().map(SmartIdentity::getName).collect(Collectors.toList()), ',');
+            return CommonResult.fail("当前应用数据已绑定" + name + "身份,请先解绑");
+        }
+
         int result = smartApplyService.deleteSmartApplyById(id);
         int result = smartApplyService.deleteSmartApplyById(id);
 
 
         return result > 0 ? CommonResult.ok("删除成功") : CommonResult.fail("删除失败");
         return result > 0 ? CommonResult.ok("删除成功") : CommonResult.fail("删除失败");
     }
     }
+
+    @Override
+    public CommonResult queryAppletApplys() {
+        List<ApplysVo> result = new ArrayList<>();
+
+        List<SmartApply> applys = smartApplyService.queryAppletApplys();
+        for (SmartApply apply : applys) {
+            ApplysVo data = new ApplysVo();
+            data.setId(apply.getId());
+            data.setPath(apply.getRoute());
+            data.setTitle(apply.getName());
+            data.setUrl(apply.getLogo());
+            result.add(data);
+        }
+
+        return CommonResult.ok(result);
+    }
 }
 }
 
 

+ 27 - 3
src/main/java/com/template/controller/SmartClassController.java

@@ -31,6 +31,7 @@ import java.net.URLDecoder;
 import java.net.URLEncoder;
 import java.net.URLEncoder;
 import java.util.ArrayList;
 import java.util.ArrayList;
 import java.util.List;
 import java.util.List;
+import java.util.Optional;
 
 
 import static com.template.common.utils.AesTestOne.decrypt;
 import static com.template.common.utils.AesTestOne.decrypt;
 
 
@@ -73,8 +74,8 @@ public class SmartClassController implements SmartClassControllerAPI {
         }
         }
 
 
         //判断重复性
         //判断重复性
-        SmartClass existData = smartClassService.existSmartClassData(ucr.getName(), ucr.getClassNo());
-        if (existData != null && existData.getId().equals(ucr.getId())) {
+        SmartClass existData = smartClassService.existSmartClassData(oldData.getGradeId(), ucr.getName(), ucr.getClassNo());
+        if (existData != null && !existData.getId().equals(ucr.getId())) {
             return CommonResult.fail("该班级数据已在系统中存在,更新失败");
             return CommonResult.fail("该班级数据已在系统中存在,更新失败");
         }
         }
 
 
@@ -121,7 +122,30 @@ public class SmartClassController implements SmartClassControllerAPI {
     public CommonResult queryPageSmartClasss(int currentPage, int pageCount, String name) {
     public CommonResult queryPageSmartClasss(int currentPage, int pageCount, String name) {
         PageUtils<SmartClass> result = smartClassService.queryPageSmartClass(currentPage, pageCount, name);
         PageUtils<SmartClass> result = smartClassService.queryPageSmartClass(currentPage, pageCount, name);
 
 
-        return CommonResult.ok(result);
+        PageUtils<SmartClassPageVo> datas = new PageUtils<SmartClassPageVo>(null, result.getTotalCount(),result.getPageSize(),result.getCurrPage());
+
+        if(result != null && result.getList().size() > 0){
+            List<SmartGrade> grades = smartGradeService.getSmartGrades();
+            List<SmartClassPageVo> pages = new ArrayList<>();
+            for (SmartClass data : result.getList()) {
+                SmartClassPageVo pageData = new SmartClassPageVo();
+                pageData.setId(data.getId());
+                pageData.setGradeId(data.getGradeId());
+                Optional<SmartGrade> grade = grades.stream().filter(e -> e.getId().equals(data.getGradeId())).findFirst();
+                if(grade != null && grade.isPresent()){
+                    pageData.setGradeStr(grade.get().getName());
+                }
+                pageData.setClassUid(data.getClassUid());
+                pageData.setName(data.getName());
+                pageData.setClassNo(data.getClassNo());
+                pageData.setBsClassNo(data.getBsClassNo());
+                pages.add(pageData);
+            }
+
+            datas = new PageUtils<SmartClassPageVo>(pages, result.getTotalCount(),result.getPageSize(),result.getCurrPage());
+        }
+
+        return CommonResult.ok(datas);
     }
     }
 
 
     @Override
     @Override

+ 3 - 1
src/main/java/com/template/controller/SmartEvaluateStudentController.java

@@ -206,7 +206,9 @@ public class SmartEvaluateStudentController implements SmartEvaluateStudentContr
             if (smartEvaluateSdetail.getId()==null){
             if (smartEvaluateSdetail.getId()==null){
                 smartEvaluateSdetail.setId((int) UUIDUtil.generateID());
                 smartEvaluateSdetail.setId((int) UUIDUtil.generateID());
             }
             }
-            total+=smartEvaluateSdetail.getScoreNum();
+            if (smartEvaluateSdetail.getDeleted()==0){
+                total+=smartEvaluateSdetail.getScoreNum();
+            }
             smartEvaluateSdetail.setTerm(student.getTerm());
             smartEvaluateSdetail.setTerm(student.getTerm());
             smartEvaluateSdetail.setCardNo(student.getCardNo());
             smartEvaluateSdetail.setCardNo(student.getCardNo());
             QueryWrapper<SmartSubjectRule> queryWrapper1 = new QueryWrapper<>();
             QueryWrapper<SmartSubjectRule> queryWrapper1 = new QueryWrapper<>();

+ 10 - 8
src/main/java/com/template/controller/SmartEvaluateTeacherController.java

@@ -86,7 +86,9 @@ public class SmartEvaluateTeacherController implements SmartEvaluateTeacherContr
                 childScoreManage.setScoreNum(childList.get(j).getScoreNum());
                 childScoreManage.setScoreNum(childList.get(j).getScoreNum());
                 childScoreManage.setDeleted(childList.get(j).getDeleted());
                 childScoreManage.setDeleted(childList.get(j).getDeleted());
                 smList.add(childScoreManage);
                 smList.add(childScoreManage);
-                mainScoreNum+=childList.get(j).getScoreNum();
+                if (childList.get(j).getDeleted()==0){
+                    mainScoreNum+=childList.get(j).getScoreNum();
+                }
             }
             }
             mainScoreManage.setScoreNum(mainScoreNum);
             mainScoreManage.setScoreNum(mainScoreNum);
             smList.add(mainScoreManage);
             smList.add(mainScoreManage);
@@ -327,15 +329,15 @@ public class SmartEvaluateTeacherController implements SmartEvaluateTeacherContr
     }
     }
 
 
     @PassToken
     @PassToken
-    public CommonResult getScoreRank(int currentPage, int pageCount,String scoreItem){
-        QueryWrapper<SmartEvaluateTdetail> queryWrapper1 = new QueryWrapper<>();
+    public CommonResult getScoreRank(int currentPage, int pageCount,String subject){
+        QueryWrapper<SmartEvaluateTeacher> queryWrapper1 = new QueryWrapper<>();
         queryWrapper1.eq("term", smartScoreManageService.getMaxTerm());
         queryWrapper1.eq("term", smartScoreManageService.getMaxTerm());
-        queryWrapper1.eq("parent_id", 0);
-        if (scoreItem!=null){
-            queryWrapper1.eq("score_item", scoreItem);
+        queryWrapper1.eq("deleted", 0);
+        if (subject!=null){
+            queryWrapper1.eq("subject", subject);
         }
         }
-        queryWrapper1.orderByDesc("own_num");
-        PageUtils<SmartEvaluateTdetail> list = smartEvaluateTdetailService.queryPageSmartEvaluateTdetail(currentPage,pageCount,queryWrapper1);
+        queryWrapper1.orderByDesc("total_score");
+        PageUtils<SmartEvaluateTeacher> list = smartEvaluateTeacherService.queryPageSmartEvaluateTeacher(currentPage,pageCount,queryWrapper1);
         return CommonResult.ok(list);
         return CommonResult.ok(list);
     }
     }
 }
 }

+ 82 - 0
src/main/java/com/template/controller/SmartFaceDiscernController.java

@@ -0,0 +1,82 @@
+package com.template.controller;
+
+
+import com.alibaba.fastjson.JSONArray;
+import com.alibaba.fastjson.JSONObject;
+import com.baomidou.mybatisplus.core.conditions.Wrapper;
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
+import com.template.api.SmartFaceDiscernControllerAPI;
+import com.template.common.utils.*;
+import com.template.config.ControlConfig;
+import com.template.model.pojo.SmartFaceDiscern;
+import com.template.model.pojo.SmartUser;
+import com.template.model.result.CommonResult;
+import com.template.services.SmartFaceDiscernService;
+import com.template.services.SmartUserService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.annotation.Value;
+import org.springframework.scheduling.annotation.Scheduled;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+import javax.annotation.Resource;
+import java.net.URLDecoder;
+import java.net.URLEncoder;
+import java.time.LocalDateTime;
+import java.time.format.DateTimeFormatter;
+import java.util.List;
+
+
+import static com.template.common.utils.AesTestOne.decrypt;
+
+/**
+ * <p>
+ * 前端控制器
+ * </p>
+ *
+ * @author ceshi
+ * @since 2024-01-18
+ */
+@RestController
+public class SmartFaceDiscernController implements SmartFaceDiscernControllerAPI {
+
+    @Autowired
+    SmartFaceDiscernService smartFaceDiscernService;
+
+
+    @Override
+    public CommonResult track(Integer id,int dateTime) {
+        JSONObject date = getDate(dateTime);
+
+        String stateTime = date.getString("stateTime");
+        String endTime = date.getString("endTime");
+
+        List<SmartFaceDiscern> smartFaceDiscerns =smartFaceDiscernService.track(stateTime,endTime,id);
+
+        return CommonResult.ok(smartFaceDiscerns);
+    }
+
+    public static JSONObject getDate(Integer date){
+        JSONObject jsonObject = new JSONObject();
+
+        DateTimeFormatter dateTimeFormatter1 = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
+        LocalDateTime now = LocalDateTime.now();
+        LocalDateTime stateTime = now.withHour(0).withMinute(0).withSecond(0).minusDays(date);
+
+        LocalDateTime endTime = now.withHour(23).withMinute(59).withSecond(59).minusDays(date);
+
+        jsonObject.put("stateTime",stateTime.format(dateTimeFormatter1));
+        jsonObject.put("endTime",endTime.format(dateTimeFormatter1));
+
+        return jsonObject;
+
+    }
+
+    public static void main(String[] args) {
+        JSONObject date = getDate(1);
+        System.out.println("date = " + date);
+    }
+
+}
+

+ 46 - 0
src/main/java/com/template/controller/SmartIdentityController.java

@@ -3,13 +3,17 @@ package com.template.controller;
 
 
 import com.template.api.SmartIdentityControllerAPI;
 import com.template.api.SmartIdentityControllerAPI;
 import com.template.common.utils.paramUtils;
 import com.template.common.utils.paramUtils;
+import com.template.model.pojo.SmartApply;
 import com.template.model.pojo.SmartIdentity;
 import com.template.model.pojo.SmartIdentity;
 import com.template.model.pojo.SmartScreenshot;
 import com.template.model.pojo.SmartScreenshot;
 import com.template.model.request.insertIdentityRequest;
 import com.template.model.request.insertIdentityRequest;
 import com.template.model.request.updateIdentityRequest;
 import com.template.model.request.updateIdentityRequest;
 import com.template.model.result.CommonResult;
 import com.template.model.result.CommonResult;
 import com.template.model.result.PageUtils;
 import com.template.model.result.PageUtils;
+import com.template.model.vo.ApplysVo;
+import com.template.model.vo.IdentityApplyVo;
 import com.template.model.vo.SemesterVo;
 import com.template.model.vo.SemesterVo;
+import com.template.services.SmartApplyService;
 import com.template.services.SmartIdentityService;
 import com.template.services.SmartIdentityService;
 import org.apache.commons.lang3.StringUtils;
 import org.apache.commons.lang3.StringUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -20,6 +24,8 @@ import org.springframework.web.bind.annotation.RestController;
 import java.util.ArrayList;
 import java.util.ArrayList;
 import java.util.Arrays;
 import java.util.Arrays;
 import java.util.List;
 import java.util.List;
+import java.util.Optional;
+import java.util.stream.Collectors;
 
 
 /**
 /**
  * <p>
  * <p>
@@ -33,6 +39,9 @@ import java.util.List;
 public class SmartIdentityController implements SmartIdentityControllerAPI {
 public class SmartIdentityController implements SmartIdentityControllerAPI {
 
 
     @Autowired
     @Autowired
+    private SmartApplyService smartApplyService;
+
+    @Autowired
     private SmartIdentityService smartIdentityService;
     private SmartIdentityService smartIdentityService;
 
 
     /**
     /**
@@ -148,5 +157,42 @@ public class SmartIdentityController implements SmartIdentityControllerAPI {
 
 
         return CommonResult.ok(result);
         return CommonResult.ok(result);
     }
     }
+
+    @Override
+    public CommonResult queryIdentityApplyById(int id) {
+
+        List<ApplysVo> result = new ArrayList<>();
+
+        SmartIdentity identity = smartIdentityService.getSmartById(id);
+        if (identity == null) {
+            return CommonResult.fail("当前身份不合法,无应用权限");
+        }
+
+        if (identity.getApplyId() == null) {
+            return CommonResult.fail("当前身份信息无应用权限");
+        }
+
+        List<SmartApply> applys = smartApplyService.queryAppletApplys();
+        if(applys == null){
+            return CommonResult.fail("应用管理数据为空");
+        }
+
+        List<String> applyIds = Arrays.asList(identity.getApplyId().split(","));
+        for (String applyId : applyIds) {
+            Optional<SmartApply> applyData = applys.stream().filter(e -> e.getId().equals(Integer.valueOf(applyId))).findFirst();
+            if(applyData != null && applyData.isPresent()){
+                ApplysVo data = new ApplysVo();
+                data.setId(applyData.get().getId());
+                data.setPath(applyData.get().getRoute());
+                data.setTitle(applyData.get().getName());
+                data.setUrl(applyData.get().getLogo());
+                data.setAppid(applyData.get().getAppid());
+                data.setCategory(applyData.get().getCategory());
+                result.add(data);
+            }
+        }
+
+        return CommonResult.ok(result);
+    }
 }
 }
 
 

+ 58 - 0
src/main/java/com/template/controller/SmartQrcodeController.java

@@ -0,0 +1,58 @@
+package com.template.controller;
+
+
+import cn.hutool.core.codec.Base64;
+import cn.hutool.extra.qrcode.QrCodeUtil;
+import com.alibaba.fastjson.JSON;
+import com.template.api.SmartQrcodeControllerAPI;
+import com.template.common.utils.TimeExchange;
+import com.template.model.pojo.SmartUser;
+import com.template.model.result.CommonResult;
+import com.template.model.vo.BaseImageVo;
+import com.template.model.vo.QrcodeImageVo;
+import com.template.services.SmartUserService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.RequestMapping;
+
+import org.springframework.web.bind.annotation.RestController;
+
+import javax.imageio.ImageIO;
+import java.awt.image.BufferedImage;
+import java.io.ByteArrayOutputStream;
+import java.io.IOException;
+
+/**
+ * <p>
+ * 扫码记录 前端控制器
+ * </p>
+ *
+ * @author ceshi
+ * @since 2024-01-18
+ */
+@RestController
+public class SmartQrcodeController implements SmartQrcodeControllerAPI {
+
+    @Autowired
+    private SmartUserService smartUserService;
+
+    @Override
+    public CommonResult generateQrcode(int userId) {
+        SmartUser user = smartUserService.getSmartById(userId);
+        if(user == null){
+            return CommonResult.fail("用户信息无效,无法生成二维码");
+        }
+
+        QrcodeImageVo qiv = new QrcodeImageVo();
+        qiv.setId(user.getId());
+        qiv.setPhone(user.getPhone());
+        qiv.setTimestamp(TimeExchange.getTime());
+
+        String qrStr = JSON.toJSONString(qiv);
+
+        BaseImageVo result = new BaseImageVo();
+        result.setQrcode(qrStr);
+
+        return CommonResult.ok(result);
+    }
+}
+

+ 7 - 0
src/main/java/com/template/controller/SmartScoreController.java

@@ -159,7 +159,9 @@ public class SmartScoreController implements SmartScoreControllerAPI {
                 data.setId(spv.getId());
                 data.setId(spv.getId());
                 data.setSemester(spv.getSemester());
                 data.setSemester(spv.getSemester());
                 data.setGrade(spv.getGrade());
                 data.setGrade(spv.getGrade());
+                data.setGradeId(spv.getGradeId());
                 data.setSchoolClass(spv.getSchoolClass());
                 data.setSchoolClass(spv.getSchoolClass());
+                data.setSchoolClassId(spv.getSchoolClassId());
                 data.setSubject(spv.getSubjectId());
                 data.setSubject(spv.getSubjectId());
                 data.setSubjectStr(eSubjectStatu.stringOf(spv.getSubjectId()));
                 data.setSubjectStr(eSubjectStatu.stringOf(spv.getSubjectId()));
                 data.setExamType(spv.getExamType());
                 data.setExamType(spv.getExamType());
@@ -197,7 +199,9 @@ public class SmartScoreController implements SmartScoreControllerAPI {
         SmartScore ss = new SmartScore();
         SmartScore ss = new SmartScore();
         ss.setSemester(isr.getSemester());
         ss.setSemester(isr.getSemester());
         ss.setGrade(isr.getGrade());
         ss.setGrade(isr.getGrade());
+        ss.setGradeId(isr.getGradeId());
         ss.setSchoolClass(isr.getSchoolClass());
         ss.setSchoolClass(isr.getSchoolClass());
+        ss.setSchoolClassId(isr.getSchoolClassId());
         ss.setCardNo(isr.getCardNo());
         ss.setCardNo(isr.getCardNo());
         ss.setUserId(isr.getUserId());
         ss.setUserId(isr.getUserId());
         ss.setName(user.getName());
         ss.setName(user.getName());
@@ -233,7 +237,9 @@ public class SmartScoreController implements SmartScoreControllerAPI {
         }
         }
 
 
         score.setSemester(usr.getSemester());
         score.setSemester(usr.getSemester());
+        score.setGradeId(usr.getGradeId());
         score.setGrade(usr.getGrade());
         score.setGrade(usr.getGrade());
+        score.setSchoolClassId(usr.getSchoolClassId());
         score.setSchoolClass(usr.getSchoolClass());
         score.setSchoolClass(usr.getSchoolClass());
         score.setCardNo(usr.getCardNo());
         score.setCardNo(usr.getCardNo());
         score.setUserId(usr.getUserId());
         score.setUserId(usr.getUserId());
@@ -242,6 +248,7 @@ public class SmartScoreController implements SmartScoreControllerAPI {
         score.setExamType(usr.getExamType());
         score.setExamType(usr.getExamType());
         score.setScore(usr.getScore());
         score.setScore(usr.getScore());
 
 
+
         int result = smartScoreService.updateSmartScore(score);
         int result = smartScoreService.updateSmartScore(score);
 
 
         return result > 0 ? CommonResult.ok("编辑成功") : CommonResult.fail("编辑失败");
         return result > 0 ? CommonResult.ok("编辑成功") : CommonResult.fail("编辑失败");

تفاوت فایلی نمایش داده نمی شود زیرا این فایل بسیار بزرگ است
+ 228 - 33
src/main/java/com/template/controller/SmartUserController.java


+ 153 - 14
src/main/java/com/template/controller/SmartVisitorController.java

@@ -3,6 +3,8 @@ package com.template.controller;
 
 
 import com.alibaba.fastjson.JSONObject;
 import com.alibaba.fastjson.JSONObject;
 import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
 import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
+import com.fasterxml.jackson.core.JsonProcessingException;
+import com.fasterxml.jackson.databind.ObjectMapper;
 import com.seewo.open.sdk.DefaultSeewoClient;
 import com.seewo.open.sdk.DefaultSeewoClient;
 import com.seewo.open.sdk.SeewoClient;
 import com.seewo.open.sdk.SeewoClient;
 import com.seewo.open.sdk.auth.Account;
 import com.seewo.open.sdk.auth.Account;
@@ -17,14 +19,15 @@ import com.template.model.enumModel.*;
 import com.template.model.pojo.*;
 import com.template.model.pojo.*;
 import com.template.model.request.otherAppointmentRequest;
 import com.template.model.request.otherAppointmentRequest;
 import com.template.model.request.parentsAppointmentRequest;
 import com.template.model.request.parentsAppointmentRequest;
+import com.template.model.request.turnOnTheDeviceRequest;
 import com.template.model.result.CommonResult;
 import com.template.model.result.CommonResult;
 import com.template.model.result.PageUtils;
 import com.template.model.result.PageUtils;
 import com.template.model.seewo.HomeSchoolServiceSendNoteToKidParam;
 import com.template.model.seewo.HomeSchoolServiceSendNoteToKidParam;
 import com.template.model.seewo.HomeSchoolServiceSendNoteToKidRequest;
 import com.template.model.seewo.HomeSchoolServiceSendNoteToKidRequest;
 import com.template.model.seewo.HomeSchoolServiceSendNoteToKidResult;
 import com.template.model.seewo.HomeSchoolServiceSendNoteToKidResult;
-import com.template.model.vo.AffiliateUserVo;
-import com.template.model.vo.VisitorPageVo;
+import com.template.model.vo.*;
 import com.template.services.SmartAuthorGroupService;
 import com.template.services.SmartAuthorGroupService;
+import com.template.services.SmartQrcodeService;
 import com.template.services.SmartUserService;
 import com.template.services.SmartUserService;
 import com.template.services.SmartVisitorService;
 import com.template.services.SmartVisitorService;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -35,9 +38,12 @@ import org.springframework.web.bind.annotation.RequestParam;
 import org.springframework.web.bind.annotation.RestController;
 import org.springframework.web.bind.annotation.RestController;
 
 
 import javax.annotation.Resource;
 import javax.annotation.Resource;
+import java.net.URLDecoder;
 import java.util.*;
 import java.util.*;
 import java.util.stream.Collectors;
 import java.util.stream.Collectors;
 
 
+import static com.template.common.utils.AesTestOne.decrypt;
+
 /**
 /**
  * <p>
  * <p>
  * 前端控制器
  * 前端控制器
@@ -56,6 +62,9 @@ public class SmartVisitorController implements SmartVisitorControllerAPI {
     private SmartVisitorService smartVisitorService;
     private SmartVisitorService smartVisitorService;
 
 
     @Autowired
     @Autowired
+    private SmartQrcodeService smartQrcodeService;
+
+    @Autowired
     private SmartUserService smartUserService;
     private SmartUserService smartUserService;
 
 
     @Resource
     @Resource
@@ -121,11 +130,21 @@ public class SmartVisitorController implements SmartVisitorControllerAPI {
     public CommonResult deleteSmartVisitorById(int id) {
     public CommonResult deleteSmartVisitorById(int id) {
 
 
         SmartVisitor data = smartVisitorService.getSmartById(id);
         SmartVisitor data = smartVisitorService.getSmartById(id);
-
         if (data == null) {
         if (data == null) {
             return CommonResult.fail("当前数据不存在,删除失败!");
             return CommonResult.fail("当前数据不存在,删除失败!");
         }
         }
 
 
+        //审核通过就不能删除
+        if(data.getStatu().intValue() == eApproveStatu.Pushed.getValue()){
+            return CommonResult.fail("无法删除已审核通过的访客数据");
+        }
+
+        //已审核通过的数据不能删除 那么就不需要进行下面这些操作
+        //region 推送到希沃班牌,通知访客记录取消
+        //endregion
+        //region 删除百胜中的访客数据
+        //endregion
+
         int result = smartVisitorService.deleteSmartVisitorById(id);
         int result = smartVisitorService.deleteSmartVisitorById(id);
 
 
         return result > 0 ? CommonResult.ok("删除成功") : CommonResult.fail("删除失败");
         return result > 0 ? CommonResult.ok("删除成功") : CommonResult.fail("删除失败");
@@ -211,7 +230,7 @@ public class SmartVisitorController implements SmartVisitorControllerAPI {
         //那是不是第二次预约的时间不能在那个可访问的时间段内
         //那是不是第二次预约的时间不能在那个可访问的时间段内
         //例如:比如,第一次约了7:00-10:00;那第二次:6:00-7:30 或 8:11-13:00都不行
         //例如:比如,第一次约了7:00-10:00;那第二次:6:00-7:30 或 8:11-13:00都不行
         Integer count = smartVisitorService.queryVisitorCount(su.getIdCard(), startTime, endTime);
         Integer count = smartVisitorService.queryVisitorCount(su.getIdCard(), startTime, endTime);
-        if (count <= 0) {
+        if (count > 0) {
             return CommonResult.fail("该时间段已预约,请勿重复预约!");
             return CommonResult.fail("该时间段已预约,请勿重复预约!");
         }
         }
 
 
@@ -236,8 +255,8 @@ public class SmartVisitorController implements SmartVisitorControllerAPI {
     }
     }
 
 
     @Override
     @Override
-    public CommonResult appointmentPageRecord(int currentPage, int pageCount, Integer userId, int type) {
-        PageUtils<VisitorPageVo> result = smartVisitorService.smartVisitorPageByUserId(currentPage, pageCount, userId, type);
+    public CommonResult appointmentPageRecord(int currentPage, int pageCount, Integer userId, int type, String createStartTime, String createEndTime, String keyWord, String visitorStartTime, String visitorEndTime) {
+        PageUtils<VisitorPageVo> result = smartVisitorService.smartVisitorPageByUserId(currentPage, pageCount, userId, type, createStartTime, createEndTime, keyWord, visitorStartTime, visitorEndTime);
 
 
         return CommonResult.ok(result);
         return CommonResult.ok(result);
     }
     }
@@ -259,6 +278,11 @@ public class SmartVisitorController implements SmartVisitorControllerAPI {
             return CommonResult.fail("访客记录已失效,审核失败!");
             return CommonResult.fail("访客记录已失效,审核失败!");
         }
         }
 
 
+        //审核处理后的数据不能再处理判断
+        if(visitor.getStatu().intValue() != eApproveStatu.Audit.getValue()){
+            return CommonResult.fail("该记录已被操作过,请勿重复操作");
+        }
+
         try {
         try {
             if (type == eExamineStatu.Agree.getValue()) {
             if (type == eExamineStatu.Agree.getValue()) {
                 visitor.setStatu(eApproveStatu.Pushed.getValue());
                 visitor.setStatu(eApproveStatu.Pushed.getValue());
@@ -309,6 +333,10 @@ public class SmartVisitorController implements SmartVisitorControllerAPI {
                         if (!result.contains("预约成功")) {
                         if (!result.contains("预约成功")) {
                             throw new Exception("审核失败");
                             throw new Exception("审核失败");
                         }
                         }
+
+                        ObjectMapper objectMapper = new ObjectMapper();
+                        BsReservationVo reservation = objectMapper.readValue(result, BsReservationVo.class);
+                        visitor.setBsOrderNo(reservation.getData().getReOrderNo());
                     }
                     }
                 }
                 }
 
 
@@ -388,41 +416,152 @@ public class SmartVisitorController implements SmartVisitorControllerAPI {
         }
         }
 
 
         //是否是管理员
         //是否是管理员
-        boolean isAdmin = false;
+        String whereSql = null;
         //获取的权限组数据
         //获取的权限组数据
         List<SmartAuthorGroup> authorGroups = smartAuthorGroupService.smartAuthorGroup(user.getId());
         List<SmartAuthorGroup> authorGroups = smartAuthorGroupService.smartAuthorGroup(user.getId());
         for (SmartAuthorGroup authorGroup : authorGroups) {
         for (SmartAuthorGroup authorGroup : authorGroups) {
             List<String> applyIds = Arrays.asList(authorGroup.getApplyId().split(","));
             List<String> applyIds = Arrays.asList(authorGroup.getApplyId().split(","));
             //菜单表中7是访客预约
             //菜单表中7是访客预约
             long appointCount = applyIds.stream().filter(e -> e.equals("7")).count();
             long appointCount = applyIds.stream().filter(e -> e.equals("7")).count();
-            if(appointCount > 0){
-                isAdmin = true;
+            if (appointCount > 0) {
+                whereSql = "visitor_type = 2";
                 break;
                 break;
             }
             }
         }
         }
 
 
         List<Integer> studentIds = null;
         List<Integer> studentIds = null;
         //班主任
         //班主任
-        if(user.getDuties().intValue() == eDuties.ClassTeacher.getValue()){
+        if (user.getDuties().intValue() == eDuties.ClassTeacher.getValue()) {
             //班级ID
             //班级ID
             Integer schoolClass = user.getSchoolClass();
             Integer schoolClass = user.getSchoolClass();
             //获取该班级下的所有学生ID数据
             //获取该班级下的所有学生ID数据
             List<SmartUser> students = smartUserService.queryStudentBySchoolClass(user.getSchoolClass());
             List<SmartUser> students = smartUserService.queryStudentBySchoolClass(user.getSchoolClass());
 
 
-            if(students == null){
+            if (students == null) {
                 return CommonResult.fail("当前身份下不存在学生信息");
                 return CommonResult.fail("当前身份下不存在学生信息");
             }
             }
 
 
             studentIds = students.stream().map(SmartUser::getId).collect(Collectors.toList());
             studentIds = students.stream().map(SmartUser::getId).collect(Collectors.toList());
         }
         }
 
 
-        if(!isAdmin && studentIds == null){
-            return CommonResult.ok(null);
+        PageUtils<SmartVisitor> result = new PageUtils<SmartVisitor>(null, 0, pageCount, currentPage);
+
+        if (whereSql == null && studentIds == null) {
+            return CommonResult.ok(result);
         }
         }
 
 
-        PageUtils<SmartVisitor> result = smartVisitorService.queryVisitorPageDatas(currentPage,pageCount,type,studentIds,isAdmin ? "true" : "false");
+        result = smartVisitorService.queryVisitorPageDatas(currentPage, pageCount, type, studentIds, studentIds != null && whereSql != null ? "or " + whereSql : whereSql);
 
 
         return CommonResult.ok(result);
         return CommonResult.ok(result);
     }
     }
+
+    @Override
+    public TurnOnDeviceVo turnOnTheDevice(turnOnTheDeviceRequest data) throws JsonProcessingException {
+        TurnOnDeviceVo result = new TurnOnDeviceVo();
+
+        //region 参数判断
+        if (data == null) {
+            result.setResultcode(2);
+            result.setMessage("扫码参数不能为空");
+            result.setActionName("qrCodePush");
+            return result;
+        }
+
+        if (data.getActionName() == null) {
+            result.setResultcode(2);
+            result.setMessage("指令不能为空");
+            result.setActionName("qrCodePush");
+            return result;
+        }
+
+        if (!data.getActionName().equals("qrCodePush")) {
+            result.setResultcode(2);
+            result.setMessage("指令错误");
+            result.setActionName("qrCodePush");
+            return result;
+        }
+
+        if (data.getData() == null) {
+            result.setResultcode(2);
+            result.setMessage("二维码内容不能为空");
+            result.setActionName("qrCodePush");
+            return result;
+        }
+
+        ObjectMapper objectMapper = new ObjectMapper();
+        qrCodeVo codeVo = objectMapper.readValue(data.getData(), qrCodeVo.class);
+        if (codeVo == null) {
+            result.setResultcode(2);
+            result.setMessage("二维码内容不能为空");
+            result.setActionName("qrCodePush");
+            return result;
+        }
+
+        if (codeVo.getQrCode() == null) {
+            result.setResultcode(2);
+            result.setMessage("二维码内容不能为空");
+            result.setActionName("qrCodePush");
+            return result;
+        }
+
+        if (data.getDeviceno() == null) {
+            result.setResultcode(2);
+            result.setMessage("设备编号不能为空");
+            result.setActionName("qrCodePush");
+            return result;
+        }
+
+        if (data.getVersion() == null) {
+            result.setResultcode(2);
+            result.setMessage("版本不能为空");
+            result.setActionName("qrCodePush");
+            return result;
+        }
+        //endregion
+
+        //解码逻辑
+        QrcodeImageVo qiv = objectMapper.readValue(codeVo.getQrCode(), QrcodeImageVo.class);
+
+        SmartUser user = smartUserService.getSmartById(qiv.getId());
+        if (user == null) {
+            result.setResultcode(2);
+            result.setMessage("用户身份无效,刷码失败");
+            result.setActionName("qrCodePush");
+            return result;
+        }
+
+        //目前二维码一分钟内有效
+        //过期:(时间戳 + 有效期分钟数)<= 当前时间
+        //时间戳转时间
+        Date dateNow = TimeExchange.StringToDate(TimeExchange.TimeRangeI10(qiv.getTimestamp(), 1), "yyyy-MM-dd HH:mm:ss");
+        if (dateNow.compareTo(new Date()) < 0) {
+            result.setResultcode(2);
+            result.setMessage("身份码已过期");
+            result.setActionName("qrCodePush");
+            return result;
+        }
+
+        //成功后将刷码记录存储到数据表中
+        SmartQrcode sq = new SmartQrcode();
+        sq.setUserId(0);
+        sq.setSourceCode(data.getData());
+        sq.setIsSuccess(1);
+
+
+        int insertResult = smartQrcodeService.insertSmartQrcode(sq);
+        if (insertResult <= 0) {
+            result.setResultcode(2);
+            result.setMessage("新增刷码记录失败");
+            result.setActionName("qrCodePush");
+            return result;
+        }
+
+        result.setResultcode(1);
+        result.setMessage("成功");
+        result.setActionName("qrCodePush");
+        return result;
+    }
+
+
 }
 }
 
 

+ 269 - 9
src/main/java/com/template/controller/SmartWarningController.java

@@ -1,21 +1,45 @@
 package com.template.controller;
 package com.template.controller;
 
 
 
 
+import cn.hutool.poi.excel.ExcelUtil;
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
 import com.template.api.SmartWarningControllerAPI;
 import com.template.api.SmartWarningControllerAPI;
-import com.template.common.utils.paramUtils;
+import com.template.common.result.ResponseStatusEnum;
+import com.template.common.utils.*;
+import com.template.model.dto.OperationWarningDto;
+import com.template.model.dto.WarningSavePushDto;
+import com.template.model.pojo.SmartDepartment;
+import com.template.model.pojo.SmartUser;
 import com.template.model.pojo.SmartWarning;
 import com.template.model.pojo.SmartWarning;
 import com.template.model.result.CommonResult;
 import com.template.model.result.CommonResult;
 import com.template.model.result.PageUtils;
 import com.template.model.result.PageUtils;
+import com.template.model.vo.DepartmentTreeVo;
+import com.template.model.vo.UserVo;
+import com.template.services.SmartDepartmentService;
+import com.template.services.SmartUserService;
 import com.template.services.SmartWarningService;
 import com.template.services.SmartWarningService;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.validation.BindingResult;
 import org.springframework.validation.BindingResult;
 import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RequestMapping;
 
 
+import org.springframework.web.bind.annotation.RequestParam;
 import org.springframework.web.bind.annotation.RestController;
 import org.springframework.web.bind.annotation.RestController;
+import org.yaml.snakeyaml.events.Event;
+
+import javax.servlet.http.HttpServletResponse;
+import java.io.IOException;
+import java.text.SimpleDateFormat;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
+import java.util.stream.Collectors;
 
 
 /**
 /**
  * <p>
  * <p>
- *  前端控制器
+ * 前端控制器
  * </p>
  * </p>
  *
  *
  * @author ceshi
  * @author ceshi
@@ -27,9 +51,16 @@ public class SmartWarningController implements SmartWarningControllerAPI {
     @Autowired
     @Autowired
     private SmartWarningService smartWarningService;
     private SmartWarningService smartWarningService;
 
 
+    @Autowired
+    private SmartDepartmentService smartDepartmentService;
+
+    @Autowired
+    private SmartUserService smartUserService;
+
     /**
     /**
      * 新增预警信息
      * 新增预警信息
-     * @param smartApply 预警信息数据
+     *
+     * @param smartApply    预警信息数据
      * @param bindingResult
      * @param bindingResult
      * @return
      * @return
      */
      */
@@ -47,7 +78,8 @@ public class SmartWarningController implements SmartWarningControllerAPI {
 
 
     /**
     /**
      * 更新预警信息
      * 更新预警信息
-     * @param sa 预警信息数据
+     *
+     * @param sa            预警信息数据
      * @param bindingResult
      * @param bindingResult
      * @return
      * @return
      */
      */
@@ -64,14 +96,15 @@ public class SmartWarningController implements SmartWarningControllerAPI {
 
 
     /**
     /**
      * 预警信息分页数据查询
      * 预警信息分页数据查询
+     *
      * @param currentPage 当前页数
      * @param currentPage 当前页数
-     * @param pageCount 一页数据条数
-     * @param name 查询名称
+     * @param pageCount   一页数据条数
+     * @param name        查询名称
      * @return
      * @return
      */
      */
     @Override
     @Override
-    public CommonResult queryPageSmartWarning(int currentPage, int pageCount, String name) {
-        PageUtils<SmartWarning> result = smartWarningService.queryPageSmartWarnings(currentPage, pageCount, name);
+    public CommonResult queryPageSmartWarning(int currentPage, int pageCount, String name, String state) {
+        PageUtils<SmartWarning> result = smartWarningService.queryPageSmartWarnings(currentPage, pageCount, name, state);
 
 
         return CommonResult.ok(result);
         return CommonResult.ok(result);
     }
     }
@@ -82,7 +115,7 @@ public class SmartWarningController implements SmartWarningControllerAPI {
 
 
         SmartWarning data = smartWarningService.getSmartById(id);
         SmartWarning data = smartWarningService.getSmartById(id);
 
 
-        if(data == null){
+        if (data == null) {
             return CommonResult.fail("当前数据不存在,删除失败!");
             return CommonResult.fail("当前数据不存在,删除失败!");
         }
         }
 
 
@@ -91,5 +124,232 @@ public class SmartWarningController implements SmartWarningControllerAPI {
         return result > 0 ? CommonResult.ok("删除成功") : CommonResult.fail("删除失败");
         return result > 0 ? CommonResult.ok("删除成功") : CommonResult.fail("删除失败");
     }
     }
 
 
+    @Override
+    public CommonResult operation(OperationWarningDto operationWarningDto) {
+        Integer id = operationWarningDto.getId();
+        if (ObjectUtils.isEmpty(id)) {
+            return CommonResult.fail("缺少id");
+        }
+        String remark = operationWarningDto.getRemark();
+
+        SmartWarning smartById = smartWarningService.getSmartById(id);
+
+        smartById.setStatu(1);
+        smartById.setRemark(remark);
+
+        int result = smartWarningService.updateSmartWarning(smartById);
+
+        return result > 0 ? CommonResult.ok("操作成功") : CommonResult.fail("操作失败");
+    }
+
+    @Override
+    public void excelSmartWarning(HttpServletResponse response, String location, String state) {
+        // 表头数据
+//        List<Object> head = Arrays.asList("姓名","事件","地点","时间","备注","状态","图片");
+//
+//        List<List<Object>> sheetDataList = new ArrayList<>();
+//        sheetDataList.add(head);
+
+
+        String fileName = "预警.xlsx";
+        List<WarningEntity> warningEntities = new ArrayList<>();
+
+//        获取数据
+        LambdaQueryWrapper<SmartWarning> queryWrapper = new LambdaQueryWrapper<>();
+        queryWrapper.like(ObjectUtils.isNotEmpty(location), SmartWarning::getLocation, location)
+                .eq(ObjectUtils.isNotEmpty(state), SmartWarning::getStatu, state);
+        List<SmartWarning> list = smartWarningService.list(queryWrapper);
+
+
+        for (SmartWarning smartWarning : list) {
+            WarningEntity warning = new WarningEntity();
+//                if (ObjectUtils.isNotEmpty(smartWarning.getWarningName())) {
+            warning.setName(smartWarning.getWarningName());
+//                }else {
+//                    user.add("无");
+//                }
+
+            warning.setType(smartWarning.getType());
+
+            warning.setLocation(smartWarning.getLocation());
+
+            warning.setDateTime(smartWarning.getDateTime());
+
+            warning.setRemark(smartWarning.getRemark());
+
+            Integer statu = smartWarning.getStatu();
+            String status = "";
+            if (statu == 0) {
+                status = "未处理";
+            } else if (statu == 1) {
+                status = "已处理";
+            }
+            warning.setState(status);
+
+            warning.setImage(smartWarning.getImage());
+
+            // 将数据汇总
+            warningEntities.add(warning);
+        }
+
+
+        try {
+            ExcelUtil3.process(fileName, warningEntities, WarningEntity.class, response);
+        } catch (IOException e) {
+            e.printStackTrace();
+        }
+
+    }
+
+    @Override
+    public CommonResult warningType() {
+        List<String> typeList = smartWarningService.warningType();
+        typeList.add("全部");
+
+        return CommonResult.ok(typeList);
+    }
+
+    @Override
+    public CommonResult pageWarning(int currentPage, int pageCount, String type, String dateTime) {
+        PageUtils<SmartWarning> result = smartWarningService.pageWarning(currentPage, pageCount, type, dateTime);
+
+        return CommonResult.ok(result);
+    }
+
+    @Override
+    public CommonResult warningDepartmentTree() {
+        List<SmartDepartment> result = smartDepartmentService.list(new QueryWrapper<>());
+
+        List<SmartDepartment> zeroResult = result.stream().filter(e -> e.getParentId().intValue() == 0).collect(Collectors.toList());
+        List<DepartmentTreeVo> departments = new ArrayList<>();
+        for (SmartDepartment data : zeroResult) {
+            DepartmentTreeVo newData = DepartmentTreeVo.builder()
+                    .id(data.getId())
+                    .name(data.getName())
+                    .parentId(data.getParentId())
+                    .build();
+
+            List<DepartmentTreeVo> departmentTrees = QueryDepartmentTreeRecords(newData.getId(), result);
+            newData.setChildren(departmentTrees);
+            departments.add(newData);
+        }
+
+
+        return CommonResult.ok(departments);
+    }
+
+    @Override
+    public CommonResult warningUserList(int currentPage, int pageCount, Integer departmentId, String name) {
+        //获取该部门下的所有子级部门ID
+        List<Integer> childDepartmentIds = new ArrayList<>();
+        List<SmartDepartment> departments = smartDepartmentService.list(null);
+        childDepartmentIds.add(departmentId);
+        QueryDepartmentTreeRecords(departmentId, departments, childDepartmentIds);
+
+        if (departmentId == null) {
+            childDepartmentIds = null;
+        }
+
+        PageUtils<UserVo> result = smartUserService.warningUserList(currentPage, pageCount, childDepartmentIds, name);
+        return CommonResult.ok(result);
+    }
+
+    @Override
+    public CommonResult warningPushList() {
+        List<SmartUser> names = smartUserService.warningPushList();
+
+        return CommonResult.ok(names);
+    }
+
+    @Override
+    public CommonResult warningSavePush(WarningSavePushDto warningSavePushDto) {
+        List<Integer> ids = warningSavePushDto.getIds();
+
+        if (ObjectUtils.isEmpty(ids) && ids.size() <= 0) {
+            return CommonResult.fail(ResponseStatusEnum.PARAM_ERROR);
+        }
+
+        List<SmartUser> smartUsers = smartUserService.getSmartUserByIds(ids);
+
+        for (SmartUser smartUser : smartUsers) {
+            String gzhOpenId = smartUser.getGzhOpenId();
+            if (ObjectUtils.isEmpty(gzhOpenId)) {
+                return CommonResult.fail(smartUser.getName()+ "未关联公众号");
+            }
+            smartUser.setIsPush(1);
+            smartUserService.updateSmartUser(smartUser);
+        }
+
+        return CommonResult.ok();
+    }
+
+    @Override
+    public CommonResult warningDeletePush(Integer id) {
+
+        if (ObjectUtils.isEmpty(id)) {
+            return CommonResult.fail();
+        }
+
+        SmartUser smartById = smartUserService.getSmartById(id);
+
+        if (ObjectUtils.isEmpty(smartById)) {
+            return CommonResult.fail();
+        }
+        smartById.setIsPush(0);
+        int result = smartUserService.updateSmartUser(smartById);
+        return result > 0 ? CommonResult.ok("删除成功") : CommonResult.fail("删除失败");
+    }
+
+
+    /**
+     * 根据父级ID获取树形数据
+     *
+     * @param parentID 父级ID
+     * @param lists    数据集合
+     * @return
+     */
+    private List<DepartmentTreeVo> QueryDepartmentTreeRecords(Integer parentID, List<SmartDepartment> lists) {
+        List<DepartmentTreeVo> newTrees = new ArrayList<>();
+
+        List<SmartDepartment> datas = lists.stream().filter(e -> e.getParentId().equals(parentID)).collect(Collectors.toList());
+
+        for (SmartDepartment data : datas) {
+            DepartmentTreeVo item = DepartmentTreeVo.builder()
+                    .id(data.getId())
+                    .parentId(parentID)
+                    .name(data.getName())
+                    .build();
+            List<DepartmentTreeVo> news = QueryDepartmentTreeRecords(item.getId(), lists);
+            if (news == null || news.size() == 0) {
+                newTrees.add(item);
+                continue;
+            } else {
+                item.setChildren(news);
+                newTrees.add(item);
+            }
+        }
+
+        return newTrees;
+    }
+
+    /**
+     * 根据父级ID获取树形数据
+     *
+     * @param parentID 父级ID
+     * @param lists    数据集合
+     * @return
+     */
+    private List<DepartmentTreeVo> QueryDepartmentTreeRecords(Integer parentID, List<SmartDepartment> lists, List<Integer> departmentIds) {
+        List<DepartmentTreeVo> newTrees = new ArrayList<>();
+
+        List<SmartDepartment> datas = lists.stream().filter(e -> e.getParentId().equals(parentID)).collect(Collectors.toList());
+
+        for (SmartDepartment data : datas) {
+            departmentIds.add(data.getId());
+            QueryDepartmentTreeRecords(data.getId(), lists, departmentIds);
+        }
+
+        return newTrees;
+    }
 }
 }
 
 

+ 140 - 35
src/main/java/com/template/controller/WechatScanLoginController.java

@@ -13,8 +13,10 @@ import com.template.common.constanst.Constanst;
 import com.template.common.result.ResponseStatusEnum;
 import com.template.common.result.ResponseStatusEnum;
 import com.template.common.utils.*;
 import com.template.common.utils.*;
 import com.template.model.evaluate.student.SmartEvaluateStudent;
 import com.template.model.evaluate.student.SmartEvaluateStudent;
+import com.template.model.evaluate.student.SmartSubjectManage;
 import com.template.model.pojo.SmartAuthority;
 import com.template.model.pojo.SmartAuthority;
 import com.template.model.pojo.SmartUser;
 import com.template.model.pojo.SmartUser;
+import com.template.model.pojo.SmsCode;
 import com.template.model.result.CommonResult;
 import com.template.model.result.CommonResult;
 import com.template.model.result.PageUtils;
 import com.template.model.result.PageUtils;
 import com.template.model.tongji.*;
 import com.template.model.tongji.*;
@@ -22,10 +24,7 @@ import com.template.model.vo.LoginVO;
 import com.template.model.weixin.AccessToken;
 import com.template.model.weixin.AccessToken;
 import com.template.model.weixin.HttpParame;
 import com.template.model.weixin.HttpParame;
 import com.template.model.weixin.WechatUserUnionID;
 import com.template.model.weixin.WechatUserUnionID;
-import com.template.services.SmartAuthorGroupService;
-import com.template.services.SmartAuthorityService;
-import com.template.services.SmartUserService;
-import com.template.services.WechatScanLoginService;
+import com.template.services.*;
 import org.apache.commons.lang3.StringUtils;
 import org.apache.commons.lang3.StringUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Controller;
 import org.springframework.stereotype.Controller;
@@ -39,6 +38,7 @@ import java.io.UnsupportedEncodingException;
 import java.math.BigDecimal;
 import java.math.BigDecimal;
 import java.net.URLEncoder;
 import java.net.URLEncoder;
 import java.text.ParseException;
 import java.text.ParseException;
+import java.util.Date;
 import java.util.HashMap;
 import java.util.HashMap;
 import java.util.List;
 import java.util.List;
 import java.util.Map;
 import java.util.Map;
@@ -46,7 +46,7 @@ import java.util.Map;
 /**
 /**
  * Title: WechatScanLoginController
  * Title: WechatScanLoginController
  * Description: 微信扫码登录controller
  * Description: 微信扫码登录controller
- * 
+ *
  * @author fengyong
  * @author fengyong
  * @date 2018年9月7日
  * @date 2018年9月7日
  */
  */
@@ -61,12 +61,14 @@ public class WechatScanLoginController implements WechatScanLoginControllerAPI {
 	public SmartAuthorityService smartAuthorityService;
 	public SmartAuthorityService smartAuthorityService;
 	@Autowired
 	@Autowired
 	public SmartAuthorGroupService smartAuthorGroupService;
 	public SmartAuthorGroupService smartAuthorGroupService;
+	@Autowired
+	public SmsCodeService smsCodeService;
 
 
 	/**
 	/**
 	 * Title: list
 	 * Title: list
 	 * Description: 重定向到微信扫码登录二维码页面
 	 * Description: 重定向到微信扫码登录二维码页面
 	 * 此处显示要微信要扫描的二维码
 	 * 此处显示要微信要扫描的二维码
-	 * 
+	 *
 	 * @param model
 	 * @param model
 	 * @return
 	 * @return
 	 * @throws UnsupportedEncodingException
 	 * @throws UnsupportedEncodingException
@@ -83,7 +85,7 @@ public class WechatScanLoginController implements WechatScanLoginControllerAPI {
 	/**
 	/**
 	 * Title: callback
 	 * Title: callback
 	 * Description: 回调地址处理
 	 * Description: 回调地址处理
-	 * 
+	 *
 	 * @param code
 	 * @param code
 	 * @param state
 	 * @param state
 	 * @return
 	 * @return
@@ -108,7 +110,7 @@ public class WechatScanLoginController implements WechatScanLoginControllerAPI {
 				if (user==null) {		/*不存在*/
 				if (user==null) {		/*不存在*/
 					return "redirect:"+HttpParame.FRONT_URI+"/#/login?message=" + URLEncoder.encode("请绑定信息", "UTF-8");
 					return "redirect:"+HttpParame.FRONT_URI+"/#/login?message=" + URLEncoder.encode("请绑定信息", "UTF-8");
 				} else {
 				} else {
-					String token = JWTUtil.getToken(user);
+					String token = JWTUtil.getToken(user, null);
 					QueryWrapper<SmartAuthority> queryWrapper1 = new QueryWrapper<>();
 					QueryWrapper<SmartAuthority> queryWrapper1 = new QueryWrapper<>();
 					queryWrapper1.eq("deleted", 0);
 					queryWrapper1.eq("deleted", 0);
 					queryWrapper1.eq("user_id", user.getId());
 					queryWrapper1.eq("user_id", user.getId());
@@ -131,11 +133,11 @@ public class WechatScanLoginController implements WechatScanLoginControllerAPI {
 	 */
 	 */
 	@Override
 	@Override
 	@PassToken
 	@PassToken
-	public String bindUserMac(String cardNo) throws UnsupportedEncodingException {
-		if (StringUtils.isBlank(cardNo)){
-			return "redirect:"+HttpParame.FRONT_URI+"/#/login?message=" + URLEncoder.encode("请绑定信息", "UTF-8");
+	public String bindUserMac(String phone,String messageCode) throws UnsupportedEncodingException {
+		if (StringUtils.isBlank(phone) || StringUtils.isBlank(messageCode)){
+			return "redirect:"+HttpParame.FRONT_URI+"/#/login?message=" + URLEncoder.encode("请输入信息", "UTF-8");
 		}
 		}
-		Map<String, String> wechatLoginUrl = wechatScanLoginService.wechatBindUrl(cardNo);
+		Map<String, String> wechatLoginUrl = wechatScanLoginService.wechatBindUrl(phone,messageCode);
 		String url = wechatLoginUrl.get("url");
 		String url = wechatLoginUrl.get("url");
 		System.out.println(url);
 		System.out.println(url);
 		return "redirect:" + url;
 		return "redirect:" + url;
@@ -143,8 +145,8 @@ public class WechatScanLoginController implements WechatScanLoginControllerAPI {
 
 
 	@Override
 	@Override
 	@PassToken
 	@PassToken
-	public String bindcallback(String code, String state, String cardNo) throws UnsupportedEncodingException {
-		System.out.println(code+"==="+state+"=="+cardNo);
+	public String bindcallback(String code, String state, String phone,String messageCode) throws UnsupportedEncodingException {
+		System.out.println(code+"==="+state+"=="+messageCode);
 		if (code != null && state != null) {
 		if (code != null && state != null) {
 			// 验证state为了用于防止跨站请求伪造攻击
 			// 验证state为了用于防止跨站请求伪造攻击
 			String decrypt = AesUtil.decrypt(AesUtil.parseHexStr2Byte(state), AesUtil.PASSWORD_SECRET_KEY, 16);
 			String decrypt = AesUtil.decrypt(AesUtil.parseHexStr2Byte(state), AesUtil.PASSWORD_SECRET_KEY, 16);
@@ -154,25 +156,31 @@ public class WechatScanLoginController implements WechatScanLoginControllerAPI {
 			AccessToken access = wechatScanLoginService.getAccessToken(code);
 			AccessToken access = wechatScanLoginService.getAccessToken(code);
 			if (access != null) {
 			if (access != null) {
 				String openid = access.getOpenid();
 				String openid = access.getOpenid();
-				/*SmartUser user = wechatScanLoginService.selectByOpenid(openid);
-				if (user!=null) {		*//*不存在*//*
-					return "redirect:"+HttpParame.FRONT_URI+"/#/login?message=" + URLEncoder.encode("该卡号已绑定其他用户", "UTF-8");
-				}*/
-				SmartUser userc = wechatScanLoginService.selectByCardNo(cardNo);
-				if (userc==null){
-					return "redirect:"+HttpParame.FRONT_URI+"/#/login?message=" + URLEncoder.encode("卡号信息错误", "UTF-8");
+				QueryWrapper<SmsCode> queryWrapper1 = new QueryWrapper<>();
+				queryWrapper1.eq("deleted", 0);
+				queryWrapper1.eq("is_verify",0);
+				queryWrapper1.eq("phone_number",phone);
+				queryWrapper1.eq("code",messageCode);
+				queryWrapper1.ge("expiration_time", new Date());
+				List<SmsCode> listc = smsCodeService.getSmsCodeByKey(queryWrapper1);
+				if (listc.isEmpty()){
+					return "redirect:"+HttpParame.FRONT_URI+"/#/login?message=" + URLEncoder.encode("验证码已失效", "UTF-8");
 				}
 				}
-				if (userc.getOpenId()!=null){
-					return "redirect:"+HttpParame.FRONT_URI+"/#/login?message=" + URLEncoder.encode("该卡号已绑定其他用户", "UTF-8");
+				QueryWrapper<SmartUser> queryWrapper2 = new QueryWrapper<>();
+				queryWrapper2.eq("deleted", 0);
+				queryWrapper2.eq("phone", phone);
+				List<SmartUser> userc = smartUserService.list(queryWrapper2);
+				if (userc.isEmpty()){
+					return "redirect:"+HttpParame.FRONT_URI+"/#/login?message=" + URLEncoder.encode("用户不存在", "UTF-8");
 				}
 				}
-				userc.setOpenId(openid);
-				int m = wechatScanLoginService.updateSmartUser(userc);
+				userc.get(0).setOpenId(openid);
+				int m = wechatScanLoginService.updateSmartUser(userc.get(0));
 				if (m>0){
 				if (m>0){
-					String token = JWTUtil.getToken(userc);
-					QueryWrapper<SmartAuthority> queryWrapper1 = new QueryWrapper<>();
-					queryWrapper1.eq("deleted", 0);
-					queryWrapper1.eq("user_id", userc.getId());
-					List<SmartAuthority> query = smartAuthorityService.getAuthorByKey(queryWrapper1);
+					String token = JWTUtil.getToken(userc.get(0),null);
+					QueryWrapper<SmartAuthority> queryWrapper3 = new QueryWrapper<>();
+					queryWrapper3.eq("deleted", 0);
+					queryWrapper3.eq("user_id", userc.get(0).getId());
+					List<SmartAuthority> query = smartAuthorityService.getAuthorByKey(queryWrapper3);
 					if (query.size()>0){
 					if (query.size()>0){
 						return "redirect:"+HttpParame.FRONT_URI+"/#/wanzai/home?token=" + token;
 						return "redirect:"+HttpParame.FRONT_URI+"/#/wanzai/home?token=" + token;
 					} else {
 					} else {
@@ -303,8 +311,8 @@ public class WechatScanLoginController implements WechatScanLoginControllerAPI {
 			return CommonResult.fail("请传入code");
 			return CommonResult.fail("请传入code");
 		}
 		}
 		String url = "https://api.weixin.qq.com/sns/jscode2session?" +
 		String url = "https://api.weixin.qq.com/sns/jscode2session?" +
-				"appid=" + PropertiesUtil.getValue(HttpParame.APPID) +
-				"&secret=" + PropertiesUtil.getValue(HttpParame.SECRET) +
+				"appid=" + PropertiesUtil.getValue(HttpParame.APPIDX) +
+				"&secret=" + PropertiesUtil.getValue(HttpParame.SECRETX) +
 				"&js_code=" + code +
 				"&js_code=" + code +
 				"&grant_type=authorization_code";
 				"&grant_type=authorization_code";
 
 
@@ -317,13 +325,110 @@ public class WechatScanLoginController implements WechatScanLoginControllerAPI {
 		} catch (Exception e) {
 		} catch (Exception e) {
 			return CommonResult.fail("code异常");
 			return CommonResult.fail("code异常");
 		}
 		}
-		SmartUser user = wechatScanLoginService.selectByOpenid(openid);
-		if (user==null){
+		QueryWrapper<SmartUser> queryWrapper1 = new QueryWrapper<>();
+		queryWrapper1.eq("deleted", 0);
+		queryWrapper1.eq("is_cancel",0);
+		queryWrapper1.eq("x_open_id", openid);
+		List<SmartUser> user = smartUserService.list(queryWrapper1);
+		if (user.isEmpty()){
 			return CommonResult.fail("请绑定后再进入");
 			return CommonResult.fail("请绑定后再进入");
 		}
 		}
-		String token = JWTUtil.getToken(user);
+		long expired = 1000 * 60 * 60 * 24 * 365;
+		String token = JWTUtil.getToken(user.get(0), expired);
 		JSONObject jsonObject = new JSONObject();
 		JSONObject jsonObject = new JSONObject();
 		jsonObject.put("token", token);
 		jsonObject.put("token", token);
+		jsonObject.put("user", user);
+		jsonObject.put("userhead", AesUtils.encrypt(String.valueOf(user.get(0).getId())));
+
 		return CommonResult.ok(jsonObject.toString());
 		return CommonResult.ok(jsonObject.toString());
 	}
 	}
+
+	@Override
+	@PassToken
+	public CommonResult sendMessage(String phone){
+		QueryWrapper<SmartUser> queryWrapper1 = new QueryWrapper<>();
+		queryWrapper1.eq("deleted", 0);
+		queryWrapper1.eq("phone",phone);
+		queryWrapper1.eq("is_cancel",0);
+		List<SmartUser> list = smartUserService.list(queryWrapper1);
+		if (list.isEmpty()){
+			return CommonResult.fail("该手机无权限登录");
+		}
+		QueryWrapper<SmsCode> queryWrapper2 = new QueryWrapper<>();
+		queryWrapper2.eq("deleted", 0);
+		queryWrapper2.eq("is_verify",0);
+		queryWrapper2.eq("phone_number",phone);
+		queryWrapper2.ge("expiration_time", new Date());
+		List<SmsCode> listc = smsCodeService.getSmsCodeByKey(queryWrapper2);
+		if (!listc.isEmpty()){
+			return CommonResult.fail("操作频繁,请稍后再试");
+		}
+		String code = GetVertifyCode.getRandomNumCode(6);
+		SmsCode smsCode = new SmsCode();
+		smsCode.setId(UUIDUtil.generateID());
+		smsCode.setPhoneNumber(phone);
+		smsCode.setCode(code);
+		long time = new Date().getTime() + 300000L;
+		smsCode.setExpirationTime(new Date(time));
+		smsCode.setIsVerify("0");
+		smsCode.setDeleted(0);
+		int m = smsCodeService.insertSmsCode(smsCode);
+		if (m>0){
+			String message = SendSms.sendSms(phone, code);
+			if (message.contains("success")){
+				return CommonResult.ok("发送成功");
+			}
+		}
+		return CommonResult.fail("操作失败");
+	}
+
+	@Override
+	@PassToken
+	public CommonResult vertifyMessage(String phone,String code, String wxcode){
+		QueryWrapper<SmsCode> queryWrapper1 = new QueryWrapper<>();
+		queryWrapper1.eq("deleted", 0);
+		queryWrapper1.eq("is_verify",0);
+		queryWrapper1.eq("phone_number",phone);
+		queryWrapper1.eq("code",code);
+		queryWrapper1.ge("expiration_time", new Date());
+		List<SmsCode> listc = smsCodeService.getSmsCodeByKey(queryWrapper1);
+		if (listc.isEmpty()){
+			return CommonResult.ok("验证码已失效");
+		}
+		if (StringUtils.isBlank(wxcode)){
+			return CommonResult.fail("请传入wxcode");
+		}
+		String url = "https://api.weixin.qq.com/sns/jscode2session?" +
+				"appid=" + PropertiesUtil.getValue(HttpParame.APPIDX) +
+				"&secret=" + PropertiesUtil.getValue(HttpParame.SECRETX) +
+				"&js_code=" + wxcode +
+				"&grant_type=authorization_code";
+
+		String json = HttpClientUtils.getInstance().sendHttpGet(url);
+		System.out.println(json);
+		Gson gson = new Gson();
+		HashMap<String, String> userMap = gson.fromJson(json.toString(), new TypeToken<HashMap<String, String>>() {}.getType());
+		String openid = "";
+		try {
+			openid = userMap.get("openid").toString();
+		} catch (Exception e) {
+			return CommonResult.fail("wxcode异常");
+		}
+		QueryWrapper<SmartUser> queryWrapper2 = new QueryWrapper<>();
+		queryWrapper2.eq("deleted", 0);
+		queryWrapper2.eq("phone", phone);
+		List<SmartUser> user = smartUserService.list(queryWrapper2);
+		if (user.isEmpty()){
+			return CommonResult.fail("该用户不存在");
+		}
+		user.get(0).setXOpenId(openid);
+		smartUserService.updateSmartUser(user.get(0));
+		long expired = 1000 * 60 * 60 * 24 * 365;
+		String token = JWTUtil.getToken(user.get(0),expired);
+		JSONObject jsonObject = new JSONObject();
+		jsonObject.put("token", token);
+		jsonObject.put("user", user.get(0));
+		jsonObject.put("userhead", AesUtils.encrypt(String.valueOf(user.get(0).getId())));
+		return CommonResult.ok(jsonObject);
+	}
 }
 }

+ 32 - 35
src/main/java/com/template/core/JwtAuthenticationInterceptor.java

@@ -45,47 +45,44 @@ public class JwtAuthenticationInterceptor implements HandlerInterceptor {
             //endregion
             //endregion
         }
         }
 
 
-
         //冻结后无法操作系统
         //冻结后无法操作系统
-
         if (1 == 1) {
         if (1 == 1) {
             return true;
             return true;
         }
         }
 
 
+        //除了登录和注册接口不需要user_head和token请求头外其他时候基本都要请求头
+        if(request.getHeader("user_head") == null){
+            //region 自定义返回响应的json格式
+            //加上这个可以让浏览器那里得到浏览器的401:response.setStatus(HttpServletResponse.SC_UNAUTHORIZED);
+            response.setCharacterEncoding("UTF-8");
+            response.setContentType("application/json; charset=utf-8");
+            JSONObject res = new JSONObject();
+            res.put("code", ResponseStatusEnum.MISSING_REQUEST_HEADER.getStatus());
+            res.put("message",  ResponseStatusEnum.MISSING_REQUEST_HEADER.getMsg());
+            res.put("success", false);
+            PrintWriter out = null;
+            out = response.getWriter();
+            out.write(res.toString());
+            out.flush();
+            out.close();
+            //endregion
+            return false;
+        }
 
 
-//        //除了登录和注册接口不需要user_head和token请求头外其他时候基本都要请求头
-//        if(request.getHeader("user_head") == null){
-//            //region 自定义返回响应的json格式
-//            //加上这个可以让浏览器那里得到浏览器的401:response.setStatus(HttpServletResponse.SC_UNAUTHORIZED);
-//            response.setCharacterEncoding("UTF-8");
-//            response.setContentType("application/json; charset=utf-8");
-//            JSONObject res = new JSONObject();
-//            res.put("code", ResponseStatusEnum.MISSING_REQUEST_HEADER.getStatus());
-//            res.put("message",  ResponseStatusEnum.MISSING_REQUEST_HEADER.getMsg());
-//            res.put("success", false);
-//            PrintWriter out = null;
-//            out = response.getWriter();
-//            out.write(res.toString());
-//            out.flush();
-//            out.close();
-//            //endregion
-//            return false;
-//        }
-//
-//        //region 获取url传递的参数 Query string传递的参数
-//        //获取url参数 getParameter方法里的参数名和定义的参数名一致
-//        String token = request.getHeader("token");
-//        // 验证userToken
-//        if (!StringUtils.hasText(token)) {
-//            throw new MyCustomException(ResponseStatusEnum.SYSTEM_TOKEN_ERROR);
-//        }
-//
-//        // 解析token
-//        Map<String, Claim> stringClaimMap = JWTUtil.verifyToken(token);
-//        if (ObjectUtils.isNotEmpty(stringClaimMap)) { // 登录
-//            return true;
-//        }
-//        //endregion
+        //region 获取url传递的参数 Query string传递的参数
+        //获取url参数 getParameter方法里的参数名和定义的参数名一致
+        String token = request.getHeader("token");
+        // 验证userToken
+        if (!StringUtils.hasText(token)) {
+            throw new MyCustomException(ResponseStatusEnum.SYSTEM_TOKEN_ERROR);
+        }
+
+        // 解析token
+        Map<String, Claim> stringClaimMap = JWTUtil.verifyToken(token);
+        if (ObjectUtils.isNotEmpty(stringClaimMap)) { // 登录
+            return true;
+        }
+        //endregion
 
 
         //region 自定义返回响应的json格式
         //region 自定义返回响应的json格式
         //加上这个可以让浏览器那里得到浏览器的401:response.setStatus(HttpServletResponse.SC_UNAUTHORIZED);
         //加上这个可以让浏览器那里得到浏览器的401:response.setStatus(HttpServletResponse.SC_UNAUTHORIZED);

+ 11 - 5
src/main/java/com/template/handler/MyMetaObjectHandler.java

@@ -21,15 +21,21 @@ public class MyMetaObjectHandler implements MetaObjectHandler {
     @Override
     @Override
     public void insertFill(MetaObject metaObject) {
     public void insertFill(MetaObject metaObject) {
         HttpServletRequest request = getHttpServletRequest();
         HttpServletRequest request = getHttpServletRequest();
-        if(request != null){
+        if (request != null) {
             String user_id = request.getHeader("user_head") == null ? "0" : AesUtils.decrypt(request.getHeader("user_head"));
             String user_id = request.getHeader("user_head") == null ? "0" : AesUtils.decrypt(request.getHeader("user_head"));
             log.info("start insert fill.....");
             log.info("start insert fill.....");
             // setFieldValByName(String fieldName, Object fieldVal, MetaObject metaObject
             // setFieldValByName(String fieldName, Object fieldVal, MetaObject metaObject
             this.setFieldValByName("createTime", new Date(), metaObject);
             this.setFieldValByName("createTime", new Date(), metaObject);
             this.setFieldValByName("updateTime", new Date(), metaObject);
             this.setFieldValByName("updateTime", new Date(), metaObject);
-            this.setFieldValByName("createUser", user_id , metaObject);
-            this.setFieldValByName("updateUser", user_id , metaObject);
-            this.setFieldValByName("deleted", 0 , metaObject);
+            this.setFieldValByName("createUser", user_id, metaObject);
+            this.setFieldValByName("updateUser", user_id, metaObject);
+            this.setFieldValByName("deleted", 0, metaObject);
+        } else {
+            this.setFieldValByName("createTime", new Date(), metaObject);
+            this.setFieldValByName("updateTime", new Date(), metaObject);
+            this.setFieldValByName("createUser","0", metaObject);
+            this.setFieldValByName("updateUser","0", metaObject);
+            this.setFieldValByName("deleted", 0, metaObject);
         }
         }
     }
     }
 
 
@@ -37,7 +43,7 @@ public class MyMetaObjectHandler implements MetaObjectHandler {
     @Override
     @Override
     public void updateFill(MetaObject metaObject) {
     public void updateFill(MetaObject metaObject) {
         HttpServletRequest request = getHttpServletRequest();
         HttpServletRequest request = getHttpServletRequest();
-        if(request != null){
+        if (request != null) {
             String user_id = request.getHeader("user_head") == null ? "0" : AesUtils.decrypt(request.getHeader("user_head"));
             String user_id = request.getHeader("user_head") == null ? "0" : AesUtils.decrypt(request.getHeader("user_head"));
             log.info("start update fill.....");
             log.info("start update fill.....");
             this.setFieldValByName("updateTime", new Date(), metaObject);
             this.setFieldValByName("updateTime", new Date(), metaObject);

+ 18 - 0
src/main/java/com/template/mapper/SmartFaceDiscernMapper.java

@@ -0,0 +1,18 @@
+package com.template.mapper;
+
+import com.template.model.pojo.SmartFaceDiscern;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import org.apache.ibatis.annotations.Mapper;
+
+/**
+ * <p>
+ *  Mapper 接口
+ * </p>
+ *
+ * @author ceshi
+ * @since 2024-01-18
+ */
+@Mapper
+public interface SmartFaceDiscernMapper extends BaseMapper<SmartFaceDiscern> {
+
+}

+ 5 - 0
src/main/java/com/template/mapper/SmartIdentityMapper.java

@@ -2,8 +2,12 @@ package com.template.mapper;
 
 
 import com.template.model.pojo.SmartIdentity;
 import com.template.model.pojo.SmartIdentity;
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.template.model.vo.AffiliateUserVo;
+import org.apache.ibatis.annotations.Param;
 import org.springframework.stereotype.Repository;
 import org.springframework.stereotype.Repository;
 
 
+import java.util.List;
+
 /**
 /**
  * <p>
  * <p>
  *  Mapper 接口
  *  Mapper 接口
@@ -15,4 +19,5 @@ import org.springframework.stereotype.Repository;
 @Repository
 @Repository
 public interface SmartIdentityMapper extends BaseMapper<SmartIdentity> {
 public interface SmartIdentityMapper extends BaseMapper<SmartIdentity> {
 
 
+    List<SmartIdentity> querySmartIdentityDatas(@Param("id") Integer id);
 }
 }

+ 18 - 0
src/main/java/com/template/mapper/SmartQrcodeMapper.java

@@ -0,0 +1,18 @@
+package com.template.mapper;
+
+import com.template.model.pojo.SmartQrcode;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import org.springframework.stereotype.Repository;
+
+/**
+ * <p>
+ * 楼栋表 Mapper 接口
+ * </p>
+ *
+ * @author ceshi
+ * @since 2024-01-18
+ */
+@Repository
+public interface SmartQrcodeMapper extends BaseMapper<SmartQrcode> {
+
+}

+ 9 - 0
src/main/java/com/template/mapper/SmartUserMapper.java

@@ -1,8 +1,10 @@
 package com.template.mapper;
 package com.template.mapper;
 
 
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.template.model.pojo.SmartUser;
 import com.template.model.pojo.SmartUser;
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.template.model.vo.AffiliateParentVo;
 import com.template.model.vo.AffiliateUserVo;
 import com.template.model.vo.AffiliateUserVo;
 import com.template.model.vo.GradeVo;
 import com.template.model.vo.GradeVo;
 import com.template.model.vo.UserVo;
 import com.template.model.vo.UserVo;
@@ -28,4 +30,11 @@ public interface SmartUserMapper extends BaseMapper<SmartUser> {
     List<SmartUser> querySmartUsers(@Param("departmentIds") List<Integer> departmentIds, @Param("name") String name);
     List<SmartUser> querySmartUsers(@Param("departmentIds") List<Integer> departmentIds, @Param("name") String name);
 
 
     IPage<GradeVo> querySmartSecordPage(IPage<GradeVo> page, @Param("name") String name);
     IPage<GradeVo> querySmartSecordPage(IPage<GradeVo> page, @Param("name") String name);
+
+    IPage<UserVo> warningUserList(Page<UserVo> page,@Param("departmentIds") List<Integer> departmentIds,@Param("name") String name);
+
+    List<SmartUser> warningPushList();
+
+    List<AffiliateParentVo> queryAffiliateParents(@Param("userId") Integer userId);
+
 }
 }

+ 1 - 1
src/main/java/com/template/mapper/SmartVisitorMapper.java

@@ -19,7 +19,7 @@ import java.util.List;
  */
  */
 @Repository
 @Repository
 public interface SmartVisitorMapper extends BaseMapper<SmartVisitor> {
 public interface SmartVisitorMapper extends BaseMapper<SmartVisitor> {
-    IPage<VisitorPageVo> queryVisitorPage(IPage<VisitorPageVo> page, @Param("userId") Integer userId, @Param("statu") Integer statu);
+    IPage<VisitorPageVo> queryVisitorPage(IPage<VisitorPageVo> page, @Param("userId") Integer userId, @Param("statu") Integer statu, @Param("createStartTime") String createStartTime, @Param("createEndTime") String createEndTime, @Param("keyWord") String keyWord, @Param("visitorStartTime") String visitorStartTime, @Param("visitorEndTime") String visitorEndTime);
 
 
     Integer queryVisitorCount(@Param("cardNo") String cardNo, @Param("startTime") String startTime, @Param("endTime") String endTime);
     Integer queryVisitorCount(@Param("cardNo") String cardNo, @Param("startTime") String startTime, @Param("endTime") String endTime);
 
 

+ 5 - 0
src/main/java/com/template/mapper/SmartWarningMapper.java

@@ -4,6 +4,8 @@ import com.template.model.pojo.SmartWarning;
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 import org.springframework.stereotype.Repository;
 import org.springframework.stereotype.Repository;
 
 
+import java.util.List;
+
 /**
 /**
  * <p>
  * <p>
  *  Mapper 接口
  *  Mapper 接口
@@ -15,4 +17,7 @@ import org.springframework.stereotype.Repository;
 @Repository
 @Repository
 public interface SmartWarningMapper extends BaseMapper<SmartWarning> {
 public interface SmartWarningMapper extends BaseMapper<SmartWarning> {
 
 
+    List<String> warningType();
+
+
 }
 }

+ 10 - 0
src/main/java/com/template/model/dto/OperationWarningDto.java

@@ -0,0 +1,10 @@
+package com.template.model.dto;
+
+import lombok.Data;
+
+@Data
+public class OperationWarningDto {
+    private Integer id;
+    private String remark;
+
+}

+ 11 - 0
src/main/java/com/template/model/dto/WarningSavePushDto.java

@@ -0,0 +1,11 @@
+package com.template.model.dto;
+
+import lombok.Data;
+
+import java.util.List;
+
+@Data
+public class WarningSavePushDto {
+    private List<Integer> ids;
+
+}

+ 75 - 0
src/main/java/com/template/model/enumModel/eTimeGroup.java

@@ -0,0 +1,75 @@
+package com.template.model.enumModel;
+
+/**
+ * @Author: binguo
+ * @Date: 2023/7/6 星期四 16:34
+ * @Description: com.template.model.enumModel
+ * @Version: 1.0
+ * 账号状态
+ */
+public enum eTimeGroup {
+    TG1701918449235594(1),//上午时间组 9:00 - 12:00
+    TG1701747145136852(2),//中午时间组 11:50 - 14:00
+    TG1701747243082762(3);//下午时间组 14:30 - 17:00
+
+    private int value;
+
+    eTimeGroup(int value){
+        this.value = value;
+    }
+
+    public int getValue() {
+        return value;
+    }
+    public static eTimeGroup valueOf(int value) {
+        switch (value) {
+            case 1:
+                return eTimeGroup.TG1701918449235594;
+            case 2:
+                return eTimeGroup.TG1701747145136852;
+            case 3:
+                return eTimeGroup.TG1701747243082762;
+            default:
+                return null;
+        }
+    }
+
+    public static Integer integerOf(String value) {
+        switch (value) {
+            case "TG1701918449235594":
+                return 1;
+            case "TG1701747145136852":
+                return 2;
+            case "TG1701747243082762":
+                return 3;
+            default:
+                return null;
+        }
+    }
+
+    public static String stringOf(Integer value) {
+        switch (value) {
+            case 1:
+                return "TG1701918449235594";
+            case 2:
+                return "TG1701747145136852";
+            case 3:
+                return "TG1701747243082762";
+            default:
+                return null;
+        }
+    }
+
+    public static String stringOfName(Integer value) {
+        switch (value) {
+            case 1:
+                return "上午";
+            case 2:
+                return "中午";
+            case 3:
+                return "下午";
+            default:
+                return null;
+        }
+    }
+}

+ 17 - 1
src/main/java/com/template/model/pojo/SmartApply.java

@@ -48,9 +48,25 @@ public class SmartApply implements Serializable {
     private String category;
     private String category;
 
 
     @ApiModelProperty(value = "应用链接")
     @ApiModelProperty(value = "应用链接")
-    @NotBlank(message = "应用链接不能为空")
     private String urlLink;
     private String urlLink;
 
 
+    @ApiModelProperty(value = "简介")
+    private String descript;
+
+    @ApiModelProperty(value = "路径")
+    private String route;
+
+    /**
+     * 是否置顶
+     * 置顶:1
+     * 不置顶:2
+     */
+    @ApiModelProperty(value = "是否置顶")
+    private Integer isTop;
+
+    @ApiModelProperty(value = "appid")
+    private String appid;
+
     @ApiModelProperty(value = "创建时间")
     @ApiModelProperty(value = "创建时间")
     @TableField(fill = FieldFill.INSERT)
     @TableField(fill = FieldFill.INSERT)
     private Date createTime;
     private Date createTime;

+ 79 - 0
src/main/java/com/template/model/pojo/SmartFaceDiscern.java

@@ -0,0 +1,79 @@
+package com.template.model.pojo;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import java.util.Date;
+import com.baomidou.mybatisplus.annotation.Version;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.FieldFill;
+import com.baomidou.mybatisplus.annotation.TableLogic;
+import com.baomidou.mybatisplus.annotation.TableField;
+import java.io.Serializable;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.experimental.Accessors;
+
+/**
+ * <p>
+ * 
+ * </p>
+ *
+ * @author ceshi
+ * @since 2024-01-18
+ */
+@Data
+@EqualsAndHashCode(callSuper = false)
+@Accessors(chain = true)
+@ApiModel(value="SmartFaceDiscern对象", description="")
+public class SmartFaceDiscern implements Serializable {
+
+    private static final long serialVersionUID = 1L;
+
+    @TableId(value = "id", type = IdType.AUTO)
+    private Integer id;
+
+    @ApiModelProperty(value = "名字")
+    private String name;
+
+    @ApiModelProperty(value = "用户ID")
+    private Integer userId;
+
+    @ApiModelProperty(value = "类型")
+    private String type;
+
+    @ApiModelProperty(value = "地点")
+    private String location;
+
+    @ApiModelProperty(value = "图片")
+    private String image;
+
+    @ApiModelProperty(value = "备注")
+    private String remark;
+
+    @ApiModelProperty(value = "发生时间")
+    private String dateTime;
+
+    @ApiModelProperty(value = "创建时间")
+    @TableField(fill = FieldFill.INSERT)
+    private Date createTime;
+
+    @ApiModelProperty(value = "更新时间")
+    @TableField(fill = FieldFill.INSERT_UPDATE)
+    private Date updateTime;
+
+    @ApiModelProperty(value = "创建人员")
+    @TableField(fill = FieldFill.INSERT)
+    private String createUser;
+
+    @ApiModelProperty(value = "更新人员")
+    @TableField(fill = FieldFill.INSERT_UPDATE)
+    private String updateUser;
+
+    @ApiModelProperty(value = "逻辑删除 未删除:0;删除:1")
+    @TableField(fill = FieldFill.INSERT)
+    @TableLogic
+    private Integer deleted;
+
+
+}

+ 68 - 0
src/main/java/com/template/model/pojo/SmartQrcode.java

@@ -0,0 +1,68 @@
+package com.template.model.pojo;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import java.util.Date;
+import com.baomidou.mybatisplus.annotation.Version;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.FieldFill;
+import com.baomidou.mybatisplus.annotation.TableLogic;
+import com.baomidou.mybatisplus.annotation.TableField;
+import java.io.Serializable;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.experimental.Accessors;
+
+/**
+ * <p>
+ * 楼栋表
+ * </p>
+ *
+ * @author ceshi
+ * @since 2024-01-18
+ */
+@Data
+@EqualsAndHashCode(callSuper = false)
+@Accessors(chain = true)
+@ApiModel(value="SmartQrcode对象", description="楼栋表")
+public class SmartQrcode implements Serializable {
+
+    private static final long serialVersionUID = 1L;
+
+    @ApiModelProperty(value = "主键ID")
+    @TableId(value = "id", type = IdType.AUTO)
+    private Integer id;
+
+    @ApiModelProperty(value = "用户ID")
+    private Integer userId;
+
+    @ApiModelProperty(value = "原始码记录")
+    private String sourceCode;
+
+    @ApiModelProperty(value = "刷码成功或失败 成功:1  失败:2")
+    private Integer isSuccess;
+
+    @ApiModelProperty(value = "创建时间")
+    @TableField(fill = FieldFill.INSERT)
+    private Date createTime;
+
+    @ApiModelProperty(value = "更新时间")
+    @TableField(fill = FieldFill.INSERT_UPDATE)
+    private Date updateTime;
+
+    @ApiModelProperty(value = "创建人员")
+    @TableField(fill = FieldFill.INSERT)
+    private String createUser;
+
+    @ApiModelProperty(value = "更新人员")
+    @TableField(fill = FieldFill.INSERT_UPDATE)
+    private String updateUser;
+
+    @ApiModelProperty(value = "逻辑删除 未删除:0;删除:1")
+    @TableField(fill = FieldFill.INSERT)
+    @TableLogic
+    private Integer deleted;
+
+
+}

+ 6 - 0
src/main/java/com/template/model/pojo/SmartScore.java

@@ -40,9 +40,15 @@ public class SmartScore implements Serializable {
     @ApiModelProperty(value = "年级")
     @ApiModelProperty(value = "年级")
     private String grade;
     private String grade;
 
 
+    @ApiModelProperty(value = "年级ID")
+    private Integer gradeId;
+
     @ApiModelProperty(value = "班级")
     @ApiModelProperty(value = "班级")
     private String schoolClass;
     private String schoolClass;
 
 
+    @ApiModelProperty(value = "班级Id")
+    private Integer schoolClassId;
+
     @ApiModelProperty(value = "卡号")
     @ApiModelProperty(value = "卡号")
     private String cardNo;
     private String cardNo;
 
 

+ 12 - 0
src/main/java/com/template/model/pojo/SmartUser.java

@@ -37,6 +37,9 @@ public class SmartUser implements Serializable {
     @ApiModelProperty(value = "编号(学号)")
     @ApiModelProperty(value = "编号(学号)")
     private String cardNo;
     private String cardNo;
 
 
+    @ApiModelProperty(value = "时间组")
+    private Integer timeGroupId;
+
     @ApiModelProperty(value = "姓名")
     @ApiModelProperty(value = "姓名")
     private String name;
     private String name;
 
 
@@ -97,12 +100,21 @@ public class SmartUser implements Serializable {
     @ApiModelProperty(value = "职务")
     @ApiModelProperty(value = "职务")
     private Integer duties;
     private Integer duties;
 
 
+    @ApiModelProperty(value = "是否推送公众号信息  不推送:0 推送:1")
+    private Integer isPush;
+
     @ApiModelProperty(value = "是否注销  未注销:0  注销:1")
     @ApiModelProperty(value = "是否注销  未注销:0  注销:1")
     private Integer isCancel;
     private Integer isCancel;
 
 
     @ApiModelProperty(value = "微信openId")
     @ApiModelProperty(value = "微信openId")
     private String openId;
     private String openId;
 
 
+    @ApiModelProperty(value = "小程序openId")
+    private String xOpenId;
+
+    @ApiModelProperty(value = "公众号openId")
+    private String gzhOpenId;
+
     @ApiModelProperty(value = "希沃学生UID")
     @ApiModelProperty(value = "希沃学生UID")
     private String xwStudentUid;
     private String xwStudentUid;
 
 

+ 3 - 0
src/main/java/com/template/model/pojo/SmartVisitor.java

@@ -95,6 +95,9 @@ public class SmartVisitor implements Serializable {
     @ApiModelProperty(value = "访客类型")
     @ApiModelProperty(value = "访客类型")
     private Integer visitorType;
     private Integer visitorType;
 
 
+    @ApiModelProperty(value = "百胜预约订单号")
+    private String bsOrderNo;
+
     @ApiModelProperty(value = "创建时间")
     @ApiModelProperty(value = "创建时间")
     @TableField(fill = FieldFill.INSERT)
     @TableField(fill = FieldFill.INSERT)
     private Date createTime;
     private Date createTime;

+ 5 - 2
src/main/java/com/template/model/pojo/SmartWarning.java

@@ -34,8 +34,8 @@ public class SmartWarning implements Serializable {
     @TableId(value = "id", type = IdType.AUTO)
     @TableId(value = "id", type = IdType.AUTO)
     private Integer id;
     private Integer id;
 
 
-    @ApiModelProperty(value = "用户ID")
-    private Integer userId;
+    @ApiModelProperty("预警人姓名")
+    private String warningName;
 
 
     @ApiModelProperty(value = "类型")
     @ApiModelProperty(value = "类型")
     private String type;
     private String type;
@@ -52,6 +52,9 @@ public class SmartWarning implements Serializable {
     @ApiModelProperty(value = "状态 未处理:0 已处理:1 已推送:2")
     @ApiModelProperty(value = "状态 未处理:0 已处理:1 已推送:2")
     private Integer statu;
     private Integer statu;
 
 
+    @ApiModelProperty(value = "发生时间")
+    private String dateTime;
+
     @ApiModelProperty(value = "创建时间")
     @ApiModelProperty(value = "创建时间")
     @TableField(fill = FieldFill.INSERT)
     @TableField(fill = FieldFill.INSERT)
     private Date createTime;
     private Date createTime;

+ 6 - 18
src/main/java/com/template/model/pojo/SmsCode.java

@@ -10,25 +10,13 @@ import lombok.Data;
 import lombok.EqualsAndHashCode;
 import lombok.EqualsAndHashCode;
 import lombok.experimental.Accessors;
 import lombok.experimental.Accessors;
 
 
-/**
- * <p>
- *
- * </p>
- *
- * @author ceshi
- * @since 2023-04-20
- */
 @Data
 @Data
 @EqualsAndHashCode(callSuper = false)
 @EqualsAndHashCode(callSuper = false)
 @Accessors(chain = true)
 @Accessors(chain = true)
-@ApiModel(value="SmsCode对象", description="")
-public class SmsCode implements Serializable {
+@ApiModel(value="smartSubjectRule", description="")
+public class SmsCode {
 
 
-    private static final long serialVersionUID = 1L;
-
-    @ApiModelProperty(value = "主键ID")
-    @TableId(value = "id", type = IdType.ID_WORKER)
-    private Long id;
+    public Long id;
 
 
     @ApiModelProperty(value = "手机号")
     @ApiModelProperty(value = "手机号")
     private String phoneNumber;
     private String phoneNumber;
@@ -52,15 +40,15 @@ public class SmsCode implements Serializable {
 
 
     @TableField(fill = FieldFill.INSERT)
     @TableField(fill = FieldFill.INSERT)
     @ApiModelProperty(value = "创建人员")
     @ApiModelProperty(value = "创建人员")
-    private Long createUser;
+    private String createUser;
 
 
     @TableField(fill = FieldFill.INSERT_UPDATE)
     @TableField(fill = FieldFill.INSERT_UPDATE)
     @ApiModelProperty(value = "更新人员")
     @ApiModelProperty(value = "更新人员")
-    private Long updateUser;
+    private String updateUser;
 
 
     @ApiModelProperty(value = "逻辑删除标记")
     @ApiModelProperty(value = "逻辑删除标记")
     @TableLogic
     @TableLogic
-    private Long deleted;
+    private Integer deleted;
 
 
 
 
 }
 }

+ 42 - 0
src/main/java/com/template/model/request/bindStudentRequest.java

@@ -0,0 +1,42 @@
+package com.template.model.request;
+
+import lombok.Data;
+
+import javax.validation.constraints.NotBlank;
+import javax.validation.constraints.NotNull;
+
+/**
+ * <p>
+ *
+ * </p>
+ *
+ * @author ceshi
+ * @since 2023-12-04
+ */
+@Data
+public class bindStudentRequest {
+
+    /**
+     * 用户ID
+     */
+    @NotNull(message = "用户ID不能为空")
+    private Integer userId;
+
+    /**
+     * 学生名称
+     */
+    @NotBlank(message = "学生名称不能为空")
+    private String name;
+
+    /**
+     * 编号
+     */
+    @NotBlank(message = "编号不能为空")
+    private String cardNo;
+
+    /**
+     * 身份证号
+     */
+    @NotBlank(message = "身份证号不能为空")
+    private String idCard;
+}

+ 12 - 0
src/main/java/com/template/model/request/insertScoreRequest.java

@@ -20,12 +20,24 @@ public class insertScoreRequest {
     private String semester;
     private String semester;
 
 
     /**
     /**
+     * 年级ID
+     */
+    @NotNull(message = "年级ID不能为空")
+    private Integer gradeId;
+
+    /**
      * 年级
      * 年级
      */
      */
     @NotBlank(message = "年级不能为空")
     @NotBlank(message = "年级不能为空")
     private String grade;
     private String grade;
 
 
     /**
     /**
+     * 班级ID
+     */
+    @NotNull(message = "班级ID不能为空")
+    private Integer schoolClassId;
+
+    /**
      * 班级
      * 班级
      */
      */
     @NotBlank(message = "班级不能为空")
     @NotBlank(message = "班级不能为空")

+ 6 - 0
src/main/java/com/template/model/request/insertSmartUserRequest.java

@@ -20,6 +20,12 @@ import java.util.List;
 public class insertSmartUserRequest {
 public class insertSmartUserRequest {
 
 
     /**
     /**
+     * 时间组ID
+     */
+    @NotNull(message = "时间组ID不能为空")
+    private Integer timeGroupId;
+
+    /**
      * 编号
      * 编号
      */
      */
     @NotBlank(message = "编号不能为空")
     @NotBlank(message = "编号不能为空")

+ 33 - 0
src/main/java/com/template/model/request/turnOnTheDeviceRequest.java

@@ -0,0 +1,33 @@
+package com.template.model.request;
+
+import lombok.Data;
+
+import javax.validation.constraints.NotEmpty;
+import javax.validation.constraints.NotNull;
+import java.util.List;
+
+/**
+ * 修改密码
+ */
+@Data
+public class turnOnTheDeviceRequest {
+    /**
+     * 指令
+     */
+    private String actionName;
+
+    /**
+     * 二维码内容
+     */
+    private String data;
+
+    /**
+     * 设备编号
+     */
+    private String deviceno;
+
+    /**
+     * 版本
+     */
+    private String version;
+}

+ 12 - 0
src/main/java/com/template/model/request/updateScoreRequest.java

@@ -27,12 +27,24 @@ public class updateScoreRequest {
     private String semester;
     private String semester;
 
 
     /**
     /**
+     * 年级ID
+     */
+    @NotNull(message = "年级ID不能为空")
+    private Integer gradeId;
+
+    /**
      * 年级
      * 年级
      */
      */
     @NotBlank(message = "年级不能为空")
     @NotBlank(message = "年级不能为空")
     private String grade;
     private String grade;
 
 
     /**
     /**
+     * 班级ID
+     */
+    @NotNull(message = "班级ID不能为空")
+    private Integer schoolClassId;
+
+    /**
      * 班级
      * 班级
      */
      */
     @NotBlank(message = "班级不能为空")
     @NotBlank(message = "班级不能为空")

+ 10 - 4
src/main/java/com/template/model/request/updateSmartUserRequest.java

@@ -20,6 +20,12 @@ import java.util.List;
 public class updateSmartUserRequest {
 public class updateSmartUserRequest {
 
 
     /**
     /**
+     * 时间组ID
+     */
+    @NotNull(message = "时间组ID不能为空")
+    private Integer timeGroupId;
+
+    /**
      * 数据ID
      * 数据ID
      */
      */
     @NotNull(message = "数据ID不能为空")
     @NotNull(message = "数据ID不能为空")
@@ -72,7 +78,7 @@ public class updateSmartUserRequest {
     /**
     /**
      * 年级
      * 年级
      */
      */
-    @NotBlank(message = "年级不能为空")
+    //@NotBlank(message = "年级不能为空")
     private String grade;
     private String grade;
 
 
     /**
     /**
@@ -90,7 +96,7 @@ public class updateSmartUserRequest {
     /**
     /**
      * 班级
      * 班级
      */
      */
-    @NotNull(message = "班级不能为空")
+    //@NotNull(message = "班级不能为空")
     private Integer schoolClass;
     private Integer schoolClass;
 
 
     /**
     /**
@@ -108,7 +114,7 @@ public class updateSmartUserRequest {
     /**
     /**
      * 手机号
      * 手机号
      */
      */
-    @NotBlank(message = "手机号不能为空")
+    //@NotBlank(message = "手机号不能为空")
     private String phone;
     private String phone;
 
 
     /**
     /**
@@ -116,7 +122,7 @@ public class updateSmartUserRequest {
      * 被关联用户的ID
      * 被关联用户的ID
      * 多个用户用逗号隔开
      * 多个用户用逗号隔开
      */
      */
-    @NotEmpty(message = "关联人不能为空")
+    //@NotEmpty(message = "关联人不能为空")
     private List<String> affiliate;
     private List<String> affiliate;
 
 
     /**
     /**

+ 22 - 0
src/main/java/com/template/model/vo/AffiliateParentVo.java

@@ -0,0 +1,22 @@
+package com.template.model.vo;
+
+import lombok.Data;
+
+/**
+ * @Author: binguo
+ * @Date: 2023/12/4 星期一 15:57
+ * @Description: com.template.model.vo
+ * @Version: 1.0
+ */
+@Data
+public class AffiliateParentVo {
+    /**
+     * 数据ID
+     */
+    private Integer id;
+
+    /**
+     * 关联人名称
+     */
+    private String name;
+}

+ 10 - 0
src/main/java/com/template/model/vo/AffiliateUserVo.java

@@ -29,4 +29,14 @@ public class AffiliateUserVo {
      * 部门ID
      * 部门ID
      */
      */
     private Integer departmentId;
     private Integer departmentId;
+
+    /**
+     * 部门名称
+     */
+    private String departmentName;
+
+    /**
+     * 人脸照片
+     */
+    private String headImage;
 }
 }

+ 42 - 0
src/main/java/com/template/model/vo/ApplysVo.java

@@ -0,0 +1,42 @@
+package com.template.model.vo;
+
+import lombok.Data;
+
+/**
+ * @Author: binguo
+ * @Date: 2023/12/4 星期一 15:57
+ * @Description: com.template.model.vo
+ * @Version: 1.0
+ */
+@Data
+public class ApplysVo {
+    /**
+     * 数据ID
+     */
+    private Integer id;
+
+    /**
+     * 应用名称
+     */
+    private String title;
+
+    /**
+     * 图片链接
+     */
+    private String url;
+
+    /**
+     * 应用路径
+     */
+    private String path;
+
+    /**
+     * appid
+     */
+    private String appid;
+
+    /**
+     * 类别
+     */
+    private String category;
+}

+ 18 - 0
src/main/java/com/template/model/vo/BaseImageVo.java

@@ -0,0 +1,18 @@
+package com.template.model.vo;
+
+import lombok.Data;
+
+/**
+ * @Author: binguo
+ * @Date: 2024/1/5 星期五 14:53
+ * @Description: com.template.model.vo
+ * @Version: 1.0
+ */
+@Data
+public class BaseImageVo {
+
+    /**
+     * base64字符串
+     */
+    private String qrcode;
+}

+ 24 - 0
src/main/java/com/template/model/vo/BsReservationVo.java

@@ -0,0 +1,24 @@
+package com.template.model.vo;
+
+import lombok.Data;
+
+/**
+ * @Author: binguo
+ * @Date: 2024/1/5 星期五 14:53
+ * @Description: com.template.model.vo
+ * @Version: 1.0
+ */
+@Data
+public class BsReservationVo {
+
+    private String code;
+
+    private String msg;
+
+    private String rand;
+
+    private BsVisitorVo data;
+
+    private String sign;
+
+}

+ 32 - 0
src/main/java/com/template/model/vo/BsVisitorVo.java

@@ -0,0 +1,32 @@
+package com.template.model.vo;
+
+import lombok.Data;
+
+/**
+ * @Author: binguo
+ * @Date: 2024/1/23 星期二 11:13
+ * @Description: com.template.model.vo
+ * @Version: 1.0
+ */
+@Data
+public class BsVisitorVo {
+    /**
+     * 车场唯一编号
+     */
+    private String parkKey;
+
+    /**
+     * 车牌号码
+     */
+    private String carNo;
+
+    /**
+     * 预约开始时间
+     */
+    private String reserveTime;
+
+    /**
+     * 预约订单号
+     */
+    private String reOrderNo;
+}

+ 29 - 0
src/main/java/com/template/model/vo/IdentityApplyVo.java

@@ -0,0 +1,29 @@
+package com.template.model.vo;
+
+import lombok.Data;
+
+import java.util.List;
+
+/**
+ * @Author: binguo
+ * @Date: 2023/12/4 星期一 15:57
+ * @Description: com.template.model.vo
+ * @Version: 1.0
+ */
+@Data
+public class IdentityApplyVo {
+    /**
+     * 身份ID
+     */
+    private Integer id;
+
+    /**
+     * 身份名称
+     */
+    private String identityName;
+
+    /**
+     * 应用名称集合
+     */
+    private List<String> applyName;
+}

+ 27 - 0
src/main/java/com/template/model/vo/QrcodeImageVo.java

@@ -0,0 +1,27 @@
+package com.template.model.vo;
+
+import lombok.Data;
+
+/**
+ * @Author: binguo
+ * @Date: 2024/1/18 星期四 18:01
+ * @Description: com.template.model.vo
+ * @Version: 1.0
+ */
+@Data
+public class QrcodeImageVo {
+    /**
+     * 数据ID
+     */
+    private Integer id;
+
+    /**
+     * 手机号
+     */
+    private String phone;
+
+    /**
+     * 时间
+     */
+    private String timestamp;
+}

+ 10 - 0
src/main/java/com/template/model/vo/ScorePageVo.java

@@ -26,11 +26,21 @@ public class ScorePageVo {
     private String grade;
     private String grade;
 
 
     /**
     /**
+     * 年级ID
+     */
+    private String gradeId;
+
+    /**
      * 班级
      * 班级
      */
      */
     private String schoolClass;
     private String schoolClass;
 
 
     /**
     /**
+     * 班级ID
+     */
+    private String schoolClassId;
+
+    /**
      * 学科
      * 学科
      */
      */
     private Integer subjectId;
     private Integer subjectId;

+ 10 - 0
src/main/java/com/template/model/vo/ScoreVo.java

@@ -26,11 +26,21 @@ public class ScoreVo {
     private String grade;
     private String grade;
 
 
     /**
     /**
+     * 年级ID
+     */
+    private String gradeId;
+
+    /**
      * 班级
      * 班级
      */
      */
     private String schoolClass;
     private String schoolClass;
 
 
     /**
     /**
+     * 班级ID
+     */
+    private String schoolClassId;
+
+    /**
      * 学科ID
      * 学科ID
      */
      */
     private Integer subject;
     private Integer subject;

+ 48 - 0
src/main/java/com/template/model/vo/SmartClassPageVo.java

@@ -0,0 +1,48 @@
+package com.template.model.vo;
+
+import lombok.Data;
+
+/**
+ * @Author: binguo
+ * @Date: 2023/12/4 星期一 15:57
+ * @Description: com.template.model.vo
+ * @Version: 1.0
+ */
+@Data
+public class SmartClassPageVo {
+    /**
+     * 数据ID
+     */
+    private Integer id;
+
+    /**
+     * 年级ID
+     */
+    private Integer gradeId;
+
+    /**
+     * 年级
+     */
+    private String gradeStr;
+
+    /**
+     * 年级uid
+     */
+    private String classUid;
+
+    /**
+     * 班级名称
+     */
+    private String name;
+
+    /**
+     * 班级序号
+     */
+    private Integer classNo;
+
+    /**
+     * 百胜班级序号
+     */
+    private String bsClassNo;
+
+}

+ 26 - 0
src/main/java/com/template/model/vo/TimeGroupVo.java

@@ -0,0 +1,26 @@
+package com.template.model.vo;
+
+import lombok.Data;
+
+/**
+ * @Author: binguo
+ * @Date: 2024/1/5 星期五 14:53
+ * @Description: com.template.model.vo
+ * @Version: 1.0
+ */
+@Data
+public class TimeGroupVo {
+
+    /**
+     * 数据ID
+     */
+    private Integer id;
+
+    /**
+     * 时间组名称
+     * G1701918449235594(1),//上午时间组 9:00 - 12:00
+     * TG1701747145136852(2),//中午时间组 11:50 - 14:00
+     * TG1701747243082762(3);//下午时间组 14:30 - 17:00
+     */
+    private String name;
+}

+ 28 - 0
src/main/java/com/template/model/vo/TurnOnDeviceVo.java

@@ -0,0 +1,28 @@
+package com.template.model.vo;
+
+import lombok.Data;
+
+/**
+ * @Author: binguo
+ * @Date: 2023/12/4 星期一 15:57
+ * @Description: com.template.model.vo
+ * @Version: 1.0
+ */
+@Data
+public class TurnOnDeviceVo {
+    /**
+     * 返回状态:
+     * 成功开闸:1
+     */
+    private Integer resultcode;
+
+    /**
+     * 返回信息
+     */
+    private String message;
+
+    /**
+     * 指令
+     */
+    private String actionName;
+}

+ 18 - 0
src/main/java/com/template/model/vo/UserVo.java

@@ -1,5 +1,6 @@
 package com.template.model.vo;
 package com.template.model.vo;
 
 
+import com.template.model.enumModel.eTimeGroup;
 import lombok.Data;
 import lombok.Data;
 
 
 import java.util.List;
 import java.util.List;
@@ -148,4 +149,21 @@ public class UserVo {
      */
      */
     private String duties;
     private String duties;
 
 
+    /**
+     * 时间组
+     */
+    private Integer timeGroupId;
+
+    /**
+     * 时间组名称
+     */
+    private String timeGroupName;
+
+    public String getTimeGroupName() {
+        return timeGroupId == null ? timeGroupName : eTimeGroup.stringOfName(timeGroupId);
+    }
+
+    public void setTimeGroupName(String timeGroupName) {
+        this.timeGroupName = timeGroupName;
+    }
 }
 }

+ 63 - 5
src/main/java/com/template/model/vo/VisitorPageVo.java

@@ -25,14 +25,34 @@ public class VisitorPageVo {
     private Integer userId;
     private Integer userId;
 
 
     /**
     /**
-     * 用户名称
+     * 访客姓名
      */
      */
     private String userName;
     private String userName;
 
 
     /**
     /**
-     * 提交时间
+     * 访客手机号
      */
      */
-    private Date createTime;
+    private String userPhone;
+
+    /**
+     * 访客证件号
+     */
+    private String userNumber;
+
+    /**
+     * 同行人数
+     */
+    private Integer peerNum;
+
+    /**
+     * 车牌号
+     */
+    private String carNum;
+
+    /**
+     * 访问事由
+     */
+    private String visitReason;
 
 
     /**
     /**
      * 数据状态
      * 数据状态
@@ -62,7 +82,45 @@ public class VisitorPageVo {
     private Date visitorTime;
     private Date visitorTime;
 
 
     /**
     /**
-     * 访问事由
+     * 来访截止时间
      */
      */
-    private String visitReason;
+    private Date visitorDeadline;
+
+    /**
+     * 受访者ID
+     */
+    private Integer respondent;
+
+    /**
+     * 受访者编号
+     */
+    private String responcode;
+
+    /**
+     * 部门ID
+     */
+    private Integer departmentId;
+
+    /**
+     * 受访者电话
+     */
+    private String respondentPhone;
+
+    /**
+     * 受访者姓名
+     */
+    private String respondentName;
+
+    /**
+     * 访客类型
+     * 家长:1
+     * 其他:2
+     */
+    private Integer visitorType;
+
+    /**
+     * 提交时间
+     */
+    private Date createTime;
+
 }
 }

+ 202 - 0
src/main/java/com/template/model/vo/WechatUserVo.java

@@ -0,0 +1,202 @@
+package com.template.model.vo;
+
+import com.baomidou.mybatisplus.annotation.*;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.experimental.Accessors;
+
+import java.io.Serializable;
+import java.util.Date;
+
+/**
+ * <p>
+ *
+ * </p>
+ *
+ * @author ceshi
+ * @since 2023-12-04
+ */
+@Data
+@EqualsAndHashCode(callSuper = false)
+@Accessors(chain = true)
+public class WechatUserVo implements Serializable {
+    /**
+     * 数据ID
+     */
+    private Integer id;
+
+    /**
+     * 编号(学号)
+     */
+    private String cardNo;
+
+    /**
+     * 时间组
+     */
+    private Integer timeGroupId;
+
+    /**
+     * 姓名
+     */
+    private String name;
+
+    /**
+     * 身份ID
+     */
+    private Integer identityId;
+
+    /**
+     * 身份证号
+     */
+    private String idCard;
+
+    /**
+     * 性别
+     * 女:0
+     * 男:1
+     */
+    private Integer sexId;
+
+    /**
+     * 部门ID
+     */
+    private Integer departmentId;
+
+    /**
+     * 部门
+     */
+    private String departmentName;
+
+    /**
+     * 人脸照片
+     */
+    private String headImage;
+
+    /**
+     * 年级
+     */
+    private String grade;
+
+    /**
+     * 学院
+     */
+    private String college;
+
+    /**
+     * 专业
+     */
+    private String speciality;
+
+    /**
+     * 班级
+     */
+    private Integer schoolClass;
+
+    /**
+     * 校区
+     */
+    private String campus;
+
+    /**
+     * 宿舍号
+     */
+    private String dormitoryNumber;
+
+    /**
+     * 手机号
+     */
+    private String phone;
+
+    /**
+     * 关联人
+     * 被关联用户的ID 多个用户用逗号隔开
+     */
+    private String affiliate;
+
+    /**
+     * 关联人名称
+     */
+    private String affiliateName;
+
+    /**
+     * 职称
+     */
+    private String title;
+
+    /**
+     * 家庭住址
+     */
+    private String address;
+
+    /**
+     * 民族
+     */
+    private String nation;
+
+    /**
+     * 生源地
+     */
+    private String ofStudent;
+
+    /**
+     * 毕业学校
+     */
+    private String graduate;
+
+    /**
+     * 职务
+     */
+    private Integer duties;
+
+    /**
+     * 是否推送公众号消息
+     * 不推送:0
+     * 推送:1
+     */
+    private Integer isPush;
+
+    /**
+     * 是否注销
+     * 未注销:0
+     * 注销:1
+     */
+    private Integer isCancel;
+
+    /**
+     * 微信openId
+     */
+    private String openId;
+
+    /**
+     * 小程序openId
+     */
+    private String xOpenId;
+
+    /**
+     * 公众号openId
+     */
+    private String gzhOpenId;
+
+    /**
+     * 希沃学生UID
+     */
+    private String xwStudentUid;
+
+    /**
+     * 百胜学生编号
+     */
+    private String bsStudentNo;
+
+    /**
+     * 希沃教师工号
+     */
+    private String xwTeacherCode;
+
+    /**
+     * 百胜教师编号
+     */
+    private String bsStaffCode;
+
+}

+ 17 - 0
src/main/java/com/template/model/vo/qrCodeVo.java

@@ -0,0 +1,17 @@
+package com.template.model.vo;
+
+import lombok.Data;
+
+/**
+ * @Author: binguo
+ * @Date: 2023/12/4 星期一 15:57
+ * @Description: com.template.model.vo
+ * @Version: 1.0
+ */
+@Data
+public class qrCodeVo {
+    /**
+     * 二维码内容
+     */
+    private String qrCode;
+}

+ 6 - 0
src/main/java/com/template/model/weixin/HttpParame.java

@@ -13,6 +13,12 @@ public class HttpParame {
 	// 密匙
 	// 密匙
 	public static final String SECRET = "secret";
 	public static final String SECRET = "secret";
 
 
+	// 应用唯一标识
+	public static final String APPIDX = "appidx";
+
+	// 密匙
+	public static final String SECRETX = "secretx";
+
 	// 微信用户唯一标识
 	// 微信用户唯一标识
 	public static final String OPENID = "openid";
 	public static final String OPENID = "openid";
 
 

+ 2 - 0
src/main/java/com/template/services/SmartApplyService.java

@@ -30,4 +30,6 @@ public interface SmartApplyService extends IService<SmartApply> {
     int deleteSmartApplyById(int id);
     int deleteSmartApplyById(int id);
 
 
     SmartApply getSmartById(int id);
     SmartApply getSmartById(int id);
+
+    List<SmartApply> queryAppletApplys();
 }
 }

+ 0 - 0
src/main/java/com/template/services/SmartClassService.java


برخی فایل ها در این مقایسه diff نمایش داده نمی شوند زیرا تعداد فایل ها بسیار زیاد است