王鑫刚 2 月之前
當前提交
c6c03cae90
共有 100 個文件被更改,包括 10670 次插入0 次删除
  1. 39 0
      .gitignore
  2. 48 0
      pom.xml
  3. 274 0
      yqk-common/pom.xml
  4. 68 0
      yqk-common/src/main/java/com/yx/face/boot/CustomApiModelPropertyPositionBuilder.java
  5. 30 0
      yqk-common/src/main/java/com/yx/face/boot/DateDeserialize.java
  6. 26 0
      yqk-common/src/main/java/com/yx/face/boot/LocalDateDeserialize.java
  7. 23 0
      yqk-common/src/main/java/com/yx/face/boot/LocalDateSerializer.java
  8. 17 0
      yqk-common/src/main/java/com/yx/face/boot/component/security/Authority.java
  9. 94 0
      yqk-common/src/main/java/com/yx/face/boot/component/security/JWTUtils.java
  10. 18 0
      yqk-common/src/main/java/com/yx/face/boot/component/security/SessionUtils.java
  11. 51 0
      yqk-common/src/main/java/com/yx/face/boot/core/BaseController.java
  12. 55 0
      yqk-common/src/main/java/com/yx/face/boot/core/Constants.java
  13. 126 0
      yqk-common/src/main/java/com/yx/face/boot/core/GlobalExceptionHandler.java
  14. 203 0
      yqk-common/src/main/java/com/yx/face/boot/core/SnowflakeIdWorker.java
  15. 15 0
      yqk-common/src/main/java/com/yx/face/boot/handle/IntegerTypeHandler.java
  16. 58 0
      yqk-common/src/main/java/com/yx/face/boot/handle/ListTypeHandler.java
  17. 50 0
      yqk-common/src/main/java/com/yx/face/boot/restful/CommonException.java
  18. 49 0
      yqk-common/src/main/java/com/yx/face/boot/restful/RestCode.java
  19. 64 0
      yqk-common/src/main/java/com/yx/face/boot/restful/RestDTO.java
  20. 47 0
      yqk-common/src/main/java/com/yx/face/boot/restful/RestResponse.java
  21. 72 0
      yqk-common/src/main/java/com/yx/face/boot/restful/RestResult.java
  22. 38 0
      yqk-common/src/main/java/com/yx/face/boot/restful/ScanCodeRestCode.java
  23. 44 0
      yqk-common/src/main/java/com/yx/face/boot/restful/ServiceException.java
  24. 87 0
      yqk-common/src/main/java/com/yx/face/boot/uitls/AesUtils.java
  25. 101 0
      yqk-common/src/main/java/com/yx/face/boot/uitls/AppUtils.java
  26. 44 0
      yqk-common/src/main/java/com/yx/face/boot/uitls/ClassUtil.java
  27. 907 0
      yqk-common/src/main/java/com/yx/face/boot/uitls/ConvertUtils.java
  28. 45 0
      yqk-common/src/main/java/com/yx/face/boot/uitls/CookieUtils.java
  29. 77 0
      yqk-common/src/main/java/com/yx/face/boot/uitls/DESUtil.java
  30. 674 0
      yqk-common/src/main/java/com/yx/face/boot/uitls/DateUtils.java
  31. 74 0
      yqk-common/src/main/java/com/yx/face/boot/uitls/DownLoad.java
  32. 28 0
      yqk-common/src/main/java/com/yx/face/boot/uitls/ExcelListenerUtils.java
  33. 141 0
      yqk-common/src/main/java/com/yx/face/boot/uitls/ExcelUtil.java
  34. 74 0
      yqk-common/src/main/java/com/yx/face/boot/uitls/ExcelUtils.java
  35. 56 0
      yqk-common/src/main/java/com/yx/face/boot/uitls/FileUploadUtil.java
  36. 295 0
      yqk-common/src/main/java/com/yx/face/boot/uitls/FileUtils.java
  37. 77 0
      yqk-common/src/main/java/com/yx/face/boot/uitls/HttpUtil.java
  38. 51 0
      yqk-common/src/main/java/com/yx/face/boot/uitls/IDCardEncryptionUtil.java
  39. 30 0
      yqk-common/src/main/java/com/yx/face/boot/uitls/IDGenerateUtils.java
  40. 155 0
      yqk-common/src/main/java/com/yx/face/boot/uitls/IPUtils.java
  41. 245 0
      yqk-common/src/main/java/com/yx/face/boot/uitls/IdcardValidatorUtil.java
  42. 102 0
      yqk-common/src/main/java/com/yx/face/boot/uitls/JsonUtils.java
  43. 299 0
      yqk-common/src/main/java/com/yx/face/boot/uitls/NumUtils.java
  44. 322 0
      yqk-common/src/main/java/com/yx/face/boot/uitls/OkHttpUtils.java
  45. 67 0
      yqk-common/src/main/java/com/yx/face/boot/uitls/PageInfoUtil.java
  46. 18 0
      yqk-common/src/main/java/com/yx/face/boot/uitls/PasswordUtils.java
  47. 65 0
      yqk-common/src/main/java/com/yx/face/boot/uitls/Preconditions.java
  48. 207 0
      yqk-common/src/main/java/com/yx/face/boot/uitls/QRCodeUtil.java
  49. 168 0
      yqk-common/src/main/java/com/yx/face/boot/uitls/RandomUtils.java
  50. 242 0
      yqk-common/src/main/java/com/yx/face/boot/uitls/SMSOrIdCardUtils.java
  51. 125 0
      yqk-common/src/main/java/com/yx/face/boot/uitls/Sm4Util.java
  52. 91 0
      yqk-common/src/main/java/com/yx/face/boot/uitls/StringToHexUtils.java
  53. 244 0
      yqk-common/src/main/java/com/yx/face/boot/uitls/ThumbnailsUtil.java
  54. 27 0
      yqk-common/src/main/java/com/yx/face/boot/uitls/WebAddressUtil.java
  55. 46 0
      yqk-common/src/main/java/com/yx/face/boot/uitls/excel/ExcelIO.java
  56. 115 0
      yqk-common/src/main/java/com/yx/face/boot/uitls/excel/ExcelReader.java
  57. 117 0
      yqk-common/src/main/java/com/yx/face/boot/uitls/excel/ExcelWriter.java
  58. 49 0
      yqk-common/src/main/java/com/yx/face/boot/uitls/excel/JsonUtil.java
  59. 560 0
      yqk-common/src/main/java/com/yx/face/model/entity/Admin.java
  60. 84 0
      yqk-common/src/main/java/com/yx/face/model/entity/AdminAuth.java
  61. 91 0
      yqk-common/src/main/java/com/yx/face/model/entity/AdminData.java
  62. 162 0
      yqk-common/src/main/java/com/yx/face/model/entity/AdminDetail.java
  63. 33 0
      yqk-common/src/main/java/com/yx/face/model/entity/AdminInoutWarnConfig.java
  64. 57 0
      yqk-common/src/main/java/com/yx/face/model/entity/AdminPlaceInfo.java
  65. 34 0
      yqk-common/src/main/java/com/yx/face/model/entity/AdminTag.java
  66. 96 0
      yqk-common/src/main/java/com/yx/face/model/entity/AppointmentPerson.java
  67. 42 0
      yqk-common/src/main/java/com/yx/face/model/entity/AreaCode.java
  68. 40 0
      yqk-common/src/main/java/com/yx/face/model/entity/Base.java
  69. 54 0
      yqk-common/src/main/java/com/yx/face/model/entity/BussinessNumber.java
  70. 100 0
      yqk-common/src/main/java/com/yx/face/model/entity/DisinfectArea.java
  71. 124 0
      yqk-common/src/main/java/com/yx/face/model/entity/DisinfectRecord.java
  72. 76 0
      yqk-common/src/main/java/com/yx/face/model/entity/DisinfectUser.java
  73. 54 0
      yqk-common/src/main/java/com/yx/face/model/entity/DownFaceNew.java
  74. 119 0
      yqk-common/src/main/java/com/yx/face/model/entity/DragonAuth.java
  75. 126 0
      yqk-common/src/main/java/com/yx/face/model/entity/ExamUserWhitelist.java
  76. 177 0
      yqk-common/src/main/java/com/yx/face/model/entity/FaceDevice.java
  77. 41 0
      yqk-common/src/main/java/com/yx/face/model/entity/FaceDeviceDetail.java
  78. 38 0
      yqk-common/src/main/java/com/yx/face/model/entity/FaceDeviceLogo.java
  79. 63 0
      yqk-common/src/main/java/com/yx/face/model/entity/FaceDeviceType.java
  80. 255 0
      yqk-common/src/main/java/com/yx/face/model/entity/FaceLog.java
  81. 58 0
      yqk-common/src/main/java/com/yx/face/model/entity/FaceLogDetail.java
  82. 25 0
      yqk-common/src/main/java/com/yx/face/model/entity/FaceLogFrom.java
  83. 97 0
      yqk-common/src/main/java/com/yx/face/model/entity/FacePass.java
  84. 77 0
      yqk-common/src/main/java/com/yx/face/model/entity/FaceRequestLog.java
  85. 75 0
      yqk-common/src/main/java/com/yx/face/model/entity/FaceTask.java
  86. 43 0
      yqk-common/src/main/java/com/yx/face/model/entity/FkjFloorConfig.java
  87. 40 0
      yqk-common/src/main/java/com/yx/face/model/entity/FkjHeartTracking.java
  88. 68 0
      yqk-common/src/main/java/com/yx/face/model/entity/FkjQrcode.java
  89. 32 0
      yqk-common/src/main/java/com/yx/face/model/entity/HealthCode.java
  90. 82 0
      yqk-common/src/main/java/com/yx/face/model/entity/HealthCodeConfig.java
  91. 37 0
      yqk-common/src/main/java/com/yx/face/model/entity/InOutStatistics.java
  92. 81 0
      yqk-common/src/main/java/com/yx/face/model/entity/IotvspUserInfo.java
  93. 53 0
      yqk-common/src/main/java/com/yx/face/model/entity/IssuedTaskInfo.java
  94. 44 0
      yqk-common/src/main/java/com/yx/face/model/entity/MiddlewareDeviceUser.java
  95. 80 0
      yqk-common/src/main/java/com/yx/face/model/entity/Place.java
  96. 119 0
      yqk-common/src/main/java/com/yx/face/model/entity/PlaceDetail.java
  97. 82 0
      yqk-common/src/main/java/com/yx/face/model/entity/PlaceRecord.java
  98. 73 0
      yqk-common/src/main/java/com/yx/face/model/entity/PoliceStation.java
  99. 49 0
      yqk-common/src/main/java/com/yx/face/model/entity/PrivateArea.java
  100. 55 0
      yqk-common/src/main/java/com/yx/face/model/entity/PrivateAreaDevice.java

+ 39 - 0
.gitignore

@@ -0,0 +1,39 @@
+target/
+!.mvn/wrapper/maven-wrapper.jar
+!**/src/main/**/target/
+!**/src/test/**/target/
+
+### IntelliJ IDEA ###
+.idea/modules.xml
+.idea/jarRepositories.xml
+.idea/compiler.xml
+.idea/libraries/
+*.iws
+*.iml
+*.ipr
+
+### Eclipse ###
+.apt_generated
+.classpath
+.factorypath
+.project
+.settings
+.springBeans
+.sts4-cache
+
+### NetBeans ###
+/nbproject/private/
+/nbbuild/
+/dist/
+/nbdist/
+/.nb-gradle/
+build/
+!**/src/main/**/build/
+!**/src/test/**/build/
+
+### VS Code ###
+.vscode/
+
+### Mac OS ###
+.DS_Store
+/.idea/

+ 48 - 0
pom.xml

@@ -0,0 +1,48 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+    <modelVersion>4.0.0</modelVersion>
+    <!--基础信息-->
+    <groupId>com.yx.face</groupId>
+    <artifactId>nm-yqk</artifactId>
+    <version>1.0-SNAPSHOT</version>
+    <packaging>pom</packaging>
+    <!--父-->
+    <parent>
+        <groupId>org.springframework.boot</groupId>
+        <artifactId>spring-boot-starter-parent</artifactId>
+        <version>2.4.6</version>
+        <relativePath/> <!-- lookup parent from repository -->
+    </parent>
+    <!--子模块-->
+    <modules>
+        <module>yqk-master</module>
+        <module>yqk-common</module>
+        <module>yqk-job</module>
+        <module>yqk-linkage</module>
+    </modules>
+    <!--maven依赖-->
+    <properties>
+        <spring-cloud.version>2020.0.3</spring-cloud.version>
+        <java.version>1.8</java.version>
+    </properties>
+    <dependencies>
+        <dependency>
+            <groupId>org.projectlombok</groupId>
+            <artifactId>lombok</artifactId>
+            <optional>true</optional>
+        </dependency>
+    </dependencies>
+    <dependencyManagement>
+        <dependencies>
+            <dependency>
+                <groupId>org.springframework.cloud</groupId>
+                <artifactId>spring-cloud-dependencies</artifactId>
+                <version>${spring-cloud.version}</version>
+                <type>pom</type>
+                <scope>import</scope>
+            </dependency>
+        </dependencies>
+    </dependencyManagement>
+</project>

+ 274 - 0
yqk-common/pom.xml

@@ -0,0 +1,274 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+    <modelVersion>4.0.0</modelVersion>
+    <parent>
+        <groupId>com.yx.face</groupId>
+        <artifactId>nm-yqk</artifactId>
+        <version>1.0-SNAPSHOT</version>
+    </parent>
+
+    <artifactId>yqk-common</artifactId>
+
+    <dependencies>
+        <dependency>
+            <groupId>org.springframework.boot</groupId>
+            <artifactId>spring-boot-starter-web</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.springframework.cloud</groupId>
+            <artifactId>spring-cloud-starter-openfeign</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.springframework.boot</groupId>
+            <artifactId>spring-boot-starter-validation</artifactId>
+            <exclusions>
+                <exclusion>
+                    <groupId>org.springframework.boot</groupId>
+                    <artifactId>spring-boot-starter</artifactId>
+                </exclusion>
+            </exclusions>
+        </dependency>
+        <dependency>
+            <groupId>org.springframework.boot</groupId>
+            <artifactId>spring-boot-starter-test</artifactId>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.springframework.boot</groupId>
+            <artifactId>spring-boot-starter-aop</artifactId>
+        </dependency>
+        <!--========================【数据库相关依赖】===============================-->
+        <dependency>
+            <groupId>org.springframework.boot</groupId>
+            <artifactId>spring-boot-starter-redis</artifactId>
+            <version>1.4.1.RELEASE</version>
+        </dependency>
+        <!-- ftp相关 -->
+        <dependency>
+            <groupId>commons-net</groupId>
+            <artifactId>commons-net</artifactId>
+            <version>3.6</version>
+        </dependency>
+
+        <dependency>
+            <groupId>org.springframework.boot</groupId>
+            <artifactId>spring-boot-starter-thymeleaf</artifactId>
+            <version>1.5.10.RELEASE</version>
+        </dependency>
+
+        <dependency>
+            <groupId>org.springframework.boot</groupId>
+            <artifactId>spring-boot-starter-amqp</artifactId>
+            <version>1.5.10.RELEASE</version>
+        </dependency>
+
+        <dependency>
+            <groupId>org.mybatis.spring.boot</groupId>
+            <artifactId>mybatis-spring-boot-starter</artifactId>
+            <version>2.1.4</version>
+        </dependency>
+        <dependency>
+            <groupId>mysql</groupId>
+            <artifactId>mysql-connector-java</artifactId>
+            <scope>runtime</scope>
+        </dependency>
+        <dependency>
+            <groupId>com.github.pagehelper</groupId>
+            <artifactId>pagehelper-spring-boot-starter</artifactId>
+            <version>1.3.0</version>
+            <exclusions>
+                <exclusion>
+                    <artifactId>mybatis-spring-boot-starter</artifactId>
+                    <groupId>org.mybatis.spring.boot</groupId>
+                </exclusion>
+            </exclusions>
+        </dependency>
+
+        <dependency>
+            <groupId>tk.mybatis</groupId>
+            <artifactId>mapper-spring-boot-starter</artifactId>
+            <version>2.1.5</version>
+            <exclusions>
+                <exclusion>
+                    <artifactId>mybatis-spring</artifactId>
+                    <groupId>org.mybatis</groupId>
+                </exclusion>
+                <exclusion>
+                    <artifactId>mybatis</artifactId>
+                    <groupId>org.mybatis</groupId>
+                </exclusion>
+                <exclusion>
+                    <artifactId>persistence-api</artifactId>
+                    <groupId>javax.persistence</groupId>
+                </exclusion>
+            </exclusions>
+        </dependency>
+        <dependency>
+            <groupId>jakarta.persistence</groupId>
+            <artifactId>jakarta.persistence-api</artifactId>
+            <version>2.2.3</version>
+        </dependency>
+        <!--========================【工具类相关依赖】===============================-->
+        <dependency>
+            <groupId>commons-io</groupId>
+            <artifactId>commons-io</artifactId>
+            <version>2.8.0</version>
+        </dependency>
+        <dependency>
+            <groupId>org.json</groupId>
+            <artifactId>json</artifactId>
+            <version>20160810</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.commons</groupId>
+            <artifactId>commons-lang3</artifactId>
+            <version>3.12.0</version>
+        </dependency>
+        <dependency>
+            <groupId>commons-codec</groupId>
+            <artifactId>commons-codec</artifactId>
+            <version>1.15</version>
+        </dependency>
+        <dependency>
+            <groupId>com.google.guava</groupId>
+            <artifactId>guava</artifactId>
+            <version>30.1.1-jre</version>
+        </dependency>
+        <dependency>
+            <groupId>commons-httpclient</groupId>
+            <artifactId>commons-httpclient</artifactId>
+            <version>3.1</version>
+            <exclusions>
+                <exclusion>
+                    <groupId>commons-codec</groupId>
+                    <artifactId>commons-codec</artifactId>
+                </exclusion>
+            </exclusions>
+        </dependency>
+        <!--========================【http】===============================-->
+        <!-- https://mvnrepository.com/artifact/cn.hutool/hutool-all -->
+        <dependency>
+            <groupId>cn.hutool</groupId>
+            <artifactId>hutool-all</artifactId>
+            <version>5.7.0</version>
+        </dependency>
+        <dependency>
+            <groupId>com.squareup.okhttp3</groupId>
+            <artifactId>okhttp</artifactId>
+            <version>3.10.0</version>
+        </dependency>
+        <dependency>
+            <groupId>com.alibaba</groupId>
+            <artifactId>fastjson</artifactId>
+            <version>1.2.60</version>
+        </dependency>
+
+        <!--========================【微信对接工具包相关依赖】===============================-->
+        <dependency>
+            <groupId>com.github.binarywang</groupId>
+            <artifactId>weixin-java-miniapp</artifactId>
+            <version>4.0.7.B</version>
+        </dependency>
+        <!--========================【EXCEL相关依赖】===============================-->
+        <dependency>
+            <groupId>com.alibaba</groupId>
+            <artifactId>easyexcel</artifactId>
+            <version>2.2.8</version>
+        </dependency>
+        <!--========================【在线接口文档相关依赖】===============================-->
+        <dependency>
+            <groupId>com.github.xiaoymin</groupId>
+            <artifactId>knife4j-spring-boot-starter</artifactId>
+            <version>3.0.2</version>
+        </dependency>
+        <!--========================【接口安全相关依赖】===============================-->
+        <dependency>
+            <groupId>com.auth0</groupId>
+            <artifactId>java-jwt</artifactId>
+            <version>3.14.0</version>
+        </dependency>
+        <!-- ...............二维码生成器......................................................... -->
+        <dependency>
+            <groupId>com.google.zxing</groupId>
+            <artifactId>core</artifactId>
+            <version>3.3.3</version>
+        </dependency>
+        <dependency>
+            <groupId>com.google.zxing</groupId>
+            <artifactId>javase</artifactId>
+            <version>3.3.3</version>
+        </dependency>
+        <!-- 图片缩略图 -->
+        <dependency>
+            <groupId>net.coobird</groupId>
+            <artifactId>thumbnailator</artifactId>
+            <version>0.4.8</version>
+        </dependency>
+
+        <dependency>
+            <groupId>com.aliyun</groupId>
+            <artifactId>alibaba-dingtalk-service-sdk</artifactId>
+            <version>2.0.0</version>
+        </dependency>
+
+        <!-- 支付宝spi SDK -->
+        <dependency>
+            <groupId>com.alipay.sdk</groupId>
+            <artifactId>alipay-sdk-java</artifactId>
+            <version>4.35.110.ALL</version>
+        </dependency>
+
+        <!--fastjson-->
+        <dependency>
+            <groupId>com.alibaba</groupId>
+            <artifactId>fastjson</artifactId>
+            <version>1.2.74</version>
+        </dependency>
+
+        <dependency>
+            <groupId>org.bouncycastle</groupId>
+            <artifactId>bcprov-jdk15to18</artifactId>
+            <version>1.70</version>
+        </dependency>
+
+
+        <dependency>
+            <groupId>org.springframework.boot</groupId>
+            <artifactId>spring-boot-starter-freemarker</artifactId>
+        </dependency>
+
+        <!-- 配置druid连接池 -->
+        <dependency>
+            <groupId>com.alibaba</groupId>
+            <artifactId>druid-spring-boot-starter</artifactId>
+            <version>1.1.10</version>
+        </dependency>
+
+        <!-- caffeine -->
+        <dependency>
+            <groupId>org.springframework.boot</groupId>
+            <artifactId>spring-boot-starter-cache</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>com.github.ben-manes.caffeine</groupId>
+            <artifactId>caffeine</artifactId>
+            <version>2.7.0</version>
+        </dependency>
+
+        <!--    重试机制     -->
+        <!-- https://mvnrepository.com/artifact/org.springframework.retry/spring-retry -->
+        <dependency>
+            <groupId>org.springframework.retry</groupId>
+            <artifactId>spring-retry</artifactId>
+        </dependency>
+        <!-- https://mvnrepository.com/artifact/org.aspectj/aspectjweaver -->
+        <dependency>
+            <groupId>org.aspectj</groupId>
+            <artifactId>aspectjweaver</artifactId>
+        </dependency>
+
+
+    </dependencies>
+</project>

+ 68 - 0
yqk-common/src/main/java/com/yx/face/boot/CustomApiModelPropertyPositionBuilder.java

@@ -0,0 +1,68 @@
+package com.yx.face.boot;
+
+import com.fasterxml.jackson.databind.introspect.AnnotatedField;
+import com.fasterxml.jackson.databind.introspect.BeanPropertyDefinition;
+import io.swagger.annotations.ApiModelProperty;
+import org.apache.commons.lang3.ArrayUtils;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.springframework.stereotype.Component;
+import springfox.documentation.spi.DocumentationType;
+import springfox.documentation.spi.schema.ModelPropertyBuilderPlugin;
+import springfox.documentation.spi.schema.contexts.ModelPropertyContext;
+import springfox.documentation.swagger.common.SwaggerPluginSupport;
+
+import java.lang.reflect.Field;
+import java.util.Optional;
+
+import static java.util.Optional.empty;
+import static springfox.documentation.schema.Annotations.findPropertyAnnotation;
+import static springfox.documentation.swagger.schema.ApiModelProperties.findApiModePropertyAnnotation;
+
+@Component
+public class CustomApiModelPropertyPositionBuilder implements ModelPropertyBuilderPlugin {
+    private Log log = LogFactory.getLog(getClass());
+
+    @Override
+    public boolean supports(DocumentationType delimiter) {
+        return SwaggerPluginSupport.pluginDoesApply(delimiter);
+    }
+
+    @Override
+    public void apply(ModelPropertyContext context) {
+        Optional<ApiModelProperty> annotation = empty();
+
+        if (context.getAnnotatedElement().isPresent()) {
+            annotation =
+                    annotation.map(Optional::of)
+                            .orElse(findApiModePropertyAnnotation(context.getAnnotatedElement().get()));
+        }
+        if (context.getBeanPropertyDefinition().isPresent()) {
+            annotation = annotation.map(Optional::of).orElse(findPropertyAnnotation(
+                    context.getBeanPropertyDefinition().get(),
+                    ApiModelProperty.class));
+        }
+        Optional<BeanPropertyDefinition> beanPropertyDefinitionOpt = context.getBeanPropertyDefinition();
+        if (annotation.isPresent() && beanPropertyDefinitionOpt.isPresent()) {
+            BeanPropertyDefinition beanPropertyDefinition = beanPropertyDefinitionOpt.get();
+            /*获取到注解字段*/
+            AnnotatedField field = beanPropertyDefinition.getField();
+            /*获取到字段所在的类*/
+            Class clazz = field.getDeclaringClass();
+            /*获取类中所有字段*/
+            Field[] declaredFields = clazz.getDeclaredFields();
+            Field declaredField;
+            /*获取当前字段的Field*/
+            try {
+                declaredField = clazz.getDeclaredField(field.getName());
+            } catch (NoSuchFieldException | SecurityException e) {
+                log.error("", e);
+                return;
+            }
+            /*获取当前字段在数组中的位置。然后设置position属性*/
+            int indexOf = ArrayUtils.indexOf(declaredFields, declaredField);
+            if (indexOf != -1) context.getBuilder().position(indexOf);
+        }
+    }
+}
+

+ 30 - 0
yqk-common/src/main/java/com/yx/face/boot/DateDeserialize.java

@@ -0,0 +1,30 @@
+package com.yx.face.boot;
+
+import cn.hutool.core.date.DateUtil;
+import com.fasterxml.jackson.core.JsonParser;
+import com.fasterxml.jackson.databind.DeserializationContext;
+import com.fasterxml.jackson.databind.JsonDeserializer;
+import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
+
+import java.io.IOException;
+import java.util.Date;
+
+/**
+ * @description:
+ * @ClassName LocalDateDeserialize
+ * @Author WXG
+ * @Date 2023/12/25 10:47
+ */
+@JsonDeserialize
+public class DateDeserialize extends JsonDeserializer<Date> {
+    public static DateDeserialize instance = new DateDeserialize();
+
+    @Override
+    public Date deserialize(JsonParser jsonParser, DeserializationContext ctxt) throws IOException {
+        String dateTime = jsonParser.readValueAs(String.class);
+        //解析Json
+        return DateUtil.parse(dateTime);
+    }
+
+
+}

+ 26 - 0
yqk-common/src/main/java/com/yx/face/boot/LocalDateDeserialize.java

@@ -0,0 +1,26 @@
+package com.yx.face.boot;
+
+import com.fasterxml.jackson.core.JsonParser;
+import com.fasterxml.jackson.databind.DeserializationContext;
+import com.fasterxml.jackson.databind.JsonDeserializer;
+
+import java.io.IOException;
+import java.time.LocalDateTime;
+import java.time.format.DateTimeFormatter;
+
+/**
+ * @description:
+ * @ClassName LocalDateDeserialize
+ * @Author WXG
+ * @Date 2023/12/25 10:47
+ */
+public class LocalDateDeserialize extends JsonDeserializer<LocalDateTime> {
+    @Override
+    public LocalDateTime deserialize(JsonParser jsonParser, DeserializationContext ctxt) throws IOException {
+        String dateTime = jsonParser.readValueAs(String.class);
+        //解析Json
+        return LocalDateTime.parse(dateTime, DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"));
+    }
+
+
+}

+ 23 - 0
yqk-common/src/main/java/com/yx/face/boot/LocalDateSerializer.java

@@ -0,0 +1,23 @@
+//
+// Source code recreated from a .class file by IntelliJ IDEA
+// (powered by FernFlower decompiler)
+//
+
+package com.yx.face.boot;
+
+import com.fasterxml.jackson.core.JsonGenerator;
+import com.fasterxml.jackson.databind.JsonSerializer;
+import com.fasterxml.jackson.databind.SerializerProvider;
+import org.springframework.boot.jackson.JsonComponent;
+
+import java.io.IOException;
+import java.time.LocalDateTime;
+import java.time.format.DateTimeFormatter;
+
+@JsonComponent
+public class LocalDateSerializer extends JsonSerializer<LocalDateTime> {
+    public void serialize(LocalDateTime date, JsonGenerator g, SerializerProvider provider) throws IOException {
+        g.writeString(date.format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss")));
+    }
+
+}

+ 17 - 0
yqk-common/src/main/java/com/yx/face/boot/component/security/Authority.java

@@ -0,0 +1,17 @@
+package com.yx.face.boot.component.security;
+
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+
+@Target({ElementType.TYPE, ElementType.METHOD})
+@Retention(RetentionPolicy.RUNTIME)
+public @interface Authority {
+    //
+    boolean required() default true;
+
+    int[] value() default {0};
+
+
+}

+ 94 - 0
yqk-common/src/main/java/com/yx/face/boot/component/security/JWTUtils.java

@@ -0,0 +1,94 @@
+package com.yx.face.boot.component.security;
+
+import com.auth0.jwt.JWT;
+import com.auth0.jwt.JWTVerifier;
+import com.auth0.jwt.algorithms.Algorithm;
+import com.auth0.jwt.exceptions.JWTDecodeException;
+import com.auth0.jwt.exceptions.JWTVerificationException;
+import com.auth0.jwt.interfaces.DecodedJWT;
+import com.yx.face.boot.restful.CommonException;
+import com.yx.face.boot.restful.RestCode;
+import com.yx.face.boot.uitls.DateUtils;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.util.DigestUtils;
+
+import java.util.Date;
+
+@Slf4j
+public class JWTUtils {
+
+    private final static String SALT = "YcYp65l;uq234pwb;iIjHg872S-ajfL.khp636";
+
+    /**
+     * 校验token是否正确
+     *
+     * @param token 密钥
+     * @param phone 用户的密码
+     */
+    public static void verify(String token, String userId, String phone) {
+        try {
+            String secret = DigestUtils.md5DigestAsHex(phone.concat(SALT).getBytes());
+            Algorithm algorithm = Algorithm.HMAC256(secret);
+            JWTVerifier verifier = JWT.require(algorithm)
+                    .withClaim("userId", userId)
+                    .build();
+            verifier.verify(token);
+        } catch (JWTVerificationException e) {
+            throw new CommonException(RestCode.UNAUTHORIZED.getCode(), e.getMessage());
+        }
+    }
+
+    /**
+     * 获得token中的信息无需secret解密也能获得
+     *
+     * @return token中包含的用户名
+     */
+    public static String getUserId(String token) {
+        try {
+            DecodedJWT jwt = JWT.decode(token);
+            return jwt.getClaim("userId").asString();
+        } catch (JWTDecodeException e) {
+            throw new CommonException(RestCode.UNAUTHORIZED.getCode(), e.getMessage());
+        }
+    }
+
+    /**
+     * 生成签名,5min后过期
+     *
+     * @param userId 用户Id
+     * @param phone  用户的密码
+     * @return 加密的token
+     */
+    public static String sign(String userId, String phone) {
+        return sign(userId, phone, getExpireTime());
+    }
+
+
+    public static String sign(String userId, String phone, Date expireTime) {
+        String secret = DigestUtils.md5DigestAsHex(phone.concat(SALT).getBytes());
+        Algorithm algorithm = Algorithm.HMAC256(secret);
+        return JWT.create()
+                .withClaim("userId", userId)
+                .withExpiresAt(expireTime)
+                .withIssuedAt(new Date())
+                .sign(algorithm);
+    }
+
+    /**
+     * token是否过期
+     *
+     * @return true:过期
+     */
+    public static boolean isTokenExpired(String token) {
+        Date now = new Date(System.currentTimeMillis());
+        //  Date now = Calendar.getInstance().getTime();
+        DecodedJWT jwt = JWT.decode(token);
+        return jwt.getExpiresAt().before(now);
+    }
+
+    private static Date getExpireTime() {
+        return DateUtils.addYears(new Date(), 1);
+    }
+
+
+}

+ 18 - 0
yqk-common/src/main/java/com/yx/face/boot/component/security/SessionUtils.java

@@ -0,0 +1,18 @@
+package com.yx.face.boot.component.security;
+
+import javax.servlet.http.HttpServletRequest;
+
+/**
+ * @description: SessionUtils <br>
+ * @date: 2021/3/21 13:09 <br>
+ * @author: PWB <br>
+ */
+public class SessionUtils {
+
+    public static String getValue(HttpServletRequest request) {
+
+        return "";
+    }
+
+
+}

+ 51 - 0
yqk-common/src/main/java/com/yx/face/boot/core/BaseController.java

@@ -0,0 +1,51 @@
+package com.yx.face.boot.core;
+
+import com.yx.face.boot.component.security.JWTUtils;
+import com.yx.face.boot.restful.CommonException;
+import com.yx.face.boot.restful.RestCode;
+import lombok.extern.slf4j.Slf4j;
+import org.apache.commons.lang3.StringUtils;
+import org.springframework.web.context.request.RequestContextHolder;
+import org.springframework.web.context.request.ServletRequestAttributes;
+
+import javax.servlet.http.HttpServletRequest;
+
+/**
+ * @description: BaseController <br>
+ * @date: 2020/1/10 14:33 <br>
+ * @author: PWB <br>
+ * @version: 1.0 <br>
+ */
+@Slf4j
+public class BaseController {
+
+
+    public Integer getUserId() {
+        ServletRequestAttributes requestAttributes = (ServletRequestAttributes) RequestContextHolder.getRequestAttributes();
+        if (requestAttributes == null) {
+            throw new CommonException(RestCode.UNAUTHORIZED);
+        }
+        HttpServletRequest request = requestAttributes.getRequest();
+        return Integer.parseInt(getUserId(request));
+    }
+
+
+    public String getUserId(HttpServletRequest request) {
+        String token = request.getHeader("Authorization");
+        token = JWTUtils.getUserId(token);
+        if (StringUtils.isEmpty(token)) {
+            throw new CommonException(RestCode.UNAUTHORIZED);
+        }
+        return token;
+    }
+
+    public Long getUserIdL() {
+        ServletRequestAttributes requestAttributes = (ServletRequestAttributes) RequestContextHolder.getRequestAttributes();
+        if (requestAttributes == null) {
+            throw new CommonException(RestCode.UNAUTHORIZED);
+        }
+        HttpServletRequest request = requestAttributes.getRequest();
+        return Long.parseLong(getUserId(request));
+    }
+
+}

+ 55 - 0
yqk-common/src/main/java/com/yx/face/boot/core/Constants.java

@@ -0,0 +1,55 @@
+package com.yx.face.boot.core;
+
+/**
+ * @description: Constants <br>
+ * @date: 2021/3/29 17:08 <br>
+ * @author: PWB <br>
+ */
+public class Constants {
+
+    public static final String UPLOAD_PATH = "file/image/upload/";
+    public static final String UPLOAD_IMAGE = "file/upload/images/";
+    public static final String UPLOAD_IMAGE_NEW = "file/upload/imagesnew/";
+    public static final String UPLOAD_EXCEL = "file/upload/excel/";
+    public static final String UPLOAD_PHOTO = "file/upload/photo/";
+    public static final String UPLOAD_VIDEO = "file/upload/videos/";
+    public static final String UPLOAD_DOCUMENT = "file/upload/document/";
+    public static final String UPLOAD_OTHER = "file/upload/other";
+    public static final String SYSTEM_FILE = "file/system/";
+    public static final String SALT = "YcYp65l;uq234pwb;iIjHg872S-ajfL.khp636**YX2021";
+    public static final String SALT_PRE = "SU2ti983*238--=833##383yuu";
+
+
+    //无锡苏康码加密秘钥key
+    public static final String SUPER_APP_KEY = "super_app_key";
+    //无锡苏康码 url
+    public static final String SKM_API_URL = "skm_aip_url";
+    //无锡苏康码
+    public static final String SUPER_SIGN = "super_sign";
+
+    public static final String TB_API_URL = "tb_aip_url";
+
+    public static final String TURN_ON_OR_STOP = "turn_on_or_stop";
+
+    //微信相关参数:登录地址
+    public static final String WX_LOGIN_URL = "https://api.weixin.qq.com/sns/jscode2session?appid={0}&secret={1}&js_code={2}&grant_type=authorization_code";
+    //微信相关参数:AccessToken获取地址
+    public static final String WX_ACCESS_TOKEN_URL = "https://api.weixin.qq.com/cgi-bin/token?grant_type=client_credential&appid={0}&secret={1}";
+    //微信相关参数:订阅消息请求地址
+    public static final String WX_MESSAGE_SEND_URL = "https://api.weixin.qq.com/cgi-bin/message/subscribe/send?access_token={0}";
+
+
+    //背景审核复议结果通知
+    public static final String WX_MS_TEMPLATE_4955 = "JPSs7hM4vBwwQXfShKWNEM3C_qyZFqBnBbfHJHWwfCQ";
+
+
+    //申请通行证结果通知
+    public static final String WX_MS_TEMPLATE_592 = "mh0qTV5SrTkXUHpg7AwC9VHSLhq8QzNQqI7VoQrwC4U";
+
+    /*进出记录统计时默认key值前缀*/
+    public static final String IN_OUT_STATISTICS = "IN_OUT_STATISTICS:";
+    /*进出记录预警前缀key 全部应该是key+admin:+idNumber*/
+    public static final String IN_OUT_WARNING = "IN_OUT_WARNING:";
+    /*访客机加密key值*/
+    public static final String FKJ_KEY = "a2f0e24913f378add01b9f36546a2edb";
+}

+ 126 - 0
yqk-common/src/main/java/com/yx/face/boot/core/GlobalExceptionHandler.java

@@ -0,0 +1,126 @@
+package com.yx.face.boot.core;
+
+
+import com.yx.face.boot.restful.*;
+import org.apache.commons.lang3.StringUtils;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.dao.DuplicateKeyException;
+import org.springframework.validation.BindException;
+import org.springframework.validation.FieldError;
+import org.springframework.web.bind.MethodArgumentNotValidException;
+import org.springframework.web.bind.annotation.ExceptionHandler;
+import org.springframework.web.bind.annotation.RestControllerAdvice;
+import org.springframework.web.servlet.NoHandlerFoundException;
+
+import javax.validation.ConstraintViolation;
+import javax.validation.ConstraintViolationException;
+import javax.validation.Path;
+import javax.validation.ValidationException;
+import java.util.List;
+import java.util.Objects;
+import java.util.Set;
+
+/**
+ * @description: GlobalExceptionHandler 全局异常处理器 <br>
+ * @date: 2020/5/14 9:46 <br>
+ * @author: PWB <br>
+ * @since: 1.0 <br>
+ */
+@RestControllerAdvice
+public class GlobalExceptionHandler {
+    private Logger log = LoggerFactory.getLogger(getClass());
+
+    /**
+     * 处理自定义异常
+     */
+    @ExceptionHandler(ServiceException.class)
+    public RestResult<Object> handleRRException(ServiceException e) {
+        log.error(e.getMessage(), e);
+        return RestResponse.build(e.getCode(), e.getMessage());
+    }
+
+    /**
+     * 处理自定义异常
+     */
+    @ExceptionHandler(CommonException.class)
+    public RestResult<Object> handleRRException(CommonException e) {
+        log.error(e.getMessage(), e);
+        return RestResponse.build(e.getCode(), e.getMessage());
+    }
+
+    /**
+     * 统一处理请求参数校验(实体对象传参)
+     *
+     * @param e BindException
+     * @return FebsResponse
+     */
+    @ExceptionHandler(BindException.class)
+    public RestResult<Object> validExceptionHandler(BindException e) {
+        StringBuilder message = new StringBuilder();
+        List<FieldError> fieldErrors = e.getBindingResult().getFieldErrors();
+        for (FieldError error : fieldErrors) {
+            message.append(error.getField()).append(error.getDefaultMessage()).append(",");
+        }
+        message = new StringBuilder(message.substring(0, message.length() - 1));
+        return RestResponse.build(RestCode.FAIL.getCode(), message.toString());
+    }
+
+    /**
+     * 方法参数校验
+     */
+    @ExceptionHandler(MethodArgumentNotValidException.class)
+    public RestResult<Object> handleMethodArgumentNotValidException(MethodArgumentNotValidException e) {
+        log.error(e.getMessage(), e);
+        return RestResponse.build(RestCode.FAIL.getCode(), Objects.requireNonNull(e.getBindingResult().getFieldError()).getDefaultMessage());
+    }
+
+    /**
+     * ValidationException
+     */
+    @ExceptionHandler(ValidationException.class)
+    public RestResult<Object> handleValidationException(ValidationException e) {
+        log.error(e.getMessage(), e);
+        return RestResponse.build(RestCode.FAIL.getCode(), e.getCause().getMessage());
+    }
+
+    /**
+     * 统一处理请求参数校验(普通传参)
+     *
+     * @param e ConstraintViolationException
+     * @return FebsResponse
+     */
+    @ExceptionHandler(value = ConstraintViolationException.class)
+    public RestResult<Object> handleConstraintViolationException(ConstraintViolationException e) {
+        StringBuilder message = new StringBuilder();
+        Set<ConstraintViolation<?>> violations = e.getConstraintViolations();
+        for (ConstraintViolation<?> violation : violations) {
+            Path path = violation.getPropertyPath();
+            String[] pathArr = StringUtils.splitByWholeSeparatorPreserveAllTokens(path.toString(), ".");
+            message.append(String.format("[%s]", pathArr[1])).append(violation.getMessage()).append(";");
+        }
+        message = new StringBuilder(message.substring(0, message.length() - 1));
+        return RestResponse.build(RestCode.FAIL.getCode(), message.toString());
+    }
+
+    @ExceptionHandler(NoHandlerFoundException.class)
+    public RestResult<Object> handlerNoFoundException(Exception e) {
+        log.error(e.getMessage(), e);
+        return RestResponse.build(RestCode.NOT_FOUND.getCode(), "路径不存在,请检查路径是否正确");
+    }
+
+    @ExceptionHandler(DuplicateKeyException.class)
+    public RestResult<Object> handleDuplicateKeyException(DuplicateKeyException e) {
+        log.error(e.getMessage(), e);
+        return RestResponse.build(RestCode.FAIL.getCode(), "数据重复,请检查后提交");
+    }
+
+
+    @ExceptionHandler(Exception.class)
+    public RestResult<Object> handleException(Exception e) {
+        log.error(e.getMessage(), e);
+        return RestResponse.error(RestCode.INTERNAL_SERVER_ERROR);
+    }
+
+
+}

+ 203 - 0
yqk-common/src/main/java/com/yx/face/boot/core/SnowflakeIdWorker.java

@@ -0,0 +1,203 @@
+package com.yx.face.boot.core;
+
+/**
+ * @description: * Twitter_Snowflake<br>
+ * SnowFlake的结构如下(每部分用-分开):<br>
+ * 0 - 0000000000 0000000000 0000000000 0000000000 0 - 00000 - 00000 - 000000000000 <br>
+ * 1位标识,由于long基本类型在Java中是带符号的,最高位是符号位,正数是0,负数是1,所以id一般是正数,最高位是0<br>
+ * 41位时间截(毫秒级),注意,41位时间截不是存储当前时间的时间截,而是存储时间截的差值(当前时间截 - 开始时间截)
+ * 得到的值),这里的的开始时间截,一般是我们的id生成器开始使用的时间,由我们程序来指定的(如下下面程序IdWorker类的startTime属性)。41位的时间截,可以使用69年,年T = (1L << 41) / (1000L * 60 * 60 * 24 * 365) = 69<br>
+ * 10位的数据机器位,可以部署在1024个节点,包括5位dataCenterId和5位workerId<br>
+ * 12位序列,毫秒内的计数,12位的计数顺序号支持每个节点每毫秒(同一机器,同一时间截)产生4096个ID序号<br>
+ * 加起来刚好64位,为一个Long型。<br>
+ * SnowFlake的优点是,整体上按照时间自增排序,并且整个分布式系统内不会产生ID碰撞(由数据中心ID和机器ID作区分),并且效率较高,经测试,SnowFlake每秒能够产生26万ID左右。
+ * @date: 2020/7/16 16:17 <br>
+ * @since: 1.0 <br>
+ */
+public class SnowflakeIdWorker {
+
+
+    // ==============================Fields===========================================
+    /**
+     * 开始时间截 (2020-07-07)
+     */
+    private static final long trench = 1594887982462L;
+
+    /**
+     * 机器id所占的位数
+     */
+    private static final long workerIdBits = 5L;
+
+    /**
+     * 数据标识id所占的位数
+     */
+    private static final long dataCenterIdBits = 5L;
+
+    /**
+     * 支持的最大机器id,结果是31 (这个移位算法可以很快的计算出几位二进制数所能表示的最大十进制数)
+     */
+    private static final long maxWorkerId = ~(-1L << workerIdBits);
+
+    /**
+     * 支持的最大数据标识id,结果是31
+     */
+    private static final long maxDataCenterId = ~(-1L << dataCenterIdBits);
+
+    /**
+     * 序列在id中占的位数
+     */
+    private static final long sequenceBits = 12L;
+
+    /**
+     * 机器ID向左移12位
+     */
+    private static final long workerIdShift = sequenceBits;
+
+    /**
+     * 数据标识id向左移17位(12+5)
+     */
+    private static final long dataCenterIdShift = sequenceBits + workerIdBits;
+
+    /**
+     * 时间截向左移22位(5+5+12)
+     */
+    private static final long timestampLeftShift = sequenceBits + workerIdBits + dataCenterIdBits;
+
+    /**
+     * 生成序列的掩码,这里为4095 (0b111111111111=0xfff=4095)
+     */
+    private static final long sequenceMask = ~(-1L << sequenceBits);
+
+    /**
+     * 工作机器ID(0~31)
+     */
+    private long workerId;
+
+    /**
+     * 数据中心ID(0~31)
+     */
+    private long dataCenterId;
+
+    /**
+     * 毫秒内序列(0~4095)
+     */
+    private long sequence = 0L;
+
+    /**
+     * 上次生成ID的时间截
+     */
+    private long lastTimestamp = -1L;
+
+    //==============================Constructors=====================================
+    private static SnowflakeIdWorker instance;
+
+    /**
+     * 构造函数
+     *
+     * @param workerId     工作ID (0~31)
+     * @param dataCenterId 数据中心ID (0~31)
+     */
+    private SnowflakeIdWorker(long workerId, long dataCenterId) {
+        if (workerId > maxWorkerId || workerId < 0) {
+            throw new IllegalArgumentException(String.format("worker Id can't be greater than %d or less than 0", maxWorkerId));
+        }
+        if (dataCenterId > maxDataCenterId || dataCenterId < 0) {
+            throw new IllegalArgumentException(String.format("datacenter Id can't be greater than %d or less than 0", maxDataCenterId));
+        }
+        this.workerId = workerId;
+        this.dataCenterId = dataCenterId;
+    }
+
+    public static long getSnowId() {
+        return getSnowId(0, 0);
+    }
+
+    public static long getSnowId(long workerId, long dataCenterId) {
+        return getInstance(workerId, dataCenterId).nextId();
+    }
+
+    public static SnowflakeIdWorker getInstance(long workerId, long dataCenterId) {
+        if (instance == null) {//先判断是否为null 后上锁进行初始化
+            synchronized (SnowflakeIdWorker.class) {
+                if (instance == null)//将对象上锁之后再次判断 是否有别的线程初始化了
+                    instance = new SnowflakeIdWorker(workerId, dataCenterId);
+            }
+        }
+        return instance;
+    }
+    // ==============================Methods==========================================
+
+    /**
+     * 获得下一个ID (该方法是线程安全的)
+     *
+     * @return SnowflakeId
+     */
+    public synchronized long nextId() {
+        long timestamp = timeGen();
+
+        //如果当前时间小于上一次ID生成的时间戳,说明系统时钟回退过这个时候应当抛出异常
+        if (timestamp < lastTimestamp) {
+            throw new RuntimeException(
+                    String.format("Clock moved backwards.  Refusing to generate id for %d milliseconds", lastTimestamp - timestamp));
+        }
+
+        //如果是同一时间生成的,则进行毫秒内序列
+        if (lastTimestamp == timestamp) {
+            sequence = (sequence + 1) & sequenceMask;
+            //毫秒内序列溢出
+            if (sequence == 0) {
+                //阻塞到下一个毫秒,获得新的时间戳
+                timestamp = tilNextMillis(lastTimestamp);
+            }
+        }
+        //时间戳改变,毫秒内序列重置
+        else {
+            sequence = 0L;
+        }
+
+        //上次生成ID的时间截
+        lastTimestamp = timestamp;
+
+        //移位并通过或运算拼到一起组成64位的ID
+        return ((timestamp - trench) << timestampLeftShift) //
+                | (dataCenterId << dataCenterIdShift) //
+                | (workerId << workerIdShift) //
+                | sequence;
+    }
+
+    /**
+     * 阻塞到下一个毫秒,直到获得新的时间戳
+     *
+     * @param lastTimestamp 上次生成ID的时间截
+     * @return 当前时间戳
+     */
+    protected long tilNextMillis(long lastTimestamp) {
+        long timestamp = timeGen();
+        while (timestamp <= lastTimestamp) {
+            timestamp = timeGen();
+        }
+        return timestamp;
+    }
+
+    /**
+     * 返回以毫秒为单位的当前时间
+     *
+     * @return 当前时间(毫秒)
+     */
+    protected long timeGen() {
+        return System.currentTimeMillis();
+    }
+
+    //==============================Test=============================================
+
+    /*public static void main(String[] args) {
+        SnowflakeIdWorker idWorker = new SnowflakeIdWorker(0, 0);
+        System.out.println(System.currentTimeMillis());
+        for (int i = 0; i < 2; i++) {
+            long id = idWorker.nextId();
+            System.out.println(Long.toBinaryString(id));
+            System.out.println(id);
+        }
+    }*/
+
+}

+ 15 - 0
yqk-common/src/main/java/com/yx/face/boot/handle/IntegerTypeHandler.java

@@ -0,0 +1,15 @@
+package com.yx.face.boot.handle;
+
+import com.alibaba.fastjson.TypeReference;
+
+import java.util.List;
+
+public class IntegerTypeHandler extends ListTypeHandler<Integer> {
+ 
+    @Override
+    protected TypeReference<List<Integer>> specificType() {
+        return new TypeReference<List<Integer>>() {
+        };
+    }
+    
+}

+ 58 - 0
yqk-common/src/main/java/com/yx/face/boot/handle/ListTypeHandler.java

@@ -0,0 +1,58 @@
+package com.yx.face.boot.handle;
+
+import cn.hutool.core.collection.CollUtil;
+import cn.hutool.core.util.StrUtil;
+import com.alibaba.fastjson.JSON;
+import com.alibaba.fastjson.TypeReference;
+import org.apache.ibatis.type.BaseTypeHandler;
+import org.apache.ibatis.type.JdbcType;
+import org.apache.ibatis.type.MappedJdbcTypes;
+import org.apache.ibatis.type.MappedTypes;
+
+import java.sql.CallableStatement;
+import java.sql.PreparedStatement;
+import java.sql.ResultSet;
+import java.sql.SQLException;
+import java.util.ArrayList;
+import java.util.List;
+
+
+@MappedJdbcTypes(JdbcType.VARBINARY)
+@MappedTypes({List.class})
+public abstract class ListTypeHandler<T> extends BaseTypeHandler<List<T>> {
+ 
+    @Override
+    public void setNonNullParameter(PreparedStatement ps, int i, List<T> parameter, JdbcType jdbcType) throws SQLException {
+        String content = CollUtil.isEmpty(parameter) ? null : JSON.toJSONString(parameter);
+        ps.setString(i, content);
+    }
+ 
+    @Override
+    public List<T> getNullableResult(ResultSet rs, String columnName) throws SQLException {
+        return this.getListByJsonArrayString(rs.getString(columnName));
+    }
+ 
+    @Override
+    public List<T> getNullableResult(ResultSet rs, int columnIndex) throws SQLException {
+        return this.getListByJsonArrayString(rs.getString(columnIndex));
+    }
+ 
+    @Override
+    public List<T> getNullableResult(CallableStatement cs, int columnIndex) throws SQLException {
+        return this.getListByJsonArrayString(cs.getString(columnIndex));
+    }
+ 
+ 
+    private List<T> getListByJsonArrayString(String content) {
+        return StrUtil.isBlank(content) ? new ArrayList<>() : JSON.parseObject(content, this.specificType());
+    }
+ 
+    /**
+     * 具体类型,由子类提供
+     *
+     * @return 具体类型
+     */
+    protected abstract TypeReference<List<T>> specificType();
+ 
+ 
+}

+ 50 - 0
yqk-common/src/main/java/com/yx/face/boot/restful/CommonException.java

@@ -0,0 +1,50 @@
+package com.yx.face.boot.restful;
+
+import java.io.Serializable;
+
+
+/**
+ * @description: 通用异常抛出 列如 工具类中的异常抛出  <br>
+ * @since: 1.0 <br>
+ * @date: 2020/10/21 11:21 <br>
+ * @author: PWB <br>
+ */
+public class CommonException extends RuntimeException implements Serializable {
+
+    private static final long serialVersionUID = 1213855733833039552L;
+
+    private Integer code;
+
+    public CommonException() {
+        super(RestCode.FAIL.getMsg());
+        this.code = RestCode.FAIL.getCode();
+    }
+
+    public CommonException(String message) {
+        super(message);
+        this.code = RestCode.FAIL.getCode();
+    }
+
+    public CommonException(Integer code, String message) {
+        super(message);
+        this.code = code;
+    }
+
+    public CommonException(RestCode resCode) {
+        super(resCode.getMsg());
+        this.code = resCode.getCode();
+    }
+
+    public CommonException(String message, Throwable cause) {
+        super(message, cause);
+        this.code = RestCode.FAIL.getCode();
+    }
+
+    public Integer getCode() {
+        return code;
+    }
+
+    public void setCode(Integer code) {
+        this.code = code;
+    }
+}

+ 49 - 0
yqk-common/src/main/java/com/yx/face/boot/restful/RestCode.java

@@ -0,0 +1,49 @@
+package com.yx.face.boot.restful;
+
+
+public enum RestCode {
+
+    SUCCESS(200, "成功"),
+    FAIL(400, "失败"),
+    UNAUTHORIZED(401, "未授权"),
+    FORBIDDEN(403, "禁止访问该资源"),
+    NOT_FOUND(404, "未发现该资源"),
+    REQUEST_TIMEOUT(408, "请求超时"),
+    INTERNAL_SERVER_ERROR(500, "数据处理异常"),
+    SERVICE_UNAVAILABLE(503, "服务无法获得"),
+    GATEWAY_TIMEOUT(504, "网关超时"),
+    REMOTE_INVOCATION_FAIL(900, "远程服务调用失败"),
+    INVALID_TOKEN(101408, "无效token"),
+    DEVICE_NOT_FOUND(40000, "设备未注册"),
+    ADDRESS_CODE_UNBOUND(40001, "暂未开启场所码"),
+    PARAMS_IDCARD_INCOMPLETE(40002, "身份证/姓名参数不全"),
+    HEALTH_CODE_INFO_NOT_FOUND(40003, "未获取到健康码信息"),
+    SCENIC_NOT_CONFIG(40004, "景区预约账号未配置,请检查"),
+    SCENIC_QUERY_EXCEPTION(40005, "景区预约服务系统异常,请稍后重试"),
+    INVALID_QR_CODE(40006, "请扫描正确的二维码"),
+    INVALID_HEALTH_CODE(40007, "请打开支付宝选择杭州健康码重试");
+
+    public int code;
+    private String msg;
+
+    RestCode(int code, String msg) {
+        this.code = code;
+        this.msg = msg;
+    }
+
+    public int getCode() {
+        return code;
+    }
+
+    public void setCode(int code) {
+        this.code = code;
+    }
+
+    public String getMsg() {
+        return msg;
+    }
+
+    public void setMsg(String msg) {
+        this.msg = msg;
+    }
+}

+ 64 - 0
yqk-common/src/main/java/com/yx/face/boot/restful/RestDTO.java

@@ -0,0 +1,64 @@
+package com.yx.face.boot.restful;
+
+import com.fasterxml.jackson.databind.ObjectMapper;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.SneakyThrows;
+
+/**
+ * @description: RestDTO <br>
+ * @date: 2021/3/24 16:57 <br>
+ * @author: PWB <br>
+ */
+@ApiModel("分页查询参数 model ")
+public class RestDTO<T> {
+
+    @ApiModelProperty("第几页 默认1 ")
+    private Integer pageNum = 1;
+
+    @ApiModelProperty("每页大小 默认 20")
+    private Integer pageSize = 20;
+
+    @ApiModelProperty("其它查询参数 ")
+    private T data;
+
+    public Integer getPageNum() {
+        return pageNum;
+    }
+
+    public void setPageNum(Integer pageNum) {
+        if (pageNum == null || pageNum < 1) {
+            this.pageNum = 1;
+            return;
+        }
+        this.pageNum = pageNum;
+    }
+
+    public Integer getPageSize() {
+        return pageSize;
+    }
+
+    public void setPageSize(Integer pageSize) {
+        if (pageSize == null || pageSize < 1) {
+            this.pageSize = 20;
+            return;
+        }
+        this.pageSize = pageSize;
+    }
+
+    public T getData() {
+        return data;
+    }
+
+    public void setData(T data) {
+        this.data = data;
+    }
+
+
+    @SneakyThrows
+    @Override
+    public String toString() {
+        ObjectMapper om = new ObjectMapper();
+        return om.writeValueAsString(this);
+    }
+}

+ 47 - 0
yqk-common/src/main/java/com/yx/face/boot/restful/RestResponse.java

@@ -0,0 +1,47 @@
+package com.yx.face.boot.restful;
+
+
+public class RestResponse {
+
+    public static RestResult<String> ok() {
+        return new RestResult<String>().setCode(RestCode.SUCCESS).setMsg(RestCode.SUCCESS.getMsg());
+    }
+
+    public static <T> RestResult<T> ok(T data) {
+        return new RestResult<T>().setCode(RestCode.SUCCESS).setMsg(RestCode.SUCCESS.getMsg()).setData(data);
+    }
+
+    public static <T> RestResult<T> error(String message) {
+        return new RestResult<T>().setCode(RestCode.FAIL).setMsg(message);
+    }
+
+    public static <T> RestResult<T> error(RestCode restCode, T data) {
+        return new RestResult<T>().setCode(restCode.getCode()).setMsg(restCode.getMsg()).setData(data);
+    }
+
+    public static <T> RestResult<T> error(RestCode restCode, T data, String message) {
+        return new RestResult<T>().setCode(restCode.getCode()).setMsg(restCode.getMsg()).setData(data).setMsg(message);
+    }
+
+    public static <T> RestResult<T> error(RestCode restCode) {
+        return new RestResult<T>().setCode(restCode.getCode()).setMsg(restCode.getMsg());
+    }
+
+    public static <T> RestResult<T> build(int code, String msg) {
+        return new RestResult<T>().setCode(code).setMsg(msg);
+    }
+
+    public static <T> RestResult<T> build(int code, String msg, T data) {
+        return new RestResult<T>().setCode(code).setMsg(msg).setData(data);
+    }
+
+    public static <T> T verifyRestResult(RestResult<T> restResult) {
+        if (restResult == null) {
+            throw new ServiceException(RestCode.SERVICE_UNAVAILABLE);
+        }
+        if (restResult.getCode() != RestCode.SUCCESS.getCode()) {
+            throw new ServiceException(restResult.getCode(), restResult.getMsg());
+        }
+        return restResult.getData();
+    }
+}

+ 72 - 0
yqk-common/src/main/java/com/yx/face/boot/restful/RestResult.java

@@ -0,0 +1,72 @@
+package com.yx.face.boot.restful;
+
+
+import com.fasterxml.jackson.databind.ObjectMapper;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.SneakyThrows;
+
+import java.io.Serializable;
+
+
+@ApiModel("返回类")
+public class RestResult<T> implements Serializable {
+
+    private static final long serialVersionUID = 3758864789222317092L;
+
+    @ApiModelProperty("状态码")
+    public int code;
+
+    @ApiModelProperty("返回消息")
+    private String msg;
+
+    @ApiModelProperty("对象")
+    private T data;
+
+    public RestResult<T> setCode(RestCode restCode) {
+        this.code = restCode.code;
+        return this;
+    }
+
+    public int getCode() {
+        return code;
+    }
+
+    public RestResult<T> setCode(int code) {
+        this.code = code;
+        return this;
+    }
+
+    public String getMsg() {
+        return msg;
+    }
+
+    public RestResult<T> setMsg(String msg) {
+        this.msg = msg;
+        return this;
+    }
+
+    public T getData() {
+        return data;
+    }
+
+    public RestResult<T> setData(T data) {
+        this.data = data;
+        return this;
+    }
+
+    @SneakyThrows
+    @Override
+    public String toString() {
+        ObjectMapper om = new ObjectMapper();
+        return om.writeValueAsString(this);
+    }
+
+    public static <T> RestResult<T> ok(T data) {
+        RestResult<T> result = new RestResult<>();
+        result.code = RestCode.SUCCESS.code;
+        result.msg = RestCode.SUCCESS.getMsg();
+        result.data = data;
+        return result;
+    }
+}

+ 38 - 0
yqk-common/src/main/java/com/yx/face/boot/restful/ScanCodeRestCode.java

@@ -0,0 +1,38 @@
+package com.yx.face.boot.restful;
+
+
+public enum ScanCodeRestCode {
+
+    /**
+     * 0000-1.wav
+     * 0001-2.wav
+     * 0009-3.wav
+     */
+    SUCCESS("0000", "核验成功"),
+    FAIL("0009", "核验失败"),
+    USED("0001", "二维码已使用,不能重复扫码");
+
+    public String code;
+    private String msg;
+
+    ScanCodeRestCode(String code, String msg) {
+        this.code = code;
+        this.msg = msg;
+    }
+
+    public String getCode() {
+        return code;
+    }
+
+    public void setCode(String code) {
+        this.code = code;
+    }
+
+    public String getMsg() {
+        return msg;
+    }
+
+    public void setMsg(String msg) {
+        this.msg = msg;
+    }
+}

+ 44 - 0
yqk-common/src/main/java/com/yx/face/boot/restful/ServiceException.java

@@ -0,0 +1,44 @@
+package com.yx.face.boot.restful;
+
+import java.io.Serializable;
+
+
+public class ServiceException extends RuntimeException implements Serializable {
+
+    private static final long serialVersionUID = 1213855733833039552L;
+
+    private Integer code;
+
+    public ServiceException() {
+        super(RestCode.FAIL.getMsg());
+        this.code = RestCode.FAIL.getCode();
+    }
+
+    public ServiceException(String message) {
+        super(message);
+        this.code = RestCode.FAIL.getCode();
+    }
+
+    public ServiceException(Integer code, String message) {
+        super(message);
+        this.code = code;
+    }
+
+    public ServiceException(RestCode resCode) {
+        super(resCode.getMsg());
+        this.code = resCode.getCode();
+    }
+
+    public ServiceException(String message, Throwable cause) {
+        super(message, cause);
+        this.code = RestCode.FAIL.getCode();
+    }
+
+    public Integer getCode() {
+        return code;
+    }
+
+    public void setCode(Integer code) {
+        this.code = code;
+    }
+}

+ 87 - 0
yqk-common/src/main/java/com/yx/face/boot/uitls/AesUtils.java

@@ -0,0 +1,87 @@
+package com.yx.face.boot.uitls;
+
+import org.apache.commons.codec.binary.Hex;
+
+import javax.crypto.Cipher;
+import javax.crypto.KeyGenerator;
+import javax.crypto.SecretKey;
+import javax.crypto.spec.SecretKeySpec;
+import java.io.UnsupportedEncodingException;
+import java.security.Key;
+import java.security.NoSuchAlgorithmException;
+import java.security.SecureRandom;
+
+public class AesUtils {
+
+    public static void main(String[] args) throws UnsupportedEncodingException {
+        for (int i = 0; i < 10; i++) {
+            String key = generateKey(); // 提前生成的一个key
+            System.out.println(key);
+        }
+    }
+
+
+    /**
+     * 生成key
+     * @return
+     */
+    public static String generateKey() {
+        try {
+            KeyGenerator keyGenerator = KeyGenerator.getInstance("AES");
+            keyGenerator.init(new SecureRandom());
+            SecretKey secretKey = keyGenerator.generateKey();
+            byte[] byteKey = secretKey.getEncoded();
+            return Hex.encodeHexString(byteKey);
+        } catch (NoSuchAlgorithmException e) {
+            e.printStackTrace();
+        }
+
+        return null;
+    }
+
+    /**
+     * AES加密
+     * @param thisKey
+     * @param data
+     * @return
+     */
+    public static String encode(String thisKey, String data) {
+        try {
+            // 转换KEY
+            Key key = new SecretKeySpec(Hex.decodeHex(thisKey),"AES");
+            //System.out.println(thisKey);
+
+            // 加密
+            Cipher cipher = Cipher.getInstance("AES/ECB/PKCS5Padding");
+            cipher.init(Cipher.ENCRYPT_MODE, key);
+            byte[] result = cipher.doFinal(data.getBytes());
+            return Hex.encodeHexString(result);
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+
+        return null;
+    }
+
+    /**
+     * AES解密
+     * @param thisKey
+     * @param data
+     * @return
+     */
+    public static String decode(String thisKey, String data) {
+        try {
+            // 转换KEY
+            Key key = new SecretKeySpec(Hex.decodeHex(thisKey),"AES");
+            // 解密
+            Cipher cipher = Cipher.getInstance("AES/ECB/PKCS5Padding");
+            cipher.init(Cipher.DECRYPT_MODE, key);
+            byte[] result = cipher.doFinal(Hex.decodeHex(data));
+            return new String(result,"GBK");
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+
+        return null;
+    }
+}

+ 101 - 0
yqk-common/src/main/java/com/yx/face/boot/uitls/AppUtils.java

@@ -0,0 +1,101 @@
+package com.yx.face.boot.uitls;
+
+
+import java.security.MessageDigest;
+import java.security.NoSuchAlgorithmException;
+import java.util.UUID;
+
+/**
+ * @author shisl
+ * @package com.yx.face.boot.uitls
+ * @class AppUtils
+ * @date 2022/10/25 下午6:22
+ * @description appKey appSecret 生成工具类
+ */
+public class AppUtils {
+    private final static String APP_KEY_PREFIX = "hh";
+    private final static String SERVER_NAME = "hanghui_api_nqj##361";
+    private final static String[] chars = new String[]{"a", "b", "c", "d", "e", "f",
+            "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s",
+            "t", "u", "v", "w", "x", "y", "z", "0", "1", "2", "3", "4", "5",
+            "6", "7", "8", "9", "A", "B", "C", "D", "E", "F", "G", "H", "I",
+            "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V",
+            "W", "X", "Y", "Z"};
+
+    /**
+     * <p>
+     * 短8位UUID思想其实借鉴微博短域名的生成方式,但是其重复概率过高,而且每次生成4个,需要随即选取一个。
+     * 本算法利用62个可打印字符,通过随机生成32位UUID,由于UUID都为十六进制,
+     * 所以将UUID + 时间戳 分成9组,每5个为一组,然后通过模62操作,结果作为索引取出字符,
+     * 这样重复率大大降低。
+     * 经测试,在生成一千万个数据也没有出现重复,完全满足大部分需求。
+     * </p>
+     *
+     * @return
+     */
+    public static String getAppKey() {
+        StringBuffer shortBuffer = new StringBuffer().append(APP_KEY_PREFIX);
+        String uuid = UUID.randomUUID().toString().replace("-", "") + System.currentTimeMillis();
+        for (int i = 0; i < 9; i++) {
+            String str = uuid.substring(i * 5, i * 5 + 5);
+            int x = Integer.parseInt(str, 16);
+            shortBuffer.append(chars[x % 0x3E]);
+        }
+        return shortBuffer.toString();
+    }
+
+    /**
+     * 算法sha1生成AppSecret
+     *
+     * @param appKey
+     * @return
+     */
+    public static String getAppSecret(String appKey) {
+        try {
+
+            StringBuffer sb = new StringBuffer();
+            String uuid = UUID.randomUUID().toString();
+            sb.append(appKey).append(SERVER_NAME).append(uuid);
+
+            String str = sb.toString();
+            MessageDigest md = MessageDigest.getInstance("SHA-1");
+            md.update(str.getBytes());
+            byte[] digest = md.digest();
+
+            StringBuffer hexstr = new StringBuffer();
+            String shaHex = "";
+            for (int i = 0; i < digest.length; i++) {
+                shaHex = Integer.toHexString(digest[i] & 0xFF);
+                if (shaHex.length() < 2) {
+                    hexstr.append(0);
+                }
+                hexstr.append(shaHex);
+            }
+            return hexstr.toString();
+        } catch (NoSuchAlgorithmException e) {
+            e.printStackTrace();
+        }
+        return appKey;
+    }
+
+    /**
+     * 返回一个定长的随机字符串(只包含大小写字母、数字)
+     *
+     * @return 随机字符串
+     */
+    public static String getPrivateKey() {
+
+        return RandomUtils.generateString(16).toLowerCase();
+    }
+
+    public static void main(String[] args) {
+        String appKey = getAppKey();
+        String appSecret = getAppSecret(appKey);
+        System.out.println("--->time: " + System.currentTimeMillis());
+
+        System.out.println("--->appKey: " + appKey);
+        System.out.println("--->appSecret: " + appSecret);
+        System.out.println("--->privateKey: " + getPrivateKey());
+
+    }
+}

+ 44 - 0
yqk-common/src/main/java/com/yx/face/boot/uitls/ClassUtil.java

@@ -0,0 +1,44 @@
+package com.yx.face.boot.uitls;
+
+import cn.hutool.core.util.ObjectUtil;
+import com.yx.face.boot.restful.RestDTO;
+import com.yx.face.boot.restful.ServiceException;
+
+/**
+ * @description:
+ * @ClassName ClassUtil
+ * @Author WXG
+ * @Date 2023/5/18 17:18
+ */
+public class ClassUtil {
+
+    public static <T> void searchInit(RestDTO<T> restDTO, Class<T> tClass){
+        if(!ObjectUtil.isNull(restDTO.getData())){
+            return;
+        }
+        try {
+            T t = tClass.newInstance();
+            restDTO.setData(t);
+        } catch (InstantiationException e) {
+            throw new RuntimeException(e);
+        } catch (IllegalAccessException e) {
+            throw new RuntimeException(e);
+        }
+    }
+
+    public static void checkData(Object o){
+        if(ObjectUtil.isNull(o)){
+            throw new ServiceException("数据不存在");
+        }
+    }
+    public static void checkData(Object o,String throwString){
+        if(ObjectUtil.isNull(o)){
+            throw new ServiceException(throwString);
+        }
+    }
+    public static void throwBusinessException(Boolean o,String throwString){
+        if(o){
+            throw new ServiceException(throwString);
+        }
+    }
+}

+ 907 - 0
yqk-common/src/main/java/com/yx/face/boot/uitls/ConvertUtils.java

@@ -0,0 +1,907 @@
+package com.yx.face.boot.uitls;
+
+
+import com.yx.face.boot.restful.CommonException;
+
+import java.io.UnsupportedEncodingException;
+import java.math.BigDecimal;
+import java.net.URLDecoder;
+import java.net.URLEncoder;
+import java.nio.charset.StandardCharsets;
+import java.text.DecimalFormat;
+import java.text.ParseException;
+import java.text.SimpleDateFormat;
+import java.util.Base64;
+import java.util.Calendar;
+import java.util.Date;
+import java.util.Random;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+
+/**
+ * @description: 用于将一个对象转换为另一个对象等操作
+ */
+public final class ConvertUtils {
+    private ConvertUtils() {
+    }
+
+    //region [处理几种类型的数据,发生错误时返回默认数据等操作]
+
+    public static String getStringValue(String s) {
+        return s == null ? "" : s;
+
+    }
+
+    public static String getStringValue(Object s) {
+        return s == null ? "" : s.toString();
+    }
+
+
+    /**
+     * 这里主要用来验证代表的状态值或等级等,要求大于-1,不能为null
+     */
+    public static Boolean judgeIntegerValue(Integer v) {
+        if (v != null) {
+            return v > -1;
+        }
+        return false;
+    }
+
+    /**
+     * 这里主要用来获取代表的状态值或等级等,最小为0
+     */
+    public static Integer getIntegerValue(Integer v) {
+        if (v != null) {
+            if (v > -1) {
+                return v;
+            }
+        }
+        return 0;
+    }
+
+    /**
+     * 这里主要用来验证代表值常量的判断,要求大于0,不能为null
+     */
+    public static Boolean judgeIntegerKey(Integer v) {
+        return getIntValue(v) > 0;
+    }
+
+    public static Integer getIntValue(Integer v) {
+        return getIntValue(v, -1);
+    }
+
+    public static Integer getIntValue(Integer v, int def) {
+        if (v != null && !v.equals(0)) {
+            return v;
+        } else {
+            return def;
+        }
+    }
+
+    public static int getIntValue(String v) {
+        return getIntValue(v, -1);
+    }
+
+    public static int getIntValue(String v, int def) {
+        try {
+            return Integer.parseInt(v);
+        } catch (Exception ex) {
+            return def;
+        }
+    }
+
+    /**
+     * 这里主要用来验证是不是自增ID,要求大于0,不能为null
+     */
+    public static Boolean judgeLongKey(Long v) {
+        return getLongValue(v) > 0;
+    }
+
+    public static Long getLongValue(Long v) {
+        return getLongValue(v, -1L);
+    }
+
+    public static Long getLongValue(Long v, Long def) {
+        if (v != null && !v.equals(0L)) {
+            return v;
+        } else {
+            return def;
+        }
+    }
+
+    public static Long getLongValue(String v) {
+        return getLongValue(v, -1L);
+    }
+
+    public static Long getLongValue(String v, Long def) {
+        try {
+            return Long.parseLong(v);
+        } catch (Exception ex) {
+            return def;
+        }
+    }
+
+    public static Float getFloatValue(String v) {
+        return getFloatValue(v, 0);
+    }
+
+    public static Float getFloatValue(String v, float def) {
+        try {
+            return Float.parseFloat(v);
+        } catch (Exception ex) {
+            return def;
+        }
+    }
+
+    /**
+     * 返回保留2位数的数据
+     *
+     * @param v 值
+     */
+    public static Double getDoubleRetain(Double v) {
+        return getDoubleRetain(v, 2);
+    }
+
+    /**
+     * 返回指定保留位数的数据
+     *
+     * @param v   值
+     * @param num 位数
+     */
+    public static Double getDoubleRetain(Double v, int num) {
+        StringBuilder s = new StringBuilder();
+        for (int i = 0; i < num; i++) {
+            s.append("0");
+        }
+        DecimalFormat df = new DecimalFormat("#." + s);
+        return getDoubleValue(df.format(v));
+    }
+
+    public static Double getDoubleValue(String v) {
+        return getDoubleValue(v, 0);
+    }
+
+    public static Double getDoubleValue(String v, double def) {
+        try {
+            return Double.parseDouble(v);
+        } catch (Exception ex) {
+            return def;
+        }
+    }
+
+    //region [BigDecimal操作]
+
+    /**
+     * 判断是否v1是否大于v2
+     *
+     * @param v1 原始值
+     * @param v2 待比值
+     */
+    public static Boolean judgeBigDecimalBig(BigDecimal v1, BigDecimal v2) {
+        return v1.compareTo(v2) > 0;
+    }
+
+    /**
+     * 判断是否v1是否小于v2
+     *
+     * @param v1 原始值
+     * @param v2 待比值
+     */
+    public static Boolean judgeBigDecimalSmall(BigDecimal v1, BigDecimal v2) {
+        return v1.compareTo(v2) < 0;
+    }
+
+    /**
+     * 判断是否v1是否等于v2
+     *
+     * @param v1 原始值
+     * @param v2 待比值
+     */
+    public static Boolean judgeBigDecimalEqual(BigDecimal v1, BigDecimal v2) {
+        return v1.compareTo(v2) == 0;
+    }
+
+    /**
+     * 返回相加数据
+     *
+     * @param v1 原始值
+     * @param v2 待加值
+     */
+    public static BigDecimal getBigDecimalAdd(BigDecimal v1, BigDecimal v2) {
+        return v1.add(v2);
+    }
+
+    /**
+     * 返回相减数据
+     *
+     * @param v1 原始值
+     * @param v2 待减值
+     */
+    public static BigDecimal getBigDecimalSubtract(BigDecimal v1, BigDecimal v2) {
+        return v1.subtract(v2);
+    }
+
+    /**
+     * 返回相乘数据
+     *
+     * @param v1  原始值
+     * @param v2  待乘值
+     * @param num 保留位数
+     */
+    public static BigDecimal getBigDecimalMultiply(BigDecimal v1, BigDecimal v2, int num) {
+        return getBigDecimalRetain(v1.multiply(v2), num);
+    }
+
+    /**
+     * 返回相除数据
+     *
+     * @param v1  被除数
+     * @param v2  除数
+     * @param num 保留位数
+     */
+    public static BigDecimal getBigDecimalDivide(BigDecimal v1, BigDecimal v2, int num) {
+        return v1.divide(v2, num, BigDecimal.ROUND_HALF_UP);
+    }
+
+    /**
+     * 返回保留2位数的四舍五入数据
+     *
+     * @param v 值
+     */
+    public static BigDecimal getBigDecimalRetain(BigDecimal v) {
+        return getBigDecimalRetain(v, 2);
+    }
+
+    /**
+     * 返回指定保留位数的四舍五入数据
+     *
+     * @param v   值
+     * @param num 位数
+     */
+    public static BigDecimal getBigDecimalRetain(BigDecimal v, int num) {
+        return getBigDecimalValue(v).setScale(num, BigDecimal.ROUND_HALF_UP);
+    }
+
+    /**
+     * 返回截取2位数的数据【不四舍五入】
+     *
+     * @param v 值
+     */
+    public static BigDecimal getBigDecimalIntercept(BigDecimal v) {
+        return getBigDecimalIntercept(v, 2);
+    }
+
+    /**
+     * 返回指定截取位数的数据【不四舍五入】
+     *
+     * @param v   值
+     * @param num 位数
+     */
+    public static BigDecimal getBigDecimalIntercept(BigDecimal v, int num) {
+        return getBigDecimalValue(v).setScale(num, BigDecimal.ROUND_DOWN);
+    }
+
+    public static BigDecimal getBigDecimalValue(BigDecimal v) {
+        return getBigDecimalValue(v, "0");
+    }
+
+    public static BigDecimal getBigDecimalValue(BigDecimal v, String def) {
+        if (v != null) {
+            return v;
+        } else {
+            return new BigDecimal(def);
+        }
+    }
+    //endregion
+
+    public static String getFormatDate(Date v) {
+        return getFormatDate(v, "");
+    }
+
+    public static String getFormatDate(Date v, String format) {
+        try {
+            if (format == null || format.isEmpty()) {
+                format = "yyyy-MM-dd HH:mm:ss";
+            }
+            SimpleDateFormat simpleDateFormat = new SimpleDateFormat(format);
+            return simpleDateFormat.format(v);
+        } catch (Exception ex) {
+            throw new CommonException(ex.getMessage());
+        }
+    }
+
+    //endregion
+
+    //region [对时间进行相应的处理]
+
+    //获取当前月份加指定月数的月份第一天
+    public static String getFirstDayOfMonth(int month) {
+        Calendar c = Calendar.getInstance();
+        c.add(Calendar.MONTH, month);
+        //设置为1号,当前日期既为本月第一天
+        c.set(Calendar.DAY_OF_MONTH, 1);
+        return getFormatDate(c.getTime(), "yyyy-MM-dd");
+    }
+
+    //获取当前月份的第一天
+    public static String getFirstDayOfMonth() {
+        Calendar c = Calendar.getInstance();
+        c.add(Calendar.MONTH, 0);
+        //设置为1号,当前日期既为本月第一天
+        c.set(Calendar.DAY_OF_MONTH, 1);
+        return getFormatDate(c.getTime(), "yyyy-MM-dd");
+    }
+
+    //获取给定日期月份的第一天
+    public static String getFirstDayOfMonth(Date date) {
+        Calendar c = Calendar.getInstance();
+        c.setTime(date);
+        c.add(Calendar.MONTH, 0);
+        //设置为1号,当前日期既为本月第一天
+        c.set(Calendar.DAY_OF_MONTH, 1);
+        return getFormatDate(c.getTime(), "yyyy-MM-dd");
+    }
+
+    //获取当前月份加指定月数的月份最后一天:
+    public static String getLastDayOfMonth(int month) {
+        //获取当前月最后一天
+        Calendar c = Calendar.getInstance();
+        c.add(Calendar.MONTH, month);
+        c.set(Calendar.DAY_OF_MONTH, c.getActualMaximum(Calendar.DAY_OF_MONTH));
+        return getFormatDate(c.getTime(), "yyyy-MM-dd");
+    }
+
+    //获取当前月最后一天:
+    public static String getLastDayOfMonth() {
+        //获取当前月最后一天
+        Calendar c = Calendar.getInstance();
+        c.set(Calendar.DAY_OF_MONTH, c.getActualMaximum(Calendar.DAY_OF_MONTH));
+        return getFormatDate(c.getTime(), "yyyy-MM-dd");
+    }
+
+    //获取给定日期月份最后一天:
+    public static String getLastDayOfMonth(Date date) {
+        Calendar c = Calendar.getInstance();
+        c.setTime(date);
+        c.set(Calendar.DAY_OF_MONTH, c.getActualMaximum(Calendar.DAY_OF_MONTH));
+        return getFormatDate(c.getTime(), "yyyy-MM-dd");
+    }
+
+    /**
+     * 得到加N周后的周一
+     *
+     * @return yyyy-MM-dd
+     */
+    public static String getFirstDayOfWeek(int week) {
+        Calendar c = Calendar.getInstance();
+        c.add(Calendar.WEEK_OF_MONTH, week);
+        int day_of_week = c.get(Calendar.DAY_OF_WEEK) - 1;
+        if (day_of_week == 0) {
+            day_of_week = 7;
+        }
+        c.add(Calendar.DATE, -day_of_week + 1);
+        System.out.println(c.getTime());
+        return getFormatDate(c.getTime(), "yyyy-MM-dd");
+    }
+
+    /**
+     * 得到本周周一
+     *
+     * @return yyyy-MM-dd
+     */
+    public static String getFirstDayOfWeek() {
+        Calendar c = Calendar.getInstance();
+        int day_of_week = c.get(Calendar.DAY_OF_WEEK) - 1;
+        if (day_of_week == 0) {
+            day_of_week = 7;
+        }
+        c.add(Calendar.DATE, -day_of_week + 1);
+        System.out.println(c.getTime());
+        return getFormatDate(c.getTime(), "yyyy-MM-dd");
+    }
+
+    /**
+     * 得到给定日期的周一
+     *
+     * @return yyyy-MM-dd
+     */
+    public static String getFirstDayOfWeek(Date date) {
+        Calendar c = Calendar.getInstance();
+        c.setTime(date);
+        int day_of_week = c.get(Calendar.DAY_OF_WEEK) - 1;
+        if (day_of_week == 0) {
+            day_of_week = 7;
+        }
+        c.add(Calendar.DATE, -day_of_week + 1);
+        System.out.println(c.getTime());
+        return getFormatDate(c.getTime(), "yyyy-MM-dd");
+    }
+
+    /**
+     * 得到加N周后的周日
+     *
+     * @return yyyy-MM-dd
+     */
+    public static String getLastDayOfWeek(int week) {
+        Calendar c = Calendar.getInstance();
+        c.add(Calendar.WEEK_OF_MONTH, week);
+        int day_of_week = c.get(Calendar.DAY_OF_WEEK) - 1;
+        if (day_of_week == 0) {
+            day_of_week = 7;
+        }
+        c.add(Calendar.DATE, -day_of_week + 7);
+        return getFormatDate(c.getTime(), "yyyy-MM-dd");
+    }
+
+    /**
+     * 得到本周周日
+     *
+     * @return yyyy-MM-dd
+     */
+    public static String getLastDayOfWeek() {
+        Calendar c = Calendar.getInstance();
+        int day_of_week = c.get(Calendar.DAY_OF_WEEK) - 1;
+        if (day_of_week == 0) {
+            day_of_week = 7;
+        }
+        c.add(Calendar.DATE, -day_of_week + 7);
+        return getFormatDate(c.getTime(), "yyyy-MM-dd");
+    }
+
+    /**
+     * 得到给定日期的周日
+     *
+     * @return yyyy-MM-dd
+     */
+    public static String getLastDayOfWeek(Date date) {
+        Calendar c = Calendar.getInstance();
+        c.setTime(date);
+        int day_of_week = c.get(Calendar.DAY_OF_WEEK) - 1;
+        if (day_of_week == 0) {
+            day_of_week = 7;
+        }
+        c.add(Calendar.DATE, -day_of_week + 7);
+        return getFormatDate(c.getTime(), "yyyy-MM-dd");
+    }
+
+    /**
+     * 获取给定日期是星期几
+     *
+     * @param date
+     * @return 当前日期是星期几
+     */
+    public static int getWeekOfDate(Date date) {
+        Calendar c = Calendar.getInstance();
+        c.setTime(date);
+        int w = c.get(Calendar.DAY_OF_WEEK) - 1;
+        if (w <= 0) {
+            w = 7;
+        }
+        return w;
+    }
+
+    /**
+     * 计算两个日期之间相差的天数
+     *
+     * @param smdate 较小的时间
+     * @param bdate  较大的时间
+     * @return 相差天数
+     * @throws ParseException
+     */
+    public static Integer daysBetween(Date smdate, Date bdate) throws ParseException {
+        try {
+            SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
+            smdate = sdf.parse(sdf.format(smdate));
+            bdate = sdf.parse(sdf.format(bdate));
+            Calendar cal = Calendar.getInstance();
+            cal.setTime(smdate);
+            long time1 = cal.getTimeInMillis();
+            cal.setTime(bdate);
+            long time2 = cal.getTimeInMillis();
+            long between_days = (time2 - time1) / (1000 * 3600 * 24);
+            return Integer.parseInt(String.valueOf(between_days));
+        } catch (Exception e) {
+            throw new CommonException(e.getMessage());
+        }
+
+    }
+
+    /**
+     * 计算两个日期之间相差的分钟
+     *
+     * @param smdate 较小的时间
+     * @param bdate  较大的时间
+     * @return 相差分钟数
+     */
+    public static Integer minuteBetween(Date smdate, Date bdate) {
+        try {
+            SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
+            smdate = sdf.parse(sdf.format(smdate));
+            bdate = sdf.parse(sdf.format(bdate));
+            Calendar cal = Calendar.getInstance();
+            cal.setTime(smdate);
+            long time1 = cal.getTimeInMillis();
+            cal.setTime(bdate);
+            long time2 = cal.getTimeInMillis();
+            long between_minute = (time2 - time1) / (1000 * 60);
+            return Integer.parseInt(String.valueOf(between_minute));
+        } catch (Exception e) {
+            throw new CommonException(e.getMessage());
+        }
+
+    }
+
+    /**
+     * 计算两个日期之间相差的秒钟
+     *
+     * @param smdate 较小的时间
+     * @param bdate  较大的时间
+     * @return 相秒钟数
+     */
+    public static Integer secondBetween(Date smdate, Date bdate) {
+        try {
+            SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
+            smdate = sdf.parse(sdf.format(smdate));
+            bdate = sdf.parse(sdf.format(bdate));
+            Calendar cal = Calendar.getInstance();
+            cal.setTime(smdate);
+            long time1 = cal.getTimeInMillis();
+            cal.setTime(bdate);
+            long time2 = cal.getTimeInMillis();
+            long between_Between = (time2 - time1) / 1000;
+            return Integer.parseInt(String.valueOf(between_Between));
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+        return null;
+    }
+
+    //返回只有年月日的时间格式
+    public static Date getString2Date(String strDate) {
+        return getString2Date(strDate, "yyyy-MM-dd");
+    }
+
+    //返回相应格式的时间
+    public static Date getString2Date(String strDate, String format) {
+        Date date;
+        try {
+            date = new SimpleDateFormat(format).parse(strDate);
+        } catch (Exception e) {
+            throw new CommonException(e.getMessage());
+        }
+        return date;
+    }
+
+    /**
+     * 将指定的年月日加上相应的数字后返回新的时间
+     *
+     * @param date  – 日期
+     * @param type  – 加减类型 y年m月d日 h小时mm分s秒
+     * @param value – 加上的数值 如果为负数,则为减去
+     * @return 返回增加后的Date
+     */
+    public static Date dateAdd(Date date, String type, int value) {
+        try {
+            Calendar cal = Calendar.getInstance();
+            cal.setTime(date);
+            if ("d".equals(type)) {
+                //日期加减N天
+                cal.add(Calendar.DAY_OF_YEAR, value);
+            } else if ("m".equals(type)) {
+                //日期加减N个月
+                cal.add(Calendar.MONTH, value);
+            } else if ("y".equals(type)) {
+                //日期加减N年
+                cal.add(Calendar.YEAR, value);
+            } else if ("h".equals(type)) {
+                //日期加减小时
+                cal.add(Calendar.HOUR, value);
+            } else if ("mm".equals(type)) {
+                //日期加减分钟
+                cal.add(Calendar.MINUTE, value);
+            } else if ("s".equals(type)) {
+                //日期加减秒
+                cal.add(Calendar.SECOND, value);
+            }
+            return cal.getTime();
+        } catch (Exception e) {
+            throw new CommonException(e.getMessage());
+        }
+
+    }
+
+    //endregion
+
+    //region [对文本的一些转换处理操作]
+
+    /**
+     * 去除编辑器文本格式
+     *
+     * @param str 要操作的文本
+     */
+    public static String removeFormat(String str) {
+        String inStr = str;
+        if (!getStringValue(str).trim().equals("")) {
+            inStr = str.replaceAll("</?[^>]+>", "");
+        }
+        return inStr;
+    }
+
+    /**
+     * 将字符串格式化成HTML代码
+     *
+     * @param str 要格式化的字符串
+     */
+    public static String textToHtml(String str) {
+        String inStr = str;
+        if (!getStringValue(str).trim().equals("")) {
+            inStr = inStr.replace("&", "&amp;");
+            inStr = inStr.replace("<", "&lt;");
+            inStr = inStr.replace(">", "&gt;");
+            inStr = inStr.replace("\r\n", "<br>");
+            inStr = inStr.replace("\n", "<br>");
+            inStr = inStr.replace("\t", " ");
+            inStr = inStr.replace(" ", "&nbsp;");
+        }
+        return inStr;
+    }
+
+    /**
+     * 将HTML代码转化成文本格式
+     *
+     * @param str 要格式化的字符串
+     */
+    public static String htmlToText(String str) {
+        String inStr = str;
+        if (!getStringValue(str).trim().equals("")) {
+            inStr = inStr.replace("&nbsp;", " ");
+            inStr = inStr.replace("<br>", "\r\n");
+            inStr = inStr.replace("&lt;", "<");
+            inStr = inStr.replace("&gt;", ">");
+            inStr = inStr.replace("&amp;", "&");
+        }
+        return inStr;
+    }
+
+    /**
+     * 截取规定字符数字符串,必须保证str不等于null(如果字符串含有html代码先转成文本再截取)
+     *
+     * @param str  原是字符串
+     * @param num  规定的长度
+     * @param spot 是否加省略点...
+     */
+    public static String subStringNumber(String str, int num, Boolean spot) {
+        String strSpot = spot ? "..." : "";
+        String stur = removeFormat(str).trim();
+        if (stur.length() > num) {
+            stur = stur.substring(0, num) + strSpot;
+        }
+        return stur;
+    }
+
+    /**
+     * 截取规定字节数字符串,必须保证str不等于null(如果字符串含有html代码先转成文本再截取)
+     *
+     * @param str  原是字符串
+     * @param num  规定的字节长度
+     * @param spot 是否加省略点...
+     */
+    public static String subStringBytes(String str, int num, Boolean spot) {
+        String strSpot = spot ? "..." : "";
+        String stur = removeFormat(str).trim();
+        byte[] bytes = stur.getBytes();
+        if (bytes.length > num) {
+            for (int i = 1; i <= stur.length(); i++) {
+                //这里已经处理掉了如截取6个字节“abcde薛”这种情况
+                byte[] bytesFor = stur.trim().substring(0, i).getBytes();
+                //如果当前截取的字符串字节数大于了要求的字节数,那取上一次截取的值
+                if (bytesFor.length > num) {
+                    stur = stur.substring(0, (i - 1)) + strSpot;
+                    return stur;
+                }
+            }
+        }
+        return stur;
+    }
+
+    /**
+     * 将字符串一部分隐藏为规定个数的“*”号,begin大于或等于字符长度返回原字符串
+     *
+     * @param str   要处理的字符串
+     * @param begin 显示几个字符后开始隐藏
+     * @param num   隐藏为“*”的字符数量
+     */
+    public static String replaceStr(String str, int begin, int num) {
+        String inStr = getStringValue(str).trim();
+        StringBuilder retStr = new StringBuilder();
+        if (inStr.length() >= (begin + num)) {
+            retStr.append(inStr, 0, begin);
+            for (int i = 0; i < num; i++) {
+                retStr.append("*");
+            }
+            retStr.append(inStr.substring(begin + num));
+        } else {
+            if (inStr.length() > begin) {
+                retStr.append(inStr, 0, begin);
+                for (int i = 0; i < inStr.length() - begin; i++) {
+                    retStr.append("*");
+                }
+            } else {
+                return inStr;
+            }
+        }
+        return retStr.toString();
+    }
+
+
+    /**
+     * 给字符串Base64编码并替换相应的字符
+     *
+     * @param text 要编码的字符串n
+     */
+    public static String encoderString(String text) throws Exception {
+        try {
+            Base64.Encoder encoder = Base64.getEncoder();
+            return encoder.encodeToString(text.getBytes(StandardCharsets.UTF_8));
+        } catch (Exception e) {
+            throw new CommonException(e.getMessage());
+        }
+
+    }
+
+    /**
+     * 给字Base64符串解码【有时密文的“+”号会被转为空格,里面要处理下】
+     *
+     * @param text 要解码的字符串
+     */
+    public static String decodeString(String text) throws Exception {
+        try {
+            return new String(Base64.getDecoder().decode(text.replaceAll(" ", "+")));
+        } catch (Exception e) {
+            throw new CommonException(e.getMessage());
+        }
+    }
+
+
+    //UTF-8+BOM编码转化为普通的UTF-8编码
+    public static String replaceUTF8Bom(String str) {
+        return str.replace("\uFEFF", "");
+    }
+
+    /**
+     * 特殊符号转码 utf-8
+     */
+    public static String encodeUrlComponent(String str) {
+        String result = null;
+
+        try {
+            result = URLEncoder.encode(str, "UTF-8");
+        } catch (UnsupportedEncodingException e) {
+            result = str;
+        }
+        return result;
+    }
+
+    /**
+     * 解码 utf-8
+     */
+    public static String decoderString(String str) {
+        String result = "";
+        if (null == str) {
+            return "";
+        }
+        try {
+            result = URLDecoder.decode(str, "UTF-8");
+        } catch (UnsupportedEncodingException e) {
+            return null;
+        }
+        return result;
+    }
+
+    /**
+     * 加上http协议
+     */
+    public static String httpStr(String url) {
+        if (url.startsWith("http:") || url.startsWith("https:")) {
+            return url;
+        }
+        return "http:" + url;
+    }
+
+    /**
+     * 用于维易淘获取优惠卷金额。【格式都是“满xx元减xx元】
+     */
+    public static String splitMoney(String str) {
+        String s = str.split("元")[1];
+        return s.replace("减", "");
+    }
+
+    /**
+     * 获取图片,格式:<img size=790x1178>//**.jpg</img>
+     */
+    public static String splitImage(String str) {
+        String img = null;
+        Pattern compile = Pattern.compile("//.*.</img>");
+        Matcher matcher = compile.matcher(str);
+        while (matcher.find()) {
+            img = matcher.group();
+        }
+        if (img == null) {
+            return null;
+        }
+        return img.replace("</img>", "");
+    }
+
+    /**
+     * 拼多多的累计销量是字符串格式,格式其中为 "10万"
+     */
+    public static Integer splitSales(String volume) {
+        volume = volume.replaceAll("\\+", "");
+        if (volume.contains("万")) {
+            String str = volume.split("万")[0];
+            float number = (Float.parseFloat(str) * 10000);
+            return (int) number;
+        }
+        return Integer.valueOf(volume);
+    }
+
+
+    /**
+     * 返回随机N位整数
+     */
+    public static int getRandomNumber(int num) {
+        if (num <= 0) {
+            num = 1;
+        }
+        StringBuilder code = new StringBuilder();
+        Random random = new Random();
+        for (int i = 0; i < num; i++) {
+            code.append(random.nextInt(10));
+        }
+        return Integer.parseInt(code.toString());
+    }
+
+    /**
+     * 正则验证
+     *
+     * @param rgx 表达式
+     * @param res 值
+     */
+    public static boolean isCorrect(String rgx, String res) {
+        Pattern p = Pattern.compile(rgx);
+        Matcher m = p.matcher(res);
+        return m.matches();
+    }
+
+    /**
+     * 验证手机号码
+     *
+     * @param number 手机号
+     */
+    public static boolean phoneJudge(String number) {
+        //String rgx = "^((13[0-9])|(15[0-9])|(18[0-9])|(19[0-9])|(17[0-9]))\\d{8}$";
+        String rgx = "^1\\d{10}$";
+        return isCorrect(rgx, number);
+    }
+
+    /**
+     * 验证身份证号码
+     *
+     * @param number 身份证
+     */
+    public static boolean idCardJudge(String number) {
+        String rgx = "^\\d{15}|^\\d{17}([0-9]|X|x)$";
+        return isCorrect(rgx, number);
+    }
+
+    /**
+     * 验证护照号码
+     *
+     * @param number 护照
+     */
+    public static boolean passportJudge(String number) {
+        String rgx1 = "^[a-zA-Z]{5,17}$";
+        String rgx2 = "^[a-zA-Z0-9]{5,17}$";
+        return (isCorrect(rgx1, number) || isCorrect(rgx2, number));
+    }
+}

+ 45 - 0
yqk-common/src/main/java/com/yx/face/boot/uitls/CookieUtils.java

@@ -0,0 +1,45 @@
+package com.yx.face.boot.uitls;
+
+import javax.servlet.http.Cookie;
+import javax.servlet.http.HttpServletRequest;
+
+/**
+ * @description: CookieUtils <br>
+ * @date: 2021/3/31 18:48 <br>
+ * @author: PWB <br>
+ */
+public class CookieUtils {
+
+    public static Cookie getCookie(HttpServletRequest request, String cookieName) {
+        Cookie[] cookies = request.getCookies();
+        if (cookies != null && cookies.length > 0) {
+            for (Cookie value : cookies) {
+                if (value.getName().equals(cookieName)) {
+                    return value;
+                }
+            }
+        }
+        return null;
+    }
+
+    public static String getCookieValue(HttpServletRequest request, String cookieName) {
+        Cookie cookie = getCookie(request, cookieName);
+        if (cookie != null) {
+            return cookie.getValue();
+        } else {
+            return null;
+        }
+    }
+
+    public static Cookie getCookie(Cookie[] cookies, String cookieName) {
+        if (null != cookies) {
+            for (Cookie cookie : cookies) {
+                if (cookie.getName().equals(cookieName)) {
+                    return cookie;
+                }
+            }
+        }
+        return null;
+    }
+
+}

+ 77 - 0
yqk-common/src/main/java/com/yx/face/boot/uitls/DESUtil.java

@@ -0,0 +1,77 @@
+package com.yx.face.boot.uitls;
+
+import org.apache.commons.codec.binary.Base64;
+
+import javax.crypto.*;
+import javax.crypto.spec.DESedeKeySpec;
+import java.nio.charset.Charset;
+import java.security.InvalidKeyException;
+import java.security.NoSuchAlgorithmException;
+import java.security.spec.InvalidKeySpecException;
+
+
+/**
+ * @ProjectName: face-server
+ * @Package: com.yx.face.boot.uitls
+ * @ClassName: DESUtil
+ * @Author: 崔哥
+ * @Description:
+ * @Date: 2021/10/10 15:31
+ * @Version: 1.0
+ */
+public class DESUtil {
+
+
+    private static final String KEY_ALGORITHM = "DESede";
+
+    private static final String CIPHER_ALGORITHM = "DESede/ECB/PKCS5Padding";
+    private static final String ENCODING = "UTF-8";
+
+    /**
+     * 加密
+     *
+     * @param data 参数json字符串
+     * @param key  平台提供的deskey
+     * @return
+     */
+    public static String encrypt(String data, String key) {
+        byte[] encrypt = encrypt(data.getBytes(Charset.forName(ENCODING)), key);
+        return encrypt == null ? null : Base64.encodeBase64String(encrypt);
+    }
+
+    private static byte[] encrypt(byte[] data, String key) {
+        try {
+            //实例化Des密钥
+            DESedeKeySpec dks = new DESedeKeySpec(key.getBytes());
+            //实例化密钥工厂
+            SecretKeyFactory keyFactory = SecretKeyFactory.getInstance(KEY_ALGORITHM);
+            //生成密钥
+            SecretKey secretKey = keyFactory.generateSecret(dks);
+            //实例化
+            Cipher cipher = Cipher.getInstance(CIPHER_ALGORITHM);
+            //初始化,设置为加密模式
+            cipher.init(Cipher.ENCRYPT_MODE, secretKey);
+            return cipher.doFinal(data);
+        } catch (InvalidKeyException e) {
+            e.printStackTrace();
+        } catch (NoSuchAlgorithmException e) {
+            e.printStackTrace();
+        } catch (InvalidKeySpecException e) {
+            e.printStackTrace();
+        } catch (NoSuchPaddingException e) {
+            e.printStackTrace();
+        } catch (IllegalBlockSizeException e) {
+            e.printStackTrace();
+        } catch (BadPaddingException e) {
+            e.printStackTrace();
+        }
+        return null;
+    }
+
+    public static void main(String[] args) {
+        String deskey = "c75a61acbc7b48cca67187de9c81c2fe";
+        String data = "{\"idenNo\":\"91330104MA2J0CP852\"}";
+        System.out.println(encrypt(data, deskey));
+    }
+
+}

+ 674 - 0
yqk-common/src/main/java/com/yx/face/boot/uitls/DateUtils.java

@@ -0,0 +1,674 @@
+package com.yx.face.boot.uitls;
+
+
+import org.apache.commons.lang3.StringUtils;
+import org.apache.commons.lang3.time.DateFormatUtils;
+
+import java.lang.management.ManagementFactory;
+import java.math.BigDecimal;
+import java.text.ParseException;
+import java.text.SimpleDateFormat;
+import java.util.*;
+
+/**
+ * 时间工具类
+ */
+public class DateUtils extends org.apache.commons.lang3.time.DateUtils {
+
+    public static String YYYY = "yyyy";
+
+    public static String MIN = "min";
+
+    public static String MAX = "max";
+
+    public static String YYYY_MM = "yyyy-MM";
+
+    public static String YYYYMM = "yyyyMM";
+
+    public static String YYYY_MM_DD = "yyyy-MM-dd";
+
+    public static String YYYY_MM_01 = "yyyy-MM-01";
+
+    public static String YYYYMMDDHHMMSS = "yyyyMMddHHmmss";
+
+    public static String YYYY_MM_DD_HH_MM_SS = "yyyy-MM-dd HH:mm:ss";
+
+    public static String CN_YYYY_MM_DD_HH_MM = "yyyy年MM月dd日 HH:mm";
+
+    public static String YYYY_MM_DD_T_HH_MM_SS = "yyyy-MM-dd'T'HH:mm:ss";
+
+    public static String HH_MM_SS = "HH-mm-ss";
+
+    public static String HH_MM = "HH:mm";
+
+    public static String MM_DD_HH_MM = "MM-dd HH:mm";
+
+    private static String[] parsePatterns = {
+            "yyyy-MM-dd", "yyyy-MM-dd HH:mm:ss", "yyyy-MM-dd HH:mm", "yyyy-MM",
+            "yyyy/MM/dd", "yyyy/MM/dd HH:mm:ss", "yyyy/MM/dd HH:mm", "yyyy/MM",
+            "yyyy.MM.dd", "yyyy.MM.dd HH:mm:ss", "yyyy.MM.dd HH:mm", "yyyy.MM"};
+
+    /**
+     * 获取当前Date型日期
+     *
+     * @return Date() 当前日期
+     */
+    public static Date getNowDate() {
+        return new Date();
+    }
+
+    /**
+     * 获取当前日期, 默认格式为yyyy-MM-dd
+     *
+     * @return String
+     */
+    public static String getDate() {
+        return dateTimeNow(YYYY_MM_DD);
+    }
+
+    /**
+     * 获取当前日期, 默认格式为MM-dd HH:mm
+     *
+     * @return String
+     */
+    public static String getMDHMDate() {
+        return dateTimeNow(MM_DD_HH_MM);
+    }
+
+    /**
+     * 获取当前日期, 默认格式为MM-dd HH:mm
+     *
+     * @return String
+     */
+    public static String getMDHMDate(Date date) {
+        return dateTimeNow(MM_DD_HH_MM, date);
+    }
+
+
+    public static String getTime() {
+        return dateTimeNow(YYYY_MM_DD_HH_MM_SS);
+    }
+
+    public static String dateTimeNow() {
+        return dateTimeNow(YYYYMMDDHHMMSS);
+    }
+
+    public static String dateTimeNow(final String format) {
+        return parseDateToStr(format, new Date());
+    }
+
+    public static String dateTimeNow(final String format, Date date) {
+        return parseDateToStr(format, date);
+    }
+
+    public static String dateTime(final Date date) {
+        return parseDateToStr(YYYY_MM_DD, date);
+    }
+
+    public static String parseDateToStr(final String format, final Date date) {
+        return new SimpleDateFormat(format).format(date);
+    }
+
+    /**
+     * @param date 指定日期<br>
+     * @return long 周几<br>
+     * @description: 获取指定日期是那周的周几 <br>
+     * @date: 2021/5/21 20:53 <br>
+     * @author: PWB <br>
+     */
+    public static int getWeek(Date date) {
+        Calendar cal = Calendar.getInstance();
+        cal.setTime(date);
+        return cal.get(Calendar.DAY_OF_WEEK) - 1;
+    }
+
+
+    public static Date dateTime(final String format, final String ts) {
+        try {
+            return new SimpleDateFormat(format).parse(ts);
+        } catch (ParseException e) {
+            throw new RuntimeException(e);
+        }
+    }
+
+    /**
+     * 日期路径 即年/月/日 如2018/08/08
+     */
+    public static String datePath() {
+        Date now = new Date();
+        return DateFormatUtils.format(now, "yyyy/MM/dd");
+    }
+
+    /**
+     * 日期路径 即年/月/日 如20180808
+     */
+    public static String dateTime() {
+        final Date now = new Date();
+        return DateFormatUtils.format(now, "yyyyMMdd");
+    }
+
+    /**
+     * 日期型字符串转化为日期 格式
+     */
+    public static Date parseDate(Object str) {
+        if (str == null) {
+            return null;
+        }
+        try {
+            return parseDate(str.toString(), parsePatterns);
+        } catch (ParseException e) {
+            return null;
+        }
+    }
+
+    /**
+     * 获取服务器启动时间
+     */
+    public static Date getServerStartDate() {
+        long time = ManagementFactory.getRuntimeMXBean().getStartTime();
+        return new Date(time);
+    }
+
+
+    /**
+     * 计算两个时间差
+     */
+    public static String getDatePoor(Date endDate, Date nowDate) {
+        // 获得两个时间的毫秒时间差异
+        long diff = endDate.getTime() - nowDate.getTime();
+        // 计算差多少天
+        long day = diff / MILLIS_PER_DAY;
+        // 计算差多少小时
+        long hour = diff % MILLIS_PER_DAY / MILLIS_PER_HOUR;
+        // 计算差多少分钟
+        long min = diff % MILLIS_PER_DAY % MILLIS_PER_HOUR / MILLIS_PER_MINUTE;
+        // 计算差多少秒//输出结果
+        long sec = diff % MILLIS_PER_DAY % MILLIS_PER_HOUR % MILLIS_PER_MINUTE / MILLIS_PER_SECOND;
+        return String.format("%02d", hour) + ":" + String.format("%02d", min) + ":" + String.format("%02d", sec);
+    }
+
+    public static int getDatePoorHour(Date endDate, Date nowDate) {
+        // 获得两个时间的毫秒时间差异
+        long diff = endDate.getTime() - nowDate.getTime();
+        // 计算差多少小时
+        long hour = diff / (1000 * 60 * 60);
+        return Math.abs((int) hour);
+    }
+
+    //计算两个时间的时间差 并转为白话文
+    public static String doTransformDate(Date endDate, Date beginDate) {
+        if (endDate == null || beginDate == null) {
+            return null;
+        }
+        long diff = endDate.getTime() - beginDate.getTime();
+        if (diff < 0) {
+            return null;
+        }
+        // 计算差多少天
+        long day = diff / MILLIS_PER_DAY;
+        // 计算差多少小时
+        long hour = diff % MILLIS_PER_DAY / MILLIS_PER_HOUR;
+        // 计算差多少分钟
+        long min = diff % MILLIS_PER_DAY % MILLIS_PER_HOUR / MILLIS_PER_MINUTE;
+        // 计算差多少秒//输出结果
+        // long sec = diff % MILLIS_PER_DAY % MILLIS_PER_HOUR % MILLIS_PER_MINUTE / MILLIS_PER_SECOND;
+        if (day == 0 && hour == 0) {
+            return min + "分钟";
+        }
+        if (day == 0) {
+            return hour + "小时" + min + "分钟";
+        }
+        return day + "天" + hour + "小时" + min + "分钟";
+    }
+
+    /**
+     * 获取两个时间之间的年月
+     */
+    public static List<Date> getYearMonth(Date start, Date end) {
+        List<Date> list = new ArrayList<>();
+        //格式化为年月
+        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM");
+        Calendar min = Calendar.getInstance();
+        Calendar max = Calendar.getInstance();
+        min.setTime(start);
+        min.set(min.get(Calendar.YEAR), min.get(Calendar.MONTH), 1);
+        max.setTime(end);
+        max.set(max.get(Calendar.YEAR), max.get(Calendar.MONTH), 2);
+        while (min.before(max)) {
+            list.add(min.getTime());
+            min.add(Calendar.MONTH, 1);
+        }
+        return list;
+    }
+
+
+    public static List<String> getSevenDays(Date date) {
+        Calendar calendar = Calendar.getInstance();
+        calendar.setTime(date);
+        Date endDate = calendar.getTime();
+        calendar.set(Calendar.DATE, calendar.get(Calendar.DATE) - 6);
+        Date startDate = calendar.getTime();
+        List<Date> dates = findDates(startDate, endDate);
+        List<String> result = new ArrayList<>();
+        for (Date d : dates) {
+            result.add(DateUtils.parseDateToStr(DateUtils.YYYY_MM_DD, d));
+        }
+        return result;
+    }
+
+
+    public static List<Date> findDates(Date dBegin, Date dEnd) {
+        List<Date> lDate = new ArrayList<>();
+        lDate.add(dBegin);
+        Calendar calBegin = Calendar.getInstance();
+        // 使用给定的 Date 设置此 Calendar 的时间
+        calBegin.setTime(dBegin);
+        Calendar calEnd = Calendar.getInstance();
+        // 使用给定的 Date 设置此 Calendar 的时间
+        calEnd.setTime(dEnd);
+        // 测试此日期是否在指定日期之后
+        while (dEnd.after(calBegin.getTime())) {
+            // 根据日历的规则,为给定的日历字段添加或减去指定的时间量
+            calBegin.add(Calendar.DAY_OF_MONTH, 1);
+            lDate.add(calBegin.getTime());
+        }
+        return lDate;
+    }
+
+    /**
+     * 根据当前日,加减日期
+     *
+     * @param day 日期 正数为+ ,负数为减
+     * @return 计算后的日期字符串 年月日 yyyy-MM-dd
+     */
+    public static String getCalculateDay(int day) {
+        Calendar cal = Calendar.getInstance();
+        cal.setTimeZone(TimeZone.getTimeZone("Asia/Shanghai"));
+        cal.add(Calendar.DATE, day);
+        Date d = cal.getTime();
+        SimpleDateFormat sp = new SimpleDateFormat(YYYY_MM_DD);
+        sp.setTimeZone(TimeZone.getTimeZone("Asia/Shanghai"));
+        return sp.format(d);
+    }
+
+
+    /**
+     * 时间戳转秒
+     */
+    public static Long getSeconds(Long Millisecond) {
+        double k = Math.round(Millisecond * 1.0 / 1000L);
+        double result = (int) Math.rint(k);
+        String str = new BigDecimal(result + "").toString();
+        return Long.valueOf(str);
+    }
+
+    public static Date getBeginTime() {
+        Calendar todayEnd = Calendar.getInstance();
+        todayEnd.set(Calendar.HOUR_OF_DAY, 0);
+        todayEnd.set(Calendar.MINUTE, 0);
+        todayEnd.set(Calendar.SECOND, 0);
+        todayEnd.set(Calendar.MILLISECOND, 0);
+        return todayEnd.getTime();
+    }
+
+
+    public static Date getEndTime() {
+        Calendar todayEnd = Calendar.getInstance();
+        todayEnd.set(Calendar.HOUR_OF_DAY, 23);
+        todayEnd.set(Calendar.MINUTE, 59);
+        todayEnd.set(Calendar.SECOND, 59);
+        todayEnd.set(Calendar.MILLISECOND, 999);
+        return todayEnd.getTime();
+    }
+
+    /**
+     * 判断是否超过多少小时 如:24
+     *
+     * @param tableTime 业务时间
+     * @param hour      多少小时
+     */
+    public static boolean judgmentDate(long tableTime, double hour) {
+        Date start = new Date(tableTime);
+        //业务时间
+        Date end = new Date();//当前时间
+        long cha = end.getTime() - start.getTime();
+        if (cha < 0) {
+            return false;
+        }
+        double result = cha * 1.0 / (1000 * 60 * 60);
+        return result <= hour;//是小于等于 hour 小时
+    }
+
+
+    /**
+     * 获取精确到秒的时间戳
+     */
+    public static int getSecondTimestamp(Date date) {
+        if (null == date) {
+            return 0;
+        }
+        String timestamp = String.valueOf(date.getTime());
+        int length = timestamp.length();
+        if (length > 3) {
+            return Integer.parseInt(timestamp.substring(0, length - 3));
+        } else {
+            return 0;
+        }
+    }
+
+
+    /**
+     * @param date 指定日期 <br>
+     * @return boolean <br>
+     * @description: 判断某个日期 是否 是今日 <br>
+     * @since: 1.0 <br>
+     * @date: 2020/7/10 10:16 <br>
+     * @author: PWB <br>
+     */
+    public static boolean isToday(Date date) {
+        Date now = new Date();
+        SimpleDateFormat sdf = new SimpleDateFormat(YYYY_MM_DD);
+        String todayStr = sdf.format(now);
+        return todayStr.equals(sdf.format(date));
+    }
+
+    //yesterday
+    public static boolean isYesterday(Date date) {
+        Date yesterday = addDays(new Date(), -1);
+        SimpleDateFormat sdf = new SimpleDateFormat(YYYY_MM_DD);
+        String yesterdayStr = sdf.format(yesterday);
+        return yesterdayStr.equals(sdf.format(date));
+    }
+
+    /**
+     * 通过long/1000 获取时间格式
+     *
+     * @return 计算后的日期字符串 YYYY_MM_DD_HH_MM_SS
+     */
+    public static String getDateStrByInt(int millions) {
+        Calendar cal = Calendar.getInstance();
+        cal.setTimeZone(TimeZone.getTimeZone("Asia/Shanghai"));
+        cal.setTimeInMillis((long) millions * 1000);
+        Date d = cal.getTime();
+        SimpleDateFormat sp = new SimpleDateFormat(YYYY_MM_DD_HH_MM_SS);
+        sp.setTimeZone(TimeZone.getTimeZone("Asia/Shanghai"));
+        return sp.format(d);
+    }
+
+    /**
+     * 获取一年后日期
+     *
+     * @return
+     */
+    public static Date getNextYearPreDay() {
+        Calendar ca = Calendar.getInstance();//得到一个Calendar的实例
+        ca.setTime(new Date());   //设置时间为当前时间
+        ca.add(Calendar.YEAR, +1); //年份+1
+        ca.add(Calendar.DATE, -1); // 日期-1
+        return ca.getTime();
+    }
+
+
+    /**
+     * 获取当前时间的最大值贺最小值
+     *
+     * @param millions 当前时间
+     * @param patterns min 和 max
+     */
+    public static int getIntStrByPatterns(int millions, String patterns) {
+        if (millions <= 0) {
+            return 0;
+        }
+        Date strtodate = null;
+        try {
+            final SimpleDateFormat format = new SimpleDateFormat(YYYY_MM_DD);
+            final Calendar cal = Calendar.getInstance();
+            cal.setTimeZone(TimeZone.getTimeZone("Asia/Shanghai"));
+            cal.setTimeInMillis((long) millions * 1000);
+            String formatDate = format.format(cal.getTime());
+            if ("min".equals(patterns)) {
+                cal.setTime(format.parse(formatDate));
+                cal.add(Calendar.DAY_OF_YEAR, 0);
+                strtodate = new Date(cal.getTime().getTime() + 1);
+            }
+            if ("max".equals(patterns)) {
+                cal.setTime(format.parse(formatDate));
+                cal.add(Calendar.DAY_OF_YEAR, 1);
+                strtodate = new Date(cal.getTime().getTime() - 1);
+            }
+        } catch (ParseException e) {
+            return 0;
+        }
+        if (strtodate == null) {
+            return 0;
+        }
+        return (int) (strtodate.getTime() / 1000);
+    }
+
+
+    /**
+     * 获取当月最后一天最大值
+     */
+    public static int getMonLastDay(int millions) {
+        if (millions <= 0) {
+            return 0;
+        }
+        Date strtodate = null;
+        try {
+            final SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd");
+            final Calendar calendar = Calendar.getInstance();
+            calendar.setTimeInMillis((long) millions * 1000);
+            String formatDate = format.format(calendar.getTime());
+            calendar.setTime(format.parse(formatDate));
+            calendar.set(Calendar.DAY_OF_MONTH, calendar.getActualMaximum(Calendar.DAY_OF_MONTH));
+            calendar.add(Calendar.DAY_OF_YEAR, 1);
+            strtodate = new Date(calendar.getTime().getTime() - 1);
+        } catch (ParseException e) {
+            return 0;
+        }
+        return (int) (strtodate.getTime() / 1000);
+    }
+
+
+    /**
+     * 获取当前时间格式化
+     *
+     * @param millions 时间int
+     */
+    public static int getIntGSH(int millions, String parent) {
+        if (millions <= 0) {
+            return 0;
+        }
+        Date strtodate = null;
+        try {
+            final SimpleDateFormat format = new SimpleDateFormat(parent);
+            final Calendar cal = Calendar.getInstance();
+            cal.setTimeZone(TimeZone.getTimeZone("Asia/Shanghai"));
+            cal.setTimeInMillis((long) millions * 1000);
+            String formatDate = format.format(cal.getTime());
+            cal.setTime(format.parse(formatDate));
+            strtodate = new Date(cal.getTime().getTime());
+
+        } catch (ParseException e) {
+            return 0;
+        }
+        return (int) (strtodate.getTime() / 1000);
+    }
+
+
+    /**
+     * 获取YYYYMMinter类型数据
+     *
+     * @return 计算后的日期字符串 YYYYMM
+     */
+    public static Integer getYYYYMMIntByInt(int millions) {
+        final Calendar cal = Calendar.getInstance();
+        cal.setTimeZone(TimeZone.getTimeZone("Asia/Shanghai"));
+        cal.setTimeInMillis((long) millions * 1000);
+        Date d = cal.getTime();
+        SimpleDateFormat sp = new SimpleDateFormat(YYYYMM);
+        sp.setTimeZone(TimeZone.getTimeZone("Asia/Shanghai"));
+        return Integer.parseInt(sp.format(d));
+    }
+
+    // 获得当天0点时间
+    public static Date getTimeMorning() {
+        final Calendar cal = Calendar.getInstance();
+        cal.set(Calendar.HOUR_OF_DAY, 0);
+        cal.set(Calendar.SECOND, 0);
+        cal.set(Calendar.MINUTE, 0);
+        cal.set(Calendar.MILLISECOND, 0);
+        return cal.getTime();
+
+
+    }
+
+    // 获得昨天0点时间
+    public static Date getYesterdayMorning() {
+        final Calendar cal = Calendar.getInstance();
+        cal.setTimeInMillis(getTimeMorning().getTime() - 3600 * 24 * 1000);
+        return cal.getTime();
+    }
+
+    // 获得当天近7天时间
+    public static Date getWeekFromNow() {
+        final Calendar cal = Calendar.getInstance();
+        cal.setTimeInMillis(getTimeMorning().getTime() - 3600 * 24 * 1000 * 7);
+        return cal.getTime();
+    }
+
+    // 获得当天24点时间
+    public static Date getTimeNight() {
+        final Calendar cal = Calendar.getInstance();
+        cal.set(Calendar.HOUR_OF_DAY, 24);
+        cal.set(Calendar.SECOND, 0);
+        cal.set(Calendar.MINUTE, 0);
+        cal.set(Calendar.MILLISECOND, 0);
+        return cal.getTime();
+    }
+
+    // 获得本周一0点时间
+    public static Date getTimeWeekMorning() {
+        final Calendar cal = Calendar.getInstance();
+        cal.set(cal.get(Calendar.YEAR), cal.get(Calendar.MONTH), cal.get(Calendar.DAY_OF_MONTH), 0, 0, 0);
+        cal.set(Calendar.DAY_OF_WEEK, Calendar.MONDAY);
+        return cal.getTime();
+    }
+
+    // 获得本周日24点时间
+    public static Date getTimeWeeknight() {
+        final Calendar cal = Calendar.getInstance();
+        cal.setTime(getTimeWeekMorning());
+        cal.add(Calendar.DAY_OF_WEEK, 7);
+        return cal.getTime();
+    }
+
+    // 获得本月第一天0点时间
+    public static Date getTimeMonthMorning() {
+        final Calendar cal = Calendar.getInstance();
+        cal.set(cal.get(Calendar.YEAR), cal.get(Calendar.MONTH), cal.get(Calendar.DAY_OF_MONTH), 0, 0, 0);
+        cal.set(Calendar.DAY_OF_MONTH, cal.getActualMinimum(Calendar.DAY_OF_MONTH));
+        return cal.getTime();
+    }
+
+    // 获得本月最后一天24点时间
+    public static Date getTimeMonthNight() {
+        final Calendar cal = Calendar.getInstance();
+        cal.set(cal.get(Calendar.YEAR), cal.get(Calendar.MONTH), cal.get(Calendar.DAY_OF_MONTH), 0, 0, 0);
+        cal.set(Calendar.DAY_OF_MONTH, cal.getActualMaximum(Calendar.DAY_OF_MONTH));
+        cal.set(Calendar.HOUR_OF_DAY, 24);
+        return cal.getTime();
+    }
+
+    public static Date getLastMonthStartMorning() {
+        Calendar cal = Calendar.getInstance();
+        cal.setTime(getTimeMonthMorning());
+        cal.add(Calendar.MONTH, -1);
+        return cal.getTime();
+    }
+
+    public static Date getCurrentQuarterStartTime() {
+        final Calendar c = Calendar.getInstance();
+        int currentMonth = c.get(Calendar.MONTH) + 1;
+        SimpleDateFormat longSdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
+        SimpleDateFormat shortSdf = new SimpleDateFormat("yyyy-MM-dd");
+        Date now = null;
+        try {
+            if (currentMonth <= 3)
+                c.set(Calendar.MONTH, 0);
+            else if (currentMonth <= 6)
+                c.set(Calendar.MONTH, 3);
+            else if (currentMonth <= 9)
+                c.set(Calendar.MONTH, 4);
+            else if (currentMonth <= 12)
+                c.set(Calendar.MONTH, 9);
+            c.set(Calendar.DATE, 1);
+            now = longSdf.parse(shortSdf.format(c.getTime()) + " 00:00:00");
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+        return now;
+    }
+
+    /**
+     * 当前季度的结束时间,即2012-03-31 23:59:59
+     */
+    public static Date getCurrentQuarterEndTime() {
+        final Calendar cal = Calendar.getInstance();
+        cal.setTime(getCurrentQuarterStartTime());
+        cal.add(Calendar.MONTH, 3);
+        return cal.getTime();
+    }
+
+
+    public static Date getCurrentYearStartTime() {
+        final Calendar cal = Calendar.getInstance();
+        cal.set(cal.get(Calendar.YEAR), Calendar.JANUARY, 1, 0, 0, 0);
+        cal.set(Calendar.DAY_OF_MONTH, cal.getActualMinimum(Calendar.YEAR));
+        return cal.getTime();
+    }
+
+    public static Date getCurrentYearEndTime() {
+        final Calendar cal = Calendar.getInstance();
+        cal.setTime(getCurrentYearStartTime());
+        cal.add(Calendar.YEAR, 1);
+        return cal.getTime();
+    }
+
+    public static Date getLastYearStartTime() {
+        final Calendar cal = Calendar.getInstance();
+        cal.setTime(getCurrentYearStartTime());
+        cal.add(Calendar.YEAR, -1);
+        return cal.getTime();
+    }
+
+    public static String getReduceEightTime(String time) {
+        try {
+            SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
+            Calendar cal = Calendar.getInstance();
+            if (StringUtils.isBlank(time)) {
+                cal.setTime(new Date());
+            } else {
+                Date date = sdf.parse(time);
+                cal.setTime(date);
+            }
+            cal.add(Calendar.HOUR_OF_DAY, -8);
+            Date dateTime = cal.getTime();
+            String format = sdf.format(dateTime);
+            return format;
+        } catch (ParseException e) {
+            e.printStackTrace();
+        }
+        return "";
+    }
+
+    public static Date parse(String dateString, String format) {
+        SimpleDateFormat sdf = new SimpleDateFormat(format);
+
+        try {
+            return sdf.parse(dateString);
+        } catch (ParseException var4) {
+            return null;
+        }
+    }
+}

+ 74 - 0
yqk-common/src/main/java/com/yx/face/boot/uitls/DownLoad.java

@@ -0,0 +1,74 @@
+package com.yx.face.boot.uitls;
+
+import sun.misc.BASE64Encoder;
+
+import java.io.*;
+import java.net.HttpURLConnection;
+import java.net.MalformedURLException;
+import java.net.URL;
+
+/**
+ * @ClassName DownLoad
+ * @Description
+ * @Author xrf
+ * @Date 2021/12/2 15:52
+ */
+public class DownLoad {
+    private static void downloadPicture(String urlList,String path) {
+        try {
+            URL url = new URL(urlList);
+            DataInputStream dataInputStream = new DataInputStream(url.openStream());
+            FileOutputStream fileOutputStream = new FileOutputStream(new File(path));
+            ByteArrayOutputStream output = new ByteArrayOutputStream();
+
+            byte[] buffer = new byte[1024];
+            int length;
+
+            while ((length = dataInputStream.read(buffer)) > 0) {
+                output.write(buffer, 0, length);
+            }
+            fileOutputStream.write(output.toByteArray());
+            dataInputStream.close();
+            fileOutputStream.close();
+        } catch (MalformedURLException e) {
+            e.printStackTrace();
+        } catch (IOException e) {
+            e.printStackTrace();
+        }
+    }
+
+    /**
+     * url转Base63
+     * @param url
+     * @return
+     */
+    public static String tranUrlToBase64String(String url){
+        try {
+            URL urlImg = new URL(url);
+            HttpURLConnection httpURLConnection = (HttpURLConnection) urlImg.openConnection();
+            httpURLConnection.addRequestProperty("User-Agent","Mozilla / 4.76");
+            InputStream is = httpURLConnection.getInputStream();
+            //定义字节数组大小;
+            byte[] buffer = new byte[1024];
+            ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream();
+            int rc =0 ;
+            while((rc = is.read(buffer,0,100))>0){
+                byteArrayOutputStream.write(buffer,0,rc);
+            }
+            buffer = byteArrayOutputStream.toByteArray();
+            BASE64Encoder encoder = new BASE64Encoder();
+            return encoder.encode(buffer);
+
+        } catch (IOException e) {
+            e.printStackTrace();
+        }
+        return null;
+    }
+
+//    public static void main(String[] args) throws IOException {
+//        String s = tranUrlToBase64String("https://ldb-airport.hz-hanghui.com:9100/data/hanghui/16375779864021cec7bf9ad7f4685973b4da438faf08a.png");
+//
+//        Base64Util.GenerateImage(s,"d:/8.jpg");
+//    }
+}
+

+ 28 - 0
yqk-common/src/main/java/com/yx/face/boot/uitls/ExcelListenerUtils.java

@@ -0,0 +1,28 @@
+package com.yx.face.boot.uitls;
+
+import com.alibaba.excel.context.AnalysisContext;
+import com.alibaba.excel.event.AnalysisEventListener;
+
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * @description: ExcelListener excel导入 <br>
+ * @date: 2021/9/26 17:17 <br>
+ * @author: WXG <br>
+ */
+public class ExcelListenerUtils extends AnalysisEventListener {
+    private List<Object> list = new ArrayList<>();
+    @Override
+    public void invoke(Object data, AnalysisContext context) {
+        list.add(data);
+    }
+
+    @Override
+    public void doAfterAllAnalysed(AnalysisContext context) {
+
+    }
+    public List<Object> getDatas() { //把存储的数据通过此方法暴露出去
+        return list;
+    }
+}

+ 141 - 0
yqk-common/src/main/java/com/yx/face/boot/uitls/ExcelUtil.java

@@ -0,0 +1,141 @@
+package com.yx.face.boot.uitls;
+
+import org.apache.poi.hssf.usermodel.HSSFDateUtil;
+import org.apache.poi.hssf.usermodel.HSSFWorkbook;
+import org.apache.poi.ss.usermodel.Cell;
+import org.apache.poi.ss.usermodel.Row;
+import org.apache.poi.ss.usermodel.Sheet;
+import org.apache.poi.ss.usermodel.Workbook;
+import org.apache.poi.ss.util.CellUtil;
+import org.apache.poi.xssf.streaming.SXSSFWorkbook;
+import org.apache.poi.xssf.usermodel.XSSFWorkbook;
+import org.springframework.web.multipart.MultipartFile;
+
+import java.io.*;
+import java.text.DecimalFormat;
+import java.text.SimpleDateFormat;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * @description:
+ * @ClassName ExcelUtil
+ * @Author WXG
+ * @Date 2022/7/5 16:14
+ */
+public class ExcelUtil {
+    private static final String EXCEL_XLS = "xls";
+    private static final String EXCEL_XLSX = "xlsx";
+
+    public static int DEFAULT_COLOUMN_WIDTH = 20;
+
+    /**
+     * 将excel文件解析为list
+     *
+     * @param file
+     * @return List<List<Object>>
+     * @throws IOException
+     */
+    public static List<Map<String, String>> getListByExcel(MultipartFile file) throws Exception {
+        List<Map<String, String>> list = new ArrayList<Map<String, String>>();
+
+        InputStream in = file.getInputStream();
+
+        // 创建Excel工作薄
+        Workbook work = getWorkbook(in, file.getOriginalFilename());
+        if (null == work) {
+            throw new Exception("创建Excel工作薄为空!");
+        }
+        Sheet sheet = null;
+        Row row = null;
+        Cell cell = null;
+        sheet = work.getSheetAt(0);
+        Row row1 = sheet.getRow(0);
+
+        // 遍历Excel中所有的sheet
+        for (int i = 0; i < work.getNumberOfSheets(); i++) {
+            sheet = work.getSheetAt(i);
+            if (sheet == null) {
+                continue;
+            }
+
+            // 遍历当前sheet中的所有行
+            for (int j = sheet.getFirstRowNum()+1; j <= sheet.getLastRowNum(); j++) {
+                row = sheet.getRow(j);
+                if (row == null) {
+                    continue;
+                }
+
+                // 遍历所有的列
+                Map<String, String> map = new HashMap<String, String>();
+                for (int y = row.getFirstCellNum(); y < row.getLastCellNum(); y++) {
+                    cell = row.getCell(y);
+                    if(cell != null) {
+                        if(cell.getCellType()==0) {
+                            if(HSSFDateUtil.isCellDateFormatted(cell)){
+                                SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
+                                map.put(row1.getCell(y).getStringCellValue(), sdf.format(cell.getDateCellValue()));
+                            }else {
+                                DecimalFormat df = new DecimalFormat("########");
+                                map.put(row1.getCell(y).getStringCellValue(), df.format(cell.getNumericCellValue()));
+                            }
+                        }else {
+                            map.put(row1.getCell(y).getStringCellValue(), cell.getRichStringCellValue().getString());
+                        }
+                    }else {
+                        map.put(row1.getCell(y).getStringCellValue(), null);
+                    }
+                }
+                list.add(map);
+            }
+        }
+        in.close();
+        return list;
+    }
+    /**
+     * 描述:根据文件后缀,自适应上传文件的版本
+     *
+     * @param inStr,fileName
+     * @return
+     * @throws Exception
+     */
+    private static Workbook getWorkbook(InputStream inStr, String fileName) throws Exception {
+        Workbook wb = null;
+        String fileType = fileName.substring(fileName.lastIndexOf("."));
+        if (("."+EXCEL_XLS).equals(fileType)) {
+            wb = new HSSFWorkbook(inStr); // 2003-
+        }else if(("."+EXCEL_XLSX).equals(fileType)) {
+            wb = new XSSFWorkbook(inStr);
+        }else {
+            throw new Exception("解析的文件格式有误!");
+        }
+        return wb;
+    }
+
+
+    public static void Excel2007AboveOperate(String filePath) throws IOException {
+        XSSFWorkbook workbook1 = new XSSFWorkbook(new FileInputStream(new File(filePath)));
+        SXSSFWorkbook sxssfWorkbook = new SXSSFWorkbook(workbook1, 100);
+        Sheet first = sxssfWorkbook.getSheetAt(0);
+        for (int i = 0; i < 100000; i++) {
+            Row row = first.createRow(i);
+            for (int j = 0; j < 11; j++) {
+                if(i == 0) {
+                    // 首行
+                    row.createCell(j).setCellValue("column" + j);
+                } else {
+                    // 数据
+                    if (j == 0) {
+                        CellUtil.createCell(row, j, String.valueOf(i));
+                    } else
+                        CellUtil.createCell(row, j, String.valueOf(Math.random()));
+                }
+            }
+        }
+        FileOutputStream out = new FileOutputStream("workbook.xlsx");
+        sxssfWorkbook.write(out);
+        out.close();
+    }
+}

+ 74 - 0
yqk-common/src/main/java/com/yx/face/boot/uitls/ExcelUtils.java

@@ -0,0 +1,74 @@
+package com.yx.face.boot.uitls;
+
+import com.alibaba.excel.EasyExcelFactory;
+import com.alibaba.excel.ExcelWriter;
+import com.alibaba.excel.write.metadata.WriteSheet;
+import com.yx.face.boot.core.Constants;
+import com.yx.face.boot.restful.CommonException;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import java.io.File;
+import java.io.FileOutputStream;
+import java.io.OutputStream;
+import java.util.Date;
+import java.util.List;
+
+/**
+ * Excel读取写入工具类
+ *
+ * @Author 薛志嘉
+ * @CreateDate 2020/12/20
+ * @System xuezhijia
+ */
+public class ExcelUtils {
+    private static Logger logger = LoggerFactory.getLogger(ExcelUtils.class);
+
+    public static String exportExcel(List list, Class clazz, String title, String address) {
+        Date date = new Date();
+        //生成一个日期用于文件夹名
+        String fileAdd = DateUtils.parseDateToStr("yyyyMMdd", date);
+        //获取文件夹路径
+        File serverFile = new File(Constants.UPLOAD_OTHER + fileAdd);
+        //如果文件夹不存在则创建
+        if (!serverFile.exists() && !serverFile.isDirectory()) {
+            serverFile.mkdir();
+        }
+        //生成一个日期用于Excel文件名
+        String tableName = DateUtils.parseDateToStr("yyyyMMddHHmmss", date) + NumUtils.getRandomInt(100, 999);
+        //指定文件输出位置
+        try (OutputStream outputStream = new FileOutputStream(Constants.UPLOAD_OTHER + fileAdd + "/" + tableName + ".xlsx")) {
+            ExcelWriter excelWriter = EasyExcelFactory.write(outputStream).build();
+            //将要输出的内容填充到Sheet里
+            WriteSheet sheet = new WriteSheet();
+            //设置sheet表名
+            sheet.setSheetName(title);
+            sheet.setSheetNo(1);
+            sheet.setClazz(clazz);
+            sheet.setNeedHead(true);
+            excelWriter.write(list, sheet);
+            excelWriter.finish();
+        } catch (Exception e) {
+            throw new CommonException("【将数据导入到Excel里并返回地址出错】", e);
+        }
+        return address + Constants.UPLOAD_OTHER + fileAdd + "/" + tableName + ".xlsx";
+    }
+
+    public static void exportExcelStream(List list, Class clazz, String title, OutputStream outputStream) {
+        ExcelWriter excelWriter = EasyExcelFactory.write(outputStream).build();
+        //将要输出的内容填充到Sheet里
+        WriteSheet sheet = new WriteSheet();
+        //设置sheet表名
+        sheet.setSheetName(title);
+        sheet.setSheetNo(1);
+        sheet.setClazz(clazz);
+        sheet.setNeedHead(true);
+        excelWriter.write(list, sheet);
+        excelWriter.finish();
+    }
+
+
+}
+
+
+

+ 56 - 0
yqk-common/src/main/java/com/yx/face/boot/uitls/FileUploadUtil.java

@@ -0,0 +1,56 @@
+package com.yx.face.boot.uitls;
+
+/**
+ * @ProjectName: face-server
+ * @Package: com.yx.face.boot.uitls
+ * @ClassName: FileUploadUtil
+ * @Author: 崔哥
+ * @Description: 文件上传
+ * @Date: 2021/11/8 16:38
+ * @Version: 1.0
+ */
+public class FileUploadUtil {
+
+    private static final String url = "http://10.61.107.140:9810/winxin-fyzd/fyzd/file/";
+//    private static final String url = "http://127.0.0.1:9810/winxin-fyzd/fyzd/file/";
+//
+    /**
+     * 文件上传
+     */
+    public static String uploadUtil(String base64, String name) {
+
+        String sync = OkHttpUtils.builder().url(url + "upload")
+                // 有参数的话添加参数,可多个
+                .addParam("base64", base64)
+                .addParam("name", name)
+                .post(true)
+                .sync();
+        return sync;
+    }
+
+    /**
+     * 文件上传
+     */
+    public static String uploadLogImgUtil(String base64, String name) {
+
+        String sync = OkHttpUtils.builder().url(url + "logImg")
+                // 有参数的话添加参数,可多个
+                .addParam("base64", base64)
+                .addParam("name", name)
+                .post(true)
+                .sync();
+        return sync;
+    }
+
+    /**
+     * 文件下载
+     */
+    public static String downloadFile(String name) {
+        String sync = OkHttpUtils.builder().url(url + "downLoad")
+                // 有参数的话添加参数,可多个
+                .addParam("fileName", name)
+                .get()
+                .sync();
+        return sync;
+    }
+}

+ 295 - 0
yqk-common/src/main/java/com/yx/face/boot/uitls/FileUtils.java

@@ -0,0 +1,295 @@
+package com.yx.face.boot.uitls;
+
+
+import com.yx.face.boot.core.Constants;
+import com.yx.face.boot.core.SnowflakeIdWorker;
+import com.yx.face.boot.restful.CommonException;
+import org.apache.commons.codec.digest.DigestUtils;
+import org.apache.commons.lang3.StringUtils;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.web.multipart.MultipartFile;
+import sun.misc.BASE64Decoder;
+
+import java.io.*;
+import java.net.HttpURLConnection;
+import java.net.URL;
+import java.nio.file.Files;
+import java.nio.file.Path;
+import java.nio.file.Paths;
+import java.util.Date;
+import java.util.LinkedList;
+import java.util.List;
+
+/**
+ * @description: 创建临时文件 <br>
+ * @date: 2020/10/21 10:49 <br>
+ * @author: PWB <br>
+ * @since: 1.0 <br>
+ */
+public class FileUtils {
+
+    private static Logger log = LoggerFactory.getLogger(FileUtils.class);
+
+    public static byte[] toByteArray(InputStream in) throws IOException {
+
+        return getBytes(in);
+    }
+
+    private static byte[] getBytes(InputStream in) throws IOException {
+        ByteArrayOutputStream out = new ByteArrayOutputStream();
+        byte[] buffer = new byte[1024 * 4];
+        int n;
+        while ((n = in.read(buffer)) != -1) {
+            out.write(buffer, 0, n);
+        }
+        return out.toByteArray();
+    }
+
+    /**
+     * 网络文件转换为byte二进制
+     */
+    public static byte[] toByteArray(String urlStr) throws IOException {
+        URL url = new URL(urlStr);
+        HttpURLConnection conn = (HttpURLConnection) url.openConnection();
+        DataInputStream in = new DataInputStream(conn.getInputStream());
+        return getBytes(in);
+    }
+
+    /**
+     * @param urlStr 网络文件路径 <br>
+     * @param bdUrl  临时文件路径 <br>
+     * @description: 获取网络文件,暂存为临时文件 <br>
+     */
+    public static void toBDFile(String urlStr, String bdUrl) throws IOException {
+        URL url = new URL(urlStr);
+        HttpURLConnection conn = (HttpURLConnection) url.openConnection();
+        DataInputStream in = new DataInputStream(conn.getInputStream());
+        byte[] data = toByteArray(in);
+        in.close();
+        FileOutputStream out = new FileOutputStream(bdUrl);
+        out.write(data);
+        out.close();
+    }
+
+    /**
+     * 直接获取网络文件的md5值
+     */
+    public static String getMd5ByUrl(String urlStr) {
+        String md5;
+        try {
+            URL url = new URL(urlStr);
+            HttpURLConnection conn = (HttpURLConnection) url.openConnection();
+            DataInputStream in = new DataInputStream(conn.getInputStream());
+            md5 = DigestUtils.md5Hex(in);
+        } catch (IOException e) {
+            throw new CommonException("直接获取网络文件的md5值异常", e.getCause());
+        }
+        return md5;
+    }
+
+    /**
+     * 获取网络文件的输入流
+     */
+    public static InputStream getInputStreamByUrl(String urlStr) {
+        DataInputStream in = null;
+        try {
+            URL url = new URL(urlStr);
+            HttpURLConnection conn = (HttpURLConnection) url.openConnection();
+            in = new DataInputStream(conn.getInputStream());
+        } catch (IOException e) {
+            throw new CommonException("获取网络文件的输入流 异常", e.getCause());
+        }
+        return in;
+    }
+
+    /**
+     * 获取网络文件,暂存为临时文件
+     */
+    public static File createTempFile(String url) {
+        File tmpFile;
+        try {
+            tmpFile = File.createTempFile("temp", ".tmp");
+            FileUtils.toBDFile(url, tmpFile.getCanonicalPath());
+        } catch (IOException e) {
+            throw new CommonException("获取网络文件,暂存为临时文件 异常", e.getCause());
+        }
+        return tmpFile;
+    }
+
+    public static Long getVideoDuration(String fileUrl) {
+ /*       if (StringUtils.isEmpty(fileUrl)) {
+            return null;
+        }
+        try {
+            URL source = new URL(fileUrl);
+            MultimediaObject instance = new MultimediaObject(source);
+            MultimediaInfo result = instance.getInfo();
+            return result.getDuration();
+        } catch (EncoderException | MalformedURLException e) {
+            throw new CommonException("获取视频时长异常", e);
+        }*/
+        return 0L;
+    }
+
+    public static String transformBase64Image(String base64Image, String path, String fileName) {
+        if (base64Image == null || base64Image.trim().length() < 1) {
+            return null;
+        }
+        try {
+            Path directory = Paths.get(path);
+            if (!Files.exists(directory)) {
+                Files.createDirectories(directory);
+            }
+//            Base64.Decoder decoder = Base64.getDecoder();
+//            String decode = new String(Base64.getDecoder().decode(base64Image),"utf-8");
+//            byte[] bytes = decoder.decode(base64Image);
+//            for (int i = 0; i < bytes.length; ++i) {
+//                if (bytes[i] < 0) {// 调整异常数据
+//                    bytes[i] += 256;
+//                }
+//            }
+            BASE64Decoder decoder = new BASE64Decoder();
+            byte[] bytes = decoder.decodeBuffer(base64Image);
+            for (int i = 0; i < bytes.length; ++i) {
+                if (bytes[i] < 0) {// 调整异常数据
+                    bytes[i] += 256;
+                }
+            }
+
+            path = path.concat(fileName);
+            OutputStream out = new FileOutputStream(path);
+            out.write(bytes);
+            out.flush();
+            out.close();
+        } catch (Exception e) {
+            log.info(e.getMessage());
+            return null;
+        }
+        return path;
+    }
+
+
+    public static String saveByCopy(String filePath, MultipartFile file) throws IOException {
+        String filename = getFileName(file.getOriginalFilename() + "");
+        return saveByCopy(filename, filePath, file.getInputStream());
+    }
+
+    public static String saveByCopy(String filename, String filePath, InputStream inputStream) throws IOException {
+        Path directory = Paths.get(filePath);
+        if (!Files.exists(directory)) {
+            Files.createDirectories(directory);
+        }
+        long copy = Files.copy(inputStream, directory.resolve(filename));
+        return filePath.concat("/").concat(filename);
+    }
+
+
+    public static String saveByCopy(MultipartFile file) throws IOException {
+        String filePath = FileUtils.getDirectory(Constants.UPLOAD_OTHER);
+        return saveByCopy(filePath, file);
+    }
+
+    public static List<String> saveFiles(MultipartFile[] files, String httpUrl) throws IOException {
+        log.debug("files ={}", files.length);
+        String filePath = FileUtils.getDirectory(Constants.UPLOAD_IMAGE);
+        String filename;
+        List<String> list = new LinkedList<>();
+        for (MultipartFile file : files) {
+            filename = FileUtils.getFileName(file.getOriginalFilename() + "");
+            Path directory = Paths.get(filePath);
+            if (!Files.exists(directory)) {
+                Files.createDirectories(directory);
+            }
+            InputStream inputStream = file.getInputStream();
+            Files.copy(inputStream, directory.resolve(filename));
+            list.add(httpUrl.concat(filePath).concat("/").concat(filename));
+        }
+        log.debug("listFiles ={}", list);
+        return list;
+    }
+
+
+    public static String saveByTransferTo(String filePath, MultipartFile file) throws IOException {
+        String filename = getFileName(file.getOriginalFilename() + "");
+        File fileSave = new File(filePath);
+        if (!fileSave.exists()) {
+            fileSave.mkdir();
+        }
+        fileSave = new File(filePath, filename);
+        file.transferTo(fileSave);
+        return filePath.concat("/").concat(filename);
+    }
+
+    public static String getDirectory(String basePath) {
+        return basePath.concat(DateUtils.parseDateToStr("yyyyMMdd", new Date()));
+    }
+
+    public static String getFileName(String fileName) {
+        log.info(fileName);
+        String suffix = "";
+        if (StringUtils.isNotEmpty(fileName)) {
+            if (fileName.contains(".")) {
+                String[] arr = fileName.split("\\.");
+                if (arr.length > 1)
+                    suffix = arr[arr.length - 1];
+            }
+        }
+        if (StringUtils.isNotEmpty(suffix)) {
+            return SnowflakeIdWorker.getSnowId() + "." + suffix;
+        }
+        return SnowflakeIdWorker.getSnowId() + ".tmp";
+    }
+
+    public static byte[] fileToByteArray(File file) throws IOException {
+        FileInputStream fis = new FileInputStream(file);
+        ByteArrayOutputStream bos = new ByteArrayOutputStream();
+
+        byte[] buffer = new byte[1024];
+        int bytesRead;
+
+        while ((bytesRead = fis.read(buffer)) != -1) {
+            bos.write(buffer, 0, bytesRead);
+        }
+
+        fis.close();
+        bos.close();
+
+        return bos.toByteArray();
+    }
+
+    /**
+     * 压缩图片至指定大小
+     *
+     * @param srcNetworkUrl 网络图片地址
+     * @param maxkb         压缩至指定大小 kb
+     * @return
+     */
+    public static String compressNetworkPictureToCustom(String domain, String srcNetworkUrl, Integer maxkb) {
+        try {
+            if (domain.contains("https://tx.hz-hanghui.com:8088/")) {
+                srcNetworkUrl = srcNetworkUrl.replace("https://tx.hz-hanghui.com:8088/", "http://127.0.0.1:9100/");
+            }
+            byte[] srcBytes = toByteArray(srcNetworkUrl);
+            long fileSize = srcBytes.length;
+            if (fileSize <= maxkb * 1024 && (srcNetworkUrl.contains(".jpg") || srcNetworkUrl.contains(".jpeg"))) {
+                log.info("图片不超过{}kb,无需压缩。", maxkb);
+                return srcNetworkUrl;
+            }
+            byte[] bytes = ThumbnailsUtil.compressCycle(srcBytes, maxkb);
+            String filePath = FileUtils.getDirectory(Constants.UPLOAD_IMAGE_NEW);
+            String filename = getFileName(srcNetworkUrl.substring(srcNetworkUrl.lastIndexOf("/")));
+            if (!filename.contains(".jpg") && !filename.contains(".jpeg")) {
+                filename = filename.substring(0, filename.lastIndexOf(".")) + ".jpg";
+            }
+            String s = FileUtils.saveByCopy(filename, filePath, new ByteArrayInputStream(bytes));
+            log.info("--->图片压缩后的地址{}", domain + s);
+            return domain + s;
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+        return srcNetworkUrl;
+    }
+
+
+}

+ 77 - 0
yqk-common/src/main/java/com/yx/face/boot/uitls/HttpUtil.java

@@ -0,0 +1,77 @@
+package com.yx.face.boot.uitls;
+
+import java.io.BufferedReader;
+import java.io.DataOutputStream;
+import java.io.InputStreamReader;
+import java.net.HttpURLConnection;
+import java.net.URL;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * http 工具类
+ */
+public class HttpUtil {
+
+    public static String post(String requestUrl, String accessToken, String params)
+            throws Exception {
+        String contentType = "application/x-www-form-urlencoded";
+        return HttpUtil.post(requestUrl, accessToken, contentType, params);
+    }
+
+    public static String post(String requestUrl, String accessToken, String contentType, String params)
+            throws Exception {
+        String encoding = "UTF-8";
+        if (requestUrl.contains("nlp")) {
+            encoding = "GBK";
+        }
+        return HttpUtil.post(requestUrl, accessToken, contentType, params, encoding);
+    }
+
+    public static String post(String requestUrl, String accessToken, String contentType, String params, String encoding)
+            throws Exception {
+        String url = requestUrl + "?access_token=" + accessToken;
+        return HttpUtil.postGeneralUrl(url, contentType, params, encoding);
+    }
+
+    public static String postGeneralUrl(String generalUrl, String contentType, String params, String encoding)
+            throws Exception {
+        URL url = new URL(generalUrl);
+        // 打开和URL之间的连接
+        HttpURLConnection connection = (HttpURLConnection) url.openConnection();
+        connection.setRequestMethod("POST");
+        // 设置通用的请求属性
+        connection.setRequestProperty("Content-Type", contentType);
+        connection.setRequestProperty("Connection", "Keep-Alive");
+        connection.setUseCaches(false);
+        connection.setDoOutput(true);
+        connection.setDoInput(true);
+
+        // 得到请求的输出流对象
+        DataOutputStream out = new DataOutputStream(connection.getOutputStream());
+        out.write(params.getBytes(encoding));
+        out.flush();
+        out.close();
+
+        // 建立实际的连接
+        connection.connect();
+        // 获取所有响应头字段
+        Map<String, List<String>> headers = connection.getHeaderFields();
+        // 遍历所有的响应头字段
+//        for (String key : headers.keySet()) {
+//            System.err.println(key + "--->" + headers.get(key));
+//        }
+        // 定义 BufferedReader输入流来读取URL的响应
+        BufferedReader in = null;
+        in = new BufferedReader(
+                new InputStreamReader(connection.getInputStream(), encoding));
+        String result = "";
+        String getLine;
+        while ((getLine = in.readLine()) != null) {
+            result += getLine;
+        }
+        in.close();
+//        System.err.println("result:" + result);
+        return result;
+    }
+}

+ 51 - 0
yqk-common/src/main/java/com/yx/face/boot/uitls/IDCardEncryptionUtil.java

@@ -0,0 +1,51 @@
+package com.yx.face.boot.uitls;
+
+import com.alibaba.excel.util.StringUtils;
+import lombok.extern.slf4j.Slf4j;
+
+/**
+ * @ProjectName: airport-review-smoke
+ * @Package: com.yixin.review.boot.uitls
+ * @ClassName: IDCardEncryptionUtil
+ * @Author: 崔哥
+ * @Description: 身份证加密
+ * @Date: 2021/9/6 9:28
+ * @Version: 1.0
+ */
+@Slf4j
+public class IDCardEncryptionUtil {
+
+
+    // 手机号码前三后四脱敏
+    public static String mobileEncrypt(String mobile) {
+        if (StringUtils.isEmpty(mobile) || (mobile.length() != 11)) {
+            return mobile;
+        }
+        return mobile.replaceAll("(\\d{3})\\d{4}(\\d{4})", "$1****$2");
+    }
+
+    //身份证前六后四脱敏
+    public static String idEncrypt(String id) {
+        if (StringUtils.isEmpty(id) || (id.length() < 8)) {
+            return id;
+        }
+        return id.replaceAll("(?<=\\w{6})\\w(?=\\w{4})", "*");
+    }
+
+    //护照前2后3位脱敏,护照一般为8或9位
+    public static String idPassport(String id) {
+        if (StringUtils.isEmpty(id) || (id.length() < 8)) {
+            return id;
+        }
+        return id.substring(0, 2) + new String(new char[id.length() - 5]).replace("\0", "*") + id.substring(id.length() - 3);
+    }
+
+
+    public static void main(String[] args) {
+        String ino = "513722587956565455";
+        String s = idEncrypt(ino);
+        System.out.println(s);
+    }
+
+
+}

+ 30 - 0
yqk-common/src/main/java/com/yx/face/boot/uitls/IDGenerateUtils.java

@@ -0,0 +1,30 @@
+package com.yx.face.boot.uitls;
+
+import cn.hutool.core.date.DateUtil;
+
+import java.util.Date;
+
+/**
+ * @author lejingjing
+ * @version 1.0
+ * @Description:
+ * @date 2022/11/04
+ **/
+public class IDGenerateUtils {
+
+    public static Long getUniqueId(){
+        String dateStr = DateUtil.format(new Date(),"yyMMddHHmmss");
+        String idStr = dateStr+getRandom();
+        Long id = Long.parseLong(idStr);
+        return id;
+    }
+
+    public static String getRandom() {
+        Integer i = (int) (Math.random() * 1000 - 1);
+        return String.valueOf(i);
+    }
+
+    public static void main(String[] args) {
+        System.out.println(getUniqueId());
+    }
+}

+ 155 - 0
yqk-common/src/main/java/com/yx/face/boot/uitls/IPUtils.java

@@ -0,0 +1,155 @@
+package com.yx.face.boot.uitls;
+
+
+import cn.hutool.core.util.StrUtil;
+import lombok.extern.slf4j.Slf4j;
+import org.apache.commons.lang3.StringUtils;
+import org.apache.poi.ss.formula.functions.T;
+import org.springframework.context.ConfigurableApplicationContext;
+import org.springframework.context.annotation.AnnotationConfigApplicationContext;
+import org.springframework.core.env.Environment;
+import org.springframework.web.context.request.RequestContextHolder;
+import org.springframework.web.context.request.ServletRequestAttributes;
+
+import javax.servlet.http.HttpServletRequest;
+import java.net.InetAddress;
+import java.net.UnknownHostException;
+
+
+@Slf4j
+public class IPUtils {
+    private final static String UNKNOWN = "unknown";
+    private final static int MAX_LENGTH = 15;
+    private static final String IP_UTILS_FLAG = ",";
+    private static final String LOCALHOST_IP = "0:0:0:0:0:0:0:1";
+    private static final String LOCALHOST_IP1 = "127.0.0.1";
+    private static final String X_ORIGINAL_FORWARDED_FOR = "X-Original-Forwarded-For";
+    private static final String X_FORWARDED_FOR = "X-Forwarded-For";
+    private static final String x_forwarded_for = "x-forwarded-for";
+    private static final String PROXY_CLIENT_IP = "Proxy-Client-IP";
+    private static final String WL_PROXY_CLIENT_IP = "WL-Proxy-Client-IP";
+    private static final String HTTP_CLIENT_IP = "HTTP_CLIENT_IP";
+    private static final String HTTP_X_FORWARDED_FOR = "HTTP_X_FORWARDED_FOR";
+
+    /**
+     * 获取IP地址
+     * 使用Nginx等反向代理软件, 则不能通过request.getRemoteAddr()获取IP地址
+     * 如果使用了多级反向代理的话,X-Forwarded-For的值并不止一个,而是一串IP地址,X-Forwarded-For中第一个非unknown的有效IP字符串,则为真实IP地址
+     */
+    public static String getIP() {
+        ServletRequestAttributes requestAttributes = ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes());
+        if (requestAttributes == null) {
+            return null;
+        }
+        HttpServletRequest request = requestAttributes.getRequest();
+        return getIP(request);
+    }
+
+
+    /**
+     * 获取IP地址
+     * <p>
+     * 使用Nginx等反向代理软件, 则不能通过request.getRemoteAddr()获取IP地址
+     * 如果使用了多级反向代理的话,X-Forwarded-For的值并不止一个,而是一串IP地址,X-Forwarded-For中第一个非unknown的有效IP字符串,则为真实IP地址
+     */
+    public static String getIP(HttpServletRequest request) {
+        String ip = null;
+        try {
+            //以下两个获取在k8s中,将真实的客户端IP,放到了x-Original-Forwarded-For。而将WAF的回源地址放到了 x-Forwarded-For了。
+            ip = request.getHeader(X_ORIGINAL_FORWARDED_FOR);
+
+            //X-Forwarded-For
+            if (StringUtils.isEmpty(ip) || UNKNOWN.equalsIgnoreCase(ip)) {
+                ip = request.getHeader(X_FORWARDED_FOR);
+            }
+            //获取nginx等代理的ip  x-forwarded-for
+            if (StringUtils.isEmpty(ip) || UNKNOWN.equalsIgnoreCase(ip)) {
+                ip = request.getHeader(x_forwarded_for);
+            }
+            //Proxy-Client-IP
+            if (StringUtils.isEmpty(ip) || UNKNOWN.equalsIgnoreCase(ip)) {
+                ip = request.getHeader(PROXY_CLIENT_IP);
+            }
+
+            //WL-Proxy-Client-IP
+            if (StringUtils.isEmpty(ip) || ip.length() == 0 || UNKNOWN.equalsIgnoreCase(ip)) {
+                ip = request.getHeader(WL_PROXY_CLIENT_IP);
+            }
+
+            //HTTP_CLIENT_IP
+            if (StringUtils.isEmpty(ip) || UNKNOWN.equalsIgnoreCase(ip)) {
+                ip = request.getHeader(HTTP_CLIENT_IP);
+            }
+
+            //HTTP_X_FORWARDED_FOR
+            if (StringUtils.isEmpty(ip) || UNKNOWN.equalsIgnoreCase(ip)) {
+                ip = request.getHeader(HTTP_X_FORWARDED_FOR);
+            }
+            //兼容k8s集群获取ip
+            if (StringUtils.isEmpty(ip) || UNKNOWN.equalsIgnoreCase(ip)) {
+                ip = request.getRemoteAddr();
+                if (LOCALHOST_IP1.equalsIgnoreCase(ip) || LOCALHOST_IP.equalsIgnoreCase(ip)) {
+                    //根据网卡取本机配置的IP
+                    try {
+                        InetAddress iNet = InetAddress.getLocalHost();
+                        ip = iNet.getHostAddress();
+                    } catch (UnknownHostException e) {
+                        log.error("getClientIp error: {}", e.getMessage());
+                    }
+                }
+            }
+        } catch (Exception e) {
+            log.error("IPUtils ERROR ", e);
+        }
+        //使用代理,则获取第一个IP地址
+        if (!StringUtils.isEmpty(ip) && ip.indexOf(IP_UTILS_FLAG) > 0) {
+            ip = ip.substring(0, ip.indexOf(IP_UTILS_FLAG));
+        }
+        return ip;
+    }
+
+
+    public static String getIpAddr(HttpServletRequest request) {
+        String ip = null;
+        try {
+            ip = request.getHeader(x_forwarded_for);
+            if (StringUtils.isEmpty(ip) || UNKNOWN.equalsIgnoreCase(ip)) {
+                ip = request.getHeader(PROXY_CLIENT_IP);
+            }
+            if (StringUtils.isEmpty(ip) || ip.length() == 0 || UNKNOWN.equalsIgnoreCase(ip)) {
+                ip = request.getHeader(WL_PROXY_CLIENT_IP);
+            }
+            if (StringUtils.isEmpty(ip) || UNKNOWN.equalsIgnoreCase(ip)) {
+                ip = request.getHeader(HTTP_CLIENT_IP);
+            }
+            if (StringUtils.isEmpty(ip) || UNKNOWN.equalsIgnoreCase(ip)) {
+                ip = request.getHeader(HTTP_X_FORWARDED_FOR);
+            }
+            if (StringUtils.isEmpty(ip) || UNKNOWN.equalsIgnoreCase(ip)) {
+                ip = request.getRemoteAddr();
+            }
+        } catch (Exception e) {
+            log.error("IPUtils ERROR ", e);
+        }
+        // 使用代理,则获取第一个IP地址
+        if (!StringUtils.isEmpty(ip) && ip.length() > MAX_LENGTH) {
+            if (ip.indexOf(IP_UTILS_FLAG) > 0) {
+                ip = ip.substring(0, ip.indexOf(IP_UTILS_FLAG));
+            }
+        }
+        return LOCALHOST_IP.equals(ip) ? LOCALHOST_IP1 : ip;
+    }
+
+    public static String getLocalAddress(String address){
+        if(StrUtil.isNotBlank(address)){
+            return address;
+        }
+        StringBuilder stringBuilder = new StringBuilder();
+        try {
+            stringBuilder.append("http://").append(InetAddress.getLocalHost().getHostAddress()).append(":9100/yx-fyzd/");
+            return stringBuilder.toString();
+        } catch (UnknownHostException e) {
+            return null;
+        }
+    }
+}

+ 245 - 0
yqk-common/src/main/java/com/yx/face/boot/uitls/IdcardValidatorUtil.java

@@ -0,0 +1,245 @@
+package com.yx.face.boot.uitls;
+
+import java.text.ParseException;
+import java.text.SimpleDateFormat;
+import java.util.Calendar;
+import java.util.Date;
+import java.util.regex.Pattern;
+
+/**
+ * @ProjectName: face-server
+ * @Package: com.yx.face.boot.uitls
+ * @ClassName: IdcardValidatorUtil
+ * @Author: shihongbo
+ * @Description:
+ * @Date: 2022/3/18 9:59
+ * @Version: 1.0
+ */
+public class IdcardValidatorUtil {
+
+    private static int power[] = { 7, 9, 10, 5, 8, 4, 2, 1, 6, 3, 7, 9, 10, 5, 8, 4, 2 };
+
+    // 第18位校检码
+    private String verifyCode[] = { "1", "0", "X", "9", "8", "7", "6", "5",
+            "4", "3", "2" };
+
+    /**
+     * 验证所有的身份证的合法性
+     *
+     * @param idcard
+     * @return
+     */
+    public static boolean isValidatedAllIdcard(String idcard) {
+        if (idcard.length() == 15) {
+            idcard = convertIdcarBy15bit(idcard);
+        }
+        return isValidate18Idcard(idcard);
+    }
+
+    /**
+     * 将15位的身份证转成18位身份证
+     *
+     * @param idcard
+     * @return
+     */
+    public static String convertIdcarBy15bit(String idcard) {
+        String idcard17 = null;
+        // 非15位身份证
+        if (idcard.length() != 15) {
+            return null;
+        }
+
+        if (isDigital(idcard)) {
+            // 获取出生年月日
+            String birthday = idcard.substring(6, 12);
+            Date birthdate = null;
+            try {
+                birthdate = new SimpleDateFormat("yyMMdd").parse(birthday);
+            } catch (ParseException e) {
+                e.printStackTrace();
+            }
+            Calendar cday = Calendar.getInstance();
+            cday.setTime(birthdate);
+            String year = String.valueOf(cday.get(Calendar.YEAR));
+
+            idcard17 = idcard.substring(0, 6) + year + idcard.substring(8);
+
+            char c[] = idcard17.toCharArray();
+            String checkCode = "";
+
+            if (null != c) {
+                int bit[] = new int[idcard17.length()];
+
+                // 将字符数组转为整型数组
+                bit = converCharToInt(c);
+                int sum17 = 0;
+                sum17 = getPowerSum(bit);
+
+                // 获取和值与11取模得到余数进行校验码
+                checkCode = getCheckCodeBySum(sum17);
+                // 获取不到校验位
+                if (null == checkCode) {
+                    return null;
+                }
+
+                // 将前17位与第18位校验码拼接
+                idcard17 += checkCode;
+            }
+        } else { // 身份证包含数字
+            return null;
+        }
+        return idcard17;
+    }
+
+    /**
+     * @param idcard
+     * @return
+     */
+    public static boolean isValidate18Idcard(String idcard) {
+        // 非18位为假
+        if (idcard.length() != 18) {
+            return false;
+        }
+        // 获取前17位
+        String idcard17 = idcard.substring(0, 17);
+        // 获取第18位
+        String idcard18Code = idcard.substring(17, 18);
+        char c[] = null;
+        String checkCode = "";
+        // 是否都为数字
+        if (isDigital(idcard17)) {
+            c = idcard17.toCharArray();
+        } else {
+            return false;
+        }
+
+        if (null != c) {
+            int bit[] = new int[idcard17.length()];
+
+            bit = converCharToInt(c);
+
+            int sum17 = 0;
+
+            sum17 = getPowerSum(bit);
+
+            // 将和值与11取模得到余数进行校验码判断
+            checkCode = getCheckCodeBySum(sum17);
+            if (null == checkCode) {
+                return false;
+            }
+            // 将身份证的第18位与算出来的校码进行匹配,不相等就为假
+            if (!idcard18Code.equalsIgnoreCase(checkCode)) {
+                return false;
+            }
+        }
+        return true;
+    }
+
+    /**
+     * 18位身份证号码的基本数字和位数验校
+     *
+     * @param idcard
+     * @return
+     */
+    public boolean is18Idcard(String idcard) {
+        return Pattern.matches("^[1-9]\\d{5}[1-9]\\d{3}((0\\d)|(1[0-2]))(([0|1|2]\\d)|3[0-1])\\d{3}([\\d|x|X]{1})$", idcard);
+    }
+
+    /**
+     * 数字验证
+     *
+     * @param str
+     * @return
+     */
+    public static boolean isDigital(String str) {
+        return str == null || "".equals(str) ? false : str.matches("^[0-9]*$");
+    }
+
+    /**
+     * 将身份证的每位和对应位的加权因子相乘之后,再得到和值
+     *
+     * @param bit
+     * @return
+     */
+    public static int getPowerSum(int[] bit) {
+
+        int sum = 0;
+
+        if (power.length != bit.length) {
+            return sum;
+        }
+
+        for (int i = 0; i < bit.length; i++) {
+            for (int j = 0; j < power.length; j++) {
+                if (i == j) {
+                    sum = sum + bit[i] * power[j];
+                }
+            }
+        }
+        return sum;
+    }
+
+    /**
+     * 将和值与11取模得到余数进行校验码判断
+     *
+     * @param checkCode
+     * @param sum17
+     * @return 校验位
+     */
+    public static String getCheckCodeBySum(int sum17) {
+        String checkCode = null;
+        switch (sum17 % 11) {
+            case 10:
+                checkCode = "2";
+                break;
+            case 9:
+                checkCode = "3";
+                break;
+            case 8:
+                checkCode = "4";
+                break;
+            case 7:
+                checkCode = "5";
+                break;
+            case 6:
+                checkCode = "6";
+                break;
+            case 5:
+                checkCode = "7";
+                break;
+            case 4:
+                checkCode = "8";
+                break;
+            case 3:
+                checkCode = "9";
+                break;
+            case 2:
+                checkCode = "x";
+                break;
+            case 1:
+                checkCode = "0";
+                break;
+            case 0:
+                checkCode = "1";
+                break;
+        }
+        return checkCode;
+    }
+
+    /**
+     * 将字符数组转为整型数组
+     *
+     * @param c
+     * @return
+     * @throws NumberFormatException
+     */
+    public static int[] converCharToInt(char[] c) throws NumberFormatException {
+        int[] a = new int[c.length];
+        int k = 0;
+        for (char temp : c) {
+            a[k++] = Integer.parseInt(String.valueOf(temp));
+        }
+        return a;
+    }
+
+}

+ 102 - 0
yqk-common/src/main/java/com/yx/face/boot/uitls/JsonUtils.java

@@ -0,0 +1,102 @@
+package com.yx.face.boot.uitls;
+
+
+import com.fasterxml.jackson.annotation.JsonInclude.Include;
+import com.fasterxml.jackson.databind.DeserializationFeature;
+import com.fasterxml.jackson.databind.JavaType;
+import com.fasterxml.jackson.databind.ObjectMapper;
+import com.yx.face.boot.restful.CommonException;
+import org.apache.commons.lang3.StringUtils;
+
+import java.io.IOException;
+import java.text.SimpleDateFormat;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Map;
+import java.util.TimeZone;
+
+
+public class JsonUtils {
+    private static final ObjectMapper objectMapper = new ObjectMapper();
+
+    static {
+        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
+        objectMapper.setDateFormat(sdf);
+        objectMapper.setTimeZone(TimeZone.getDefault());
+        objectMapper.setSerializationInclusion(Include.ALWAYS);
+        // 设置输入时忽略JSON字符串中存在而Java对象实际没有的属性
+        objectMapper.disable(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES);
+    }
+
+    /**
+     * 将对象转换为JSON字符串
+     */
+    public static String toJson(Object obj) {
+        if (obj == null) {
+            return null;
+        }
+        try {
+            return objectMapper.writeValueAsString(obj);
+        } catch (Exception e) {
+            throw new CommonException("对象转换为JSON字符串 异常!", e);
+        }
+    }
+
+    /**
+     * JSON字符串转换为对象 <br>
+     */
+    public static <T> T toObject(String json, Class<T> clazz) {
+        if (StringUtils.isEmpty(json)) {
+            return null;
+        }
+        try {
+            return objectMapper.readValue(json, clazz);
+        } catch (IOException e) {
+            throw new CommonException("JSON字符串转换为对象 异常!", e);
+        }
+    }
+
+    /**
+     * 将Json字符串转换成List
+     */
+    public static <T> List<T> toObjectList(Class<T> clazz, String json) {
+        if (StringUtils.isEmpty(json)) {
+            return null;
+        }
+        JavaType javaType = getCollectionType(ArrayList.class, clazz);
+        try {
+            return objectMapper.readValue(json, javaType);
+        } catch (IOException e) {
+            throw new CommonException("Json字符串转换成List 异常!", e);
+        }
+    }
+
+    /**
+     * 获取泛型的Collection Type
+     *
+     * @param collectionClass 泛型的Collection
+     * @param elementClasses  元素类
+     * @return JavaType Java类型
+     * @since 1.0
+     */
+    public static JavaType getCollectionType(Class<?> collectionClass, Class<?>... elementClasses) {
+        return objectMapper.getTypeFactory().constructParametricType(collectionClass, elementClasses);
+    }
+
+    /**
+     * 将JSON字符串转为Map
+     */
+    public static Map<String, Object> toMap(String json) {
+        if (StringUtils.isEmpty(json)) {
+            return null;
+        }
+        try {
+            @SuppressWarnings("unchecked")
+            Map<String, Object> maps = objectMapper.readValue(json, Map.class);//转成map
+            return maps;
+        } catch (Exception e) {
+            throw new CommonException("JSON字符串转为Map 异常!", e);
+        }
+    }
+
+}

+ 299 - 0
yqk-common/src/main/java/com/yx/face/boot/uitls/NumUtils.java

@@ -0,0 +1,299 @@
+package com.yx.face.boot.uitls;
+
+import lombok.extern.slf4j.Slf4j;
+
+import java.math.BigDecimal;
+import java.text.DecimalFormat;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.Random;
+import java.util.UUID;
+
+/**
+ * @description: ArabicNumToChineseNumUtil <br>
+ * @date: 2020/1/7 16:06 <br>
+ * @author: PWB <br>
+ * @version: 1.0 <br>
+ */
+@Slf4j
+public class NumUtils {
+    private static Random rand;
+
+    static {
+        rand = new Random();
+    }
+
+    /**
+     * 单位进位,中文默认为4位即(万、亿)
+     */
+    public static final int UNIT_STEP = 4;
+
+    /**
+     * 单位
+     */
+    public static final String[] CN_UNITS = new String[]{"个", "十", "百", "千", "万", "十",
+            "百", "千", "亿", "十", "百", "千", "万"};
+
+    /**
+     * 汉字
+     */
+    public static final String[] CN_CHARS = new String[]{"零", "一", "二", "三", "四",
+            "五", "六", "七", "八", "九"};
+
+
+    /**
+     * @param srcNum 需要转换的数值 <br>
+     * @return java.lang.String <br>
+     * @description: getCNNum 将阿拉伯数字转换为中文数字123=》一二三 <br>
+     * @version: 1.0 <br>
+     * @date: 2020/1/8 9:41 <br>
+     */
+    public static String getCNNum(int srcNum) {
+        StringBuilder desCNNum = new StringBuilder();
+
+        if (srcNum <= 0)
+            desCNNum = new StringBuilder("零");
+        else {
+            int singleDigit;
+            while (srcNum > 0) {
+                singleDigit = srcNum % 10;
+                desCNNum.insert(0, CN_CHARS[singleDigit]);
+                srcNum /= 10;
+            }
+        }
+        return desCNNum.toString();
+    }
+
+
+    /**
+     * @param num 需要转换的数值 <br>
+     * @return java.lang.String <br>
+     * @description: cvt  数值转换为中文字符串 如2转化为贰 <br>
+     * @version: 1.0 <br>
+     * @date: 2020/1/8 9:38 <br>
+     */
+    public static String cvt(long num) {
+        return cvt(num, false);
+    }
+
+
+    /**
+     * @param num          需要转换的数值
+     * @param isColloquial 是否口语化。例如12转换为'十二'而不是'一十二' <br>
+     * @return java.lang.String <br>
+     * @description: cvt  数值转换为中文字符串(口语化) <br>
+     * @version: 1.0 <br>
+     * @date: 2020/1/8 9:38 <br>
+     */
+    public static String cvt(String num, boolean isColloquial) {
+        int integer, decimal;
+        StringBuilder stringBuilder = new StringBuilder(32);
+        String[] splitNum = num.split("\\.");
+        integer = Integer.parseInt(splitNum[0]);    //整数部分
+        decimal = Integer.parseInt(splitNum[1]);    //小数部分
+        String[] result_1 = convert(integer, isColloquial);
+        for (String str1 : result_1)
+            stringBuilder.append(str1);
+        if (decimal == 0) {//小数部分为0时
+            return stringBuilder.toString();
+        }
+        String result_2 = getCNNum(decimal);  //例如5.32,小数部分展示三二,而不是三十二
+        stringBuilder.append("点");
+        stringBuilder.append(result_2);
+        return stringBuilder.toString();
+
+    }
+
+    /**
+     * @param num          需要转换的数值
+     * @param isColloquial 是否口语化。例如12转换为'十二'而不是'一十二' <br>
+     * @return java.lang.String <br>
+     * @description: cvt 对于int,long类型的数据处理 <br>
+     * @version: 1.0 <br>
+     * @date: 2020/1/8 9:39 <br>
+     */
+    public static String cvt(long num, boolean isColloquial) {
+        String[] result = convert(num, isColloquial);
+        StringBuilder stringBuilder = new StringBuilder(32);
+        for (String str : result) {
+            stringBuilder.append(str);
+        }
+        return stringBuilder.toString();
+    }
+
+
+    /**
+     * @param num          需要转换的数值
+     * @param isColloquial 是否口语化。例如12转换为'十二'而不是'一十二'。 <br>
+     * @return java.lang.String[] <br>
+     * @description: convert  将数值转换为中文 <br>
+     * @version: 1.0 <br>
+     * @date: 2020/1/8 9:40 <br>
+     */
+    public static String[] convert(long num, boolean isColloquial) {
+        if (num < 10) {// 10以下直接返回对应汉字
+            return new String[]{CN_CHARS[(int) num]};// ASCII2int
+        }
+
+        char[] chars = String.valueOf(num).toCharArray();
+        if (chars.length > CN_UNITS.length) {// 超过单位表示范围的返回空
+            return new String[]{};
+        }
+
+        boolean isLastUnitStep = false;// 记录上次单位进位
+        ArrayList<String> cnChars = new ArrayList<>(chars.length * 2);// 创建数组,将数字填入单位对应的位置
+        for (int pos = chars.length - 1; pos >= 0; pos--) {// 从低位向高位循环
+            char ch = chars[pos];
+            String cnChar = CN_CHARS[ch - '0'];// ascii2int 汉字
+            int unitPos = chars.length - pos - 1;// 对应的单位坐标
+            String cnUnit = CN_UNITS[unitPos];// 单位
+            boolean isZero = (ch == '0');// 是否为0
+            boolean isZeroLow = (pos + 1 < chars.length && chars[pos + 1] == '0');// 是否低位为0
+
+            boolean isUnitStep = (unitPos >= UNIT_STEP && (unitPos % UNIT_STEP == 0));// 当前位是否需要单位进位
+
+            if (isUnitStep && isLastUnitStep) {// 去除相邻的上一个单位进位
+                int size = cnChars.size();
+                cnChars.remove(size - 1);
+                if (!CN_CHARS[0].equals(cnChars.get(size - 2))) {// 补0
+                    cnChars.add(CN_CHARS[0]);
+                }
+            }
+
+            if (isUnitStep || !isZero) {// 单位进位(万、亿),或者非0时加上单位
+                cnChars.add(cnUnit);
+                isLastUnitStep = isUnitStep;
+            }
+            if (isZero && (isZeroLow || isUnitStep)) {// 当前位为0低位为0,或者当前位为0并且为单位进位时进行省略
+                continue;
+            }
+            cnChars.add(cnChar);
+            isLastUnitStep = false;
+        }
+
+        Collections.reverse(cnChars);
+        // 清除最后一位的0
+        int chSize = cnChars.size();
+        String chEnd = cnChars.get(chSize - 1);
+        if (CN_CHARS[0].equals(chEnd) || CN_UNITS[0].equals(chEnd)) {
+            cnChars.remove(chSize - 1);
+        }
+
+        // 口语化处理
+        if (isColloquial) {
+            String chFirst = cnChars.get(0);
+            String chSecond = cnChars.get(1);
+            if (chFirst.equals(CN_CHARS[1]) && chSecond.startsWith(CN_UNITS[1])) {// 是否以'一'开头,紧跟'十'
+                cnChars.remove(0);
+            }
+        }
+        return cnChars.toArray(new String[]{});
+    }
+
+
+    /**
+     * @param chineseStr 字符串 <br>
+     * @return boolean <br>
+     * @description: isChineseNum 判断传入的字符串是否全是汉字数字 <br>
+     * @date: 2020/1/7 16:19 <br>
+     */
+    public static boolean isChineseNum(String chineseStr) {
+        final String allChineseNum = "零一二三四五六七八九十百千万亿";
+        char[] ch = chineseStr.toCharArray();
+        for (char c : ch) {
+            if (!allChineseNum.contains(String.valueOf(c))) {
+                return false;
+            }
+        }
+        return true;
+    }
+
+    /**
+     * @param str 待验证的字符串 <br>
+     * @return boolean <br>
+     * @description: isNum  判断数字字符串是否是整数字符串 <br>
+     * @date: 2020/1/7 16:20 <br>
+     */
+    public static boolean isNum(String str) {
+        String reg = "[0-9]+";
+        return str.matches(reg);
+    }
+
+
+    /**
+     * 生成一批用户帐号
+     */
+    public static String getUUID() {
+        return UUID.randomUUID().toString().replace("-", "");
+    }
+
+    /**
+     * 随机获取一个小写字母
+     */
+    public static char getLetter() {
+        return (char) getRandomInt(97, 122);
+    }
+
+    /**
+     * 随机获取一个大写字母
+     */
+    public static char getUpper() {
+        return (char) getRandomInt(65, 90);
+    }
+
+    /**
+     * 随机获取一个0-9的数字
+     */
+    public static int getNum() {
+        return getRandomInt(0, 9);
+    }
+
+    /**
+     * 获取一个范围内的随机数字
+     */
+    public static int getRandomInt(int min, int max) {
+        return rand.nextInt(max - min + 1) + min;
+    }
+
+
+    public static String getPercentage(int num1, int num2) {
+        if (num1 == 0) {
+            return "0.00%";
+        }
+        if (num2 == 0) {
+            if (num1 > 0) {
+                return "100.00%";
+            }
+            return "0.00%";
+        }
+        DecimalFormat format = new DecimalFormat("###0.00%");
+        format.setMaximumFractionDigits(2);
+        return format.format((double) num1 / (double) num2);
+    }
+
+
+    public static String getPercentage(BigDecimal num1, BigDecimal num2) {
+        BigDecimal fa = BigDecimal.ZERO;
+        int compare1 = num1.compareTo(fa);
+        int compare2 = num2.compareTo(fa);
+        if (compare1 == 0) {
+            return "0.00%";
+        }
+        if (compare2 == 0) {
+            if (compare1 > 0) {
+                return "100.00%";
+            }
+            return "0.00%";
+        }
+        fa = num1.divide(num2, 2, BigDecimal.ROUND_HALF_UP);
+        return getPercentage(fa);
+    }
+
+
+    public static String getPercentage(BigDecimal fa) {
+        DecimalFormat format = new DecimalFormat("###0.00%");
+        format.setMaximumFractionDigits(2);
+        return format.format(fa.doubleValue());
+    }
+
+}

+ 322 - 0
yqk-common/src/main/java/com/yx/face/boot/uitls/OkHttpUtils.java

@@ -0,0 +1,322 @@
+package com.yx.face.boot.uitls;
+
+import com.alibaba.fastjson.JSON;
+import lombok.extern.slf4j.Slf4j;
+import okhttp3.*;
+
+import javax.net.ssl.SSLContext;
+import javax.net.ssl.SSLSocketFactory;
+import javax.net.ssl.TrustManager;
+import javax.net.ssl.X509TrustManager;
+import java.io.IOException;
+import java.net.URLEncoder;
+import java.security.SecureRandom;
+import java.security.cert.X509Certificate;
+import java.util.LinkedHashMap;
+import java.util.Map;
+import java.util.concurrent.Semaphore;
+import java.util.concurrent.TimeUnit;
+
+/**
+ * @ProjectName: airport-review-smoke
+ * @Package: com.yixin.review.boot.uitls
+ * @ClassName: OkHttpUtils
+ * @Author: 崔哥
+ * @Description:
+ * @Date: 2021/9/3 18:22
+ * @Version: 1.0
+ */
+@Slf4j
+public class OkHttpUtils {
+    private static volatile OkHttpClient okHttpClient = null;
+    private static volatile Semaphore semaphore = null;
+    private Map<String, String> headerMap;
+    private Map<String, String> paramMap;
+    private String url;
+    private Request.Builder request;
+
+    /**
+     * 初始化okHttpClient,并且允许https访问
+     */
+    private OkHttpUtils() {
+        if (okHttpClient == null) {
+            synchronized (OkHttpUtils.class) {
+                if (okHttpClient == null) {
+                    TrustManager[] trustManagers = buildTrustManagers();
+                    okHttpClient = new OkHttpClient.Builder()
+                            .connectTimeout(15, TimeUnit.SECONDS)
+                            .writeTimeout(20, TimeUnit.SECONDS)
+                            .readTimeout(20, TimeUnit.SECONDS)
+                            .sslSocketFactory(createSSLSocketFactory(trustManagers), (X509TrustManager) trustManagers[0])
+                            .hostnameVerifier((hostName, session) -> true)
+                            .retryOnConnectionFailure(true)
+                            .build();
+                    addHeader("User-Agent", "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/63.0.3239.132 Safari/537.36");
+                }
+            }
+        }
+    }
+
+    /**
+     * 用于异步请求时,控制访问线程数,返回结果
+     *
+     * @return
+     */
+    private static Semaphore getSemaphoreInstance() {
+        //只能1个线程同时访问
+        synchronized (OkHttpUtils.class) {
+            if (semaphore == null) {
+                semaphore = new Semaphore(0);
+            }
+        }
+        return semaphore;
+    }
+
+    /**
+     * 创建OkHttpUtils
+     *
+     * @return
+     */
+    public static OkHttpUtils builder() {
+        return new OkHttpUtils();
+    }
+
+    /**
+     * 添加url
+     *
+     * @param url
+     * @return
+     */
+    public OkHttpUtils url(String url) {
+        this.url = url;
+        return this;
+    }
+
+    /**
+     * 添加参数
+     *
+     * @param key   参数名
+     * @param value 参数值
+     * @return
+     */
+    public OkHttpUtils addParam(String key, String value) {
+        if (paramMap == null) {
+            paramMap = new LinkedHashMap<>(16);
+        }
+        paramMap.put(key, value);
+        return this;
+    }
+
+    /**
+     * 添加请求头
+     *
+     * @param key   参数名
+     * @param value 参数值
+     * @return
+     */
+    public OkHttpUtils addHeader(String key, String value) {
+        if (headerMap == null) {
+            headerMap = new LinkedHashMap<>(16);
+        }
+        headerMap.put(key, value);
+        return this;
+    }
+
+    /**
+     * 初始化get方法
+     *
+     * @return
+     */
+    public OkHttpUtils get() {
+        request = new Request.Builder().get();
+        StringBuilder urlBuilder = new StringBuilder(url);
+        if (paramMap != null) {
+            urlBuilder.append("?");
+            try {
+                for (Map.Entry<String, String> entry : paramMap.entrySet()) {
+                    urlBuilder.append(URLEncoder.encode(entry.getKey(), "utf-8")).
+                            append("=").
+                            append(URLEncoder.encode(entry.getValue(), "utf-8")).
+                            append("&");
+                }
+            } catch (Exception e) {
+                e.printStackTrace();
+            }
+            urlBuilder.deleteCharAt(urlBuilder.length() - 1);
+        }
+        request.url(urlBuilder.toString());
+        return this;
+    }
+
+    /**
+     * 初始化post方法
+     *
+     * @param isJsonPost true等于json的方式提交数据,类似postman里post方法的raw
+     *                   false等于普通的表单提交
+     * @return
+     */
+    public OkHttpUtils post(boolean isJsonPost) {
+        RequestBody requestBody;
+        if (isJsonPost) {
+            String json = "";
+            if (paramMap != null) {
+                json = JSON.toJSONString(paramMap);
+            }
+            requestBody = RequestBody.create(MediaType.parse("application/json; charset=utf-8"), json);
+        } else {
+            FormBody.Builder formBody = new FormBody.Builder();
+            if (paramMap != null) {
+                paramMap.forEach(formBody::add);
+            }
+            requestBody = formBody.build();
+            log.info("requestBody;", requestBody);
+        }
+        request = new Request.Builder().post(requestBody).url(url);
+        return this;
+    }
+
+    public OkHttpUtils localPost(String json) {
+        RequestBody requestBody;
+        requestBody = RequestBody.create(MediaType.parse("application/json; charset=utf-8"), json);
+        request = new Request.Builder().post(requestBody).url(url);
+        return this;
+    }
+
+    /**
+     * 同步请求
+     *
+     * @return
+     */
+    public String sync() {
+        setHeader(request);
+        try {
+            Response response = okHttpClient.newCall(request.build()).execute();
+            assert response.body() != null;
+            return response.body().string();
+        } catch (IOException e) {
+            e.printStackTrace();
+            return "请求失败:" + e.getMessage();
+        }
+    }
+
+    /**
+     * 异步请求,有返回值
+     */
+    public String async() {
+        StringBuilder buffer = new StringBuilder("");
+        setHeader(request);
+        okHttpClient.newCall(request.build()).enqueue(new Callback() {
+            @Override
+            public void onFailure(Call call, IOException e) {
+                buffer.append("请求出错:").append(e.getMessage());
+            }
+
+            @Override
+            public void onResponse(Call call, Response response) throws IOException {
+                assert response.body() != null;
+                buffer.append(response.body().string());
+                getSemaphoreInstance().release();
+            }
+        });
+        try {
+            getSemaphoreInstance().acquire();
+        } catch (InterruptedException e) {
+            e.printStackTrace();
+        }
+        return buffer.toString();
+    }
+
+    /**
+     * 异步请求,带有接口回调
+     *
+     * @param callBack
+     */
+    public void async(ICallBack callBack) {
+        setHeader(request);
+        okHttpClient.newCall(request.build()).enqueue(new Callback() {
+            @Override
+            public void onFailure(Call call, IOException e) {
+                callBack.onFailure(call, e.getMessage());
+            }
+
+            @Override
+            public void onResponse(Call call, Response response) throws IOException {
+                assert response.body() != null;
+                callBack.onSuccessful(call, response.body().string());
+            }
+        });
+    }
+
+    /**
+     * 为request添加请求头
+     *
+     * @param request
+     */
+    private void setHeader(Request.Builder request) {
+        if (headerMap != null) {
+            try {
+                for (Map.Entry<String, String> entry : headerMap.entrySet()) {
+                    request.addHeader(entry.getKey(), entry.getValue());
+                }
+            } catch (Exception e) {
+                e.printStackTrace();
+            }
+        }
+    }
+
+
+    /**
+     * 生成安全套接字工厂,用于https请求的证书跳过
+     *
+     * @return
+     */
+    private static SSLSocketFactory createSSLSocketFactory(TrustManager[] trustAllCerts) {
+        SSLSocketFactory ssfFactory = null;
+        try {
+            SSLContext sc = SSLContext.getInstance("SSL");
+            sc.init(null, trustAllCerts, new SecureRandom());
+            ssfFactory = sc.getSocketFactory();
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+        return ssfFactory;
+    }
+
+    private static TrustManager[] buildTrustManagers() {
+        return new TrustManager[]{
+                new X509TrustManager() {
+                    @Override
+                    public void checkClientTrusted(X509Certificate[] chain, String authType) {
+                    }
+
+                    @Override
+                    public void checkServerTrusted(X509Certificate[] chain, String authType) {
+                    }
+
+                    @Override
+                    public X509Certificate[] getAcceptedIssuers() {
+                        return new X509Certificate[]{};
+                    }
+                }
+        };
+    }
+
+    /**
+     * 自定义一个接口回调
+     */
+    public interface ICallBack {
+
+        void onSuccessful(Call call, String data);
+
+        void onFailure(Call call, String errorMsg);
+
+    }
+
+    public OkHttpUtils postString(String isJsonPost) {
+        RequestBody requestBody;
+        requestBody = RequestBody.create(MediaType.parse("application/json; charset=utf-8"), isJsonPost);
+        request = new Request.Builder().post(requestBody).url(url);
+        return this;
+    }
+
+}

+ 67 - 0
yqk-common/src/main/java/com/yx/face/boot/uitls/PageInfoUtil.java

@@ -0,0 +1,67 @@
+package com.yx.face.boot.uitls;
+
+import com.github.pagehelper.Page;
+import com.github.pagehelper.PageInfo;
+import org.springframework.beans.BeanUtils;
+
+import java.util.List;
+import java.util.stream.Collectors;
+
+public class PageInfoUtil {
+    @FunctionalInterface
+    public interface PageInfoConvertor<T, R> {
+        /**
+         * convert 将 T 类型对象转换为 R 类型对象
+         *
+         * @param t 原始类型对象
+         * @return 目标类型对象
+         */
+        R convert(T t);
+    }
+
+    /**
+     * convertPageInfo 转换 PageInfo 泛型类型
+     *
+     * @param sourcePageInfo 原始的 pageInfo 对象
+     * @param convertor      自定义转换器
+     * @param <T>            原始类型
+     * @param <R>            目标类型
+     * @return 转换之后的 PageInfo 对象
+     */
+    public static <T, R> PageInfo<R> convertPageInfo(PageInfo<T> sourcePageInfo, PageInfoConvertor<T, R> convertor) {
+        Page<R> page = new Page<>(sourcePageInfo.getPageNum(), sourcePageInfo.getPageSize());
+        page.setTotal(sourcePageInfo.getTotal());
+
+        PageInfo<R> targetPageInfo = new PageInfo<>(page);
+        List<R> targetList = sourcePageInfo.getList().stream().map(convertor::convert).collect(Collectors.toList());
+        targetPageInfo.setList(targetList);
+        return targetPageInfo;
+    }
+
+    /**
+     * convertPageInfo 转换 PageInfo 泛型类型
+     *
+     * @param sourcePageInfo 原始的 pageInfo 对象
+     * @param targetClazz    需要转换的 PageInfo 泛型类型
+     * @param <T>            原始类型
+     * @param <R>            目标类型
+     * @return 转换之后的 PageInfo 对象
+     */
+    public static <T, R> PageInfo<R> convertPageInfo(PageInfo<T> sourcePageInfo, Class<R> targetClazz) {
+        Page<R> page = new Page<>(sourcePageInfo.getPageNum(), sourcePageInfo.getPageSize());
+        page.setTotal(sourcePageInfo.getTotal());
+
+        PageInfo<R> targetPageInfo = new PageInfo<>(page);
+        List<R> targetList = sourcePageInfo.getList().stream().map(e -> {
+            try {
+                R r = targetClazz.getDeclaredConstructor().newInstance();
+                BeanUtils.copyProperties(e, r);
+                return r;
+            } catch (Exception exception) {
+                throw new RuntimeException("convertPageInfo cause exception", exception);
+            }
+        }).collect(Collectors.toList());
+        targetPageInfo.setList(targetList);
+        return targetPageInfo;
+    }
+}

+ 18 - 0
yqk-common/src/main/java/com/yx/face/boot/uitls/PasswordUtils.java

@@ -0,0 +1,18 @@
+package com.yx.face.boot.uitls;
+
+import com.yx.face.boot.core.Constants;
+import org.springframework.util.DigestUtils;
+
+/**
+ * @description: PasswordUtils <br>
+ * @date: 2021/5/20 16:30 <br>
+ * @author: PWB <br>
+ */
+public class PasswordUtils {
+
+    public static String buildPw(String password) {
+        return DigestUtils.md5DigestAsHex(Constants.SALT_PRE.concat(password).concat(Constants.SALT).getBytes());
+    }
+
+
+}

+ 65 - 0
yqk-common/src/main/java/com/yx/face/boot/uitls/Preconditions.java

@@ -0,0 +1,65 @@
+package com.yx.face.boot.uitls;
+
+import java.util.List;
+import java.util.Map;
+
+/**
+ * @author shisl
+ * @package com.yx.face.boot.uitls
+ * @class Preconditions
+ * @date 2022/9/22 上午11:23
+ * @description
+ */
+public class Preconditions {
+    /**
+     * check if object is null for List Map String
+     *
+     * @param t
+     * @param <T>
+     * @return
+     */
+    public static <T> boolean isBlank(T t) {
+
+        boolean result = false;
+
+        if (t == null) {
+            return true;
+        }
+
+        if (t instanceof List) {
+            if (((List) t).size() == 0) {
+                return true;
+            }
+        } else if (t instanceof Map) {
+            if (((Map) t).size() == 0) {
+                return true;
+            }
+        } else if (t instanceof Object[]) {
+            if (((Object[]) t).length == 0) {
+                return true;
+            }
+        } else if (t instanceof String) {
+            int strLen;
+
+            strLen = ((String) t).length();
+            if (strLen == 0) {
+                return true;
+            }
+
+            for (int i = 0; i < strLen; i++) {
+                if ((!Character.isWhitespace(((String) t).charAt(i)))) {
+                    return false;
+                }
+            }
+
+            return true;
+        }
+
+        return result;
+    }
+
+    public static <T> boolean isNotBlank(T t) {
+        return !isBlank(t);
+    }
+
+}

+ 207 - 0
yqk-common/src/main/java/com/yx/face/boot/uitls/QRCodeUtil.java

@@ -0,0 +1,207 @@
+/**
+ * Copyright (C), 2018-2019, XXX有限公司
+ * FileName: QRCodeUtil
+ * Author:   pwb
+ * Date:     2019/7/13 9:16
+ * Description: QRCodeUtil
+ * History:
+ * <author>          <time>          <version>          <desc>
+ * frank           修改时间           1.0.0              ycypApp
+ */
+package com.yx.face.boot.uitls;
+
+
+import com.google.zxing.*;
+import com.google.zxing.client.j2se.BufferedImageLuminanceSource;
+import com.google.zxing.common.BitMatrix;
+import com.google.zxing.common.HybridBinarizer;
+import com.google.zxing.qrcode.decoder.ErrorCorrectionLevel;
+
+import javax.imageio.ImageIO;
+import javax.servlet.http.HttpServletResponse;
+import java.awt.*;
+import java.awt.geom.RoundRectangle2D;
+import java.awt.image.BufferedImage;
+import java.io.File;
+import java.io.OutputStream;
+import java.util.HashMap;
+import java.util.Hashtable;
+import java.util.Map;
+
+public class QRCodeUtil {
+    private static final String CHARSET = "utf-8";
+    private static final String FORMAT_NAME = "JPG";
+    // 二维码尺寸
+    private static final int QRCODE_SIZE = 300;
+    // LOGO宽度
+    private static final int WIDTH = 60;
+    // LOGO高度
+    private static final int HEIGHT = 60;
+
+    private static BufferedImage createImage(String content, String imgPath, boolean needCompress) throws Exception {
+        Hashtable hints = new Hashtable();
+        hints.put(EncodeHintType.ERROR_CORRECTION, ErrorCorrectionLevel.H);
+        hints.put(EncodeHintType.CHARACTER_SET, CHARSET);
+        hints.put(EncodeHintType.MARGIN, 1);
+        BitMatrix bitMatrix = new MultiFormatWriter().encode(content, BarcodeFormat.QR_CODE, QRCODE_SIZE, QRCODE_SIZE,
+                hints);
+        int width = bitMatrix.getWidth();
+        int height = bitMatrix.getHeight();
+        BufferedImage image = new BufferedImage(width, height, BufferedImage.TYPE_INT_RGB);
+        for (int x = 0; x < width; x++) {
+            for (int y = 0; y < height; y++) {
+                image.setRGB(x, y, bitMatrix.get(x, y) ? 0xFF000000 : 0xFFFFFFFF);
+            }
+        }
+        if (imgPath == null || "".equals(imgPath)) {
+            return image;
+        }
+        // 插入图片
+        QRCodeUtil.insertImage(image, imgPath, needCompress);
+        return image;
+    }
+
+    private static void insertImage(BufferedImage source, String imgPath, boolean needCompress) throws Exception {
+        File file = new File(imgPath);
+        if (!file.exists()) {
+            System.err.println("" + imgPath + "   该文件不存在!");
+            return;
+        }
+        Image src = ImageIO.read(new File(imgPath));
+        int width = src.getWidth(null);
+        int height = src.getHeight(null);
+        if (needCompress) { // 压缩LOGO
+            if (width > WIDTH) {
+                width = WIDTH;
+            }
+            if (height > HEIGHT) {
+                height = HEIGHT;
+            }
+            Image image = src.getScaledInstance(width, height, Image.SCALE_SMOOTH);
+            BufferedImage tag = new BufferedImage(width, height, BufferedImage.TYPE_INT_RGB);
+            Graphics g = tag.getGraphics();
+            g.drawImage(image, 0, 0, null); // 绘制缩小后的图
+            g.dispose();
+            src = image;
+        }
+        // 插入LOGO
+        Graphics2D graph = source.createGraphics();
+        int x = (QRCODE_SIZE - width) / 2;
+        int y = (QRCODE_SIZE - height) / 2;
+        graph.drawImage(src, x, y, width, height, null);
+        Shape shape = new RoundRectangle2D.Float(x, y, width, width, 6, 6);
+        graph.setStroke(new BasicStroke(3f));
+        graph.draw(shape);
+        graph.dispose();
+    }
+
+
+    public static void encode(String content, String imgPath, String destPath, boolean needCompress) throws Exception {
+        BufferedImage image = QRCodeUtil.createImage(content, imgPath, needCompress);
+        mkdirs(destPath);
+        // String file = new Random().nextInt(99999999)+".jpg";
+        // ImageIO.write(image, FORMAT_NAME, new File(destPath+"/"+file));
+        ImageIO.write(image, FORMAT_NAME, new File(destPath));
+    }
+
+
+
+    public static BufferedImage encode(String content, String imgPath, boolean needCompress) throws Exception {
+        BufferedImage image = QRCodeUtil.createImage(content, imgPath, needCompress);
+        return image;
+    }
+
+
+
+    public static void mkdirs(String destPath) {
+        File file = new File(destPath);
+        // 当文件夹不存在时,mkdirs会自动创建多层目录,区别于mkdir.(mkdir如果父目录不存在则会抛出异常)
+        if (!file.exists() && !file.isDirectory()) {
+            file.mkdirs();
+        }
+    }
+
+
+
+    public static void encode(String content, String imgPath, String destPath) throws Exception {
+        QRCodeUtil.encode(content, imgPath, destPath, false);
+    }
+    // 被注释的方法
+    /*
+     * public static void encode(String content, String destPath, boolean
+     * needCompress) throws Exception { QRCodeUtil.encode(content, null, destPath,
+     * needCompress); }
+     */
+
+
+    public static void encode(String content, String destPath) throws Exception {
+        QRCodeUtil.encode(content, null, destPath, false);
+    }
+
+
+    public static void encode(String content, String imgPath, OutputStream output, boolean needCompress)
+            throws Exception {
+        BufferedImage image = QRCodeUtil.createImage(content, imgPath, needCompress);
+        ImageIO.write(image, FORMAT_NAME, output);
+    }
+
+
+
+    public static void encode(String content, OutputStream output) throws Exception {
+        QRCodeUtil.encode(content, null, output, false);
+    }
+
+
+
+    public static String decode(File file) throws Exception {
+        BufferedImage image;
+        image = ImageIO.read(file);
+        if (image == null) {
+            return null;
+        }
+        BufferedImageLuminanceSource source = new BufferedImageLuminanceSource(image);
+        BinaryBitmap bitmap = new BinaryBitmap(new HybridBinarizer(source));
+        Result result;
+        Hashtable hints = new Hashtable();
+        hints.put(DecodeHintType.CHARACTER_SET, CHARSET);
+        result = new MultiFormatReader().decode(bitmap, hints);
+        String resultStr = result.getText();
+        return resultStr;
+    }
+
+
+    public static String decode(String path) throws Exception {
+        return QRCodeUtil.decode(new File(path));
+    }
+
+
+
+    public static BitMatrix generateQRCodeStream(String content, HttpServletResponse response) {
+        //给相应添加头部信息,主要告诉浏览器返回的是图片流
+        response.setHeader("Cache-Control", "no-store");
+        // 不设置缓存
+        response.setHeader("Pragma", "no-cache");
+        response.setDateHeader("Expires", 0);
+        response.setContentType("image/png");
+        //设置图片的文字编码以及内边框
+        Map<EncodeHintType, Object> hints = new HashMap<>();
+        //编码
+        hints.put(EncodeHintType.CHARACTER_SET, "UTF-8");
+        //边框距
+        hints.put(EncodeHintType.MARGIN, 0);
+
+
+        BitMatrix bitMatrix;
+        try {
+            //参数分别为:编码内容、编码类型、图片宽度、图片高度,设置参数
+            bitMatrix = new MultiFormatWriter().encode(content, BarcodeFormat.QR_CODE, 300, 300, hints);
+        } catch (WriterException e) {
+            e.printStackTrace();
+            return null;
+        }
+        return bitMatrix;
+
+    }
+
+
+}

+ 168 - 0
yqk-common/src/main/java/com/yx/face/boot/uitls/RandomUtils.java

@@ -0,0 +1,168 @@
+package com.yx.face.boot.uitls;
+
+import java.math.BigDecimal;
+import java.util.Random;
+
+/**
+ * @author shisl
+ * @package com.yx.face.boot.uitls
+ * @class RandomUtils
+ * @date 2022/11/17 上午10:24
+ * @description
+ */
+public class RandomUtils {
+    public static final String ALL_CHAR = "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";
+    public static final String LETTER_CHAR = "abcdefghijkllmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";
+    public static final String NUMBER_CHAR = "0123456789";
+
+    /**
+     * 返回一个定长的随机字符串(只包含大小写字母、数字)
+     *
+     * @param length 随机字符串长度
+     * @return 随机字符串
+     */
+    public static String generateString(int length) {
+        StringBuffer sb = new StringBuffer();
+        Random random = new Random();
+        for (int i = 0; i < length; i++) {
+            sb.append(ALL_CHAR.charAt(random.nextInt(ALL_CHAR.length())));
+        }
+        return sb.toString();
+    }
+
+    /**
+     * 返回一个定长的随机纯字母字符串(只包含大小写字母)
+     *
+     * @param length 随机字符串长度
+     * @return 随机字符串
+     */
+    public static String generateMixString(int length) {
+        StringBuffer sb = new StringBuffer();
+        Random random = new Random();
+        for (int i = 0; i < length; i++) {
+            sb.append(LETTER_CHAR.charAt(random.nextInt(LETTER_CHAR.length())));
+        }
+        return sb.toString();
+    }
+
+    /**
+     * 返回一个定长的随机纯大写字母字符串(只包含大小写字母)
+     *
+     * @param length 随机字符串长度
+     * @return 随机字符串
+     */
+    public static String generateLowerString(int length) {
+        return generateMixString(length).toLowerCase();
+    }
+
+    /**
+     * 返回一个定长的随机纯小写字母字符串(只包含大小写字母)
+     *
+     * @param length 随机字符串长度
+     * @return 随机字符串
+     */
+    public static String generateUpperString(int length) {
+        return generateMixString(length).toUpperCase();
+    }
+
+    /**
+     * 生成一个定长的纯0字符串
+     *
+     * @param length 字符串长度
+     * @return 纯0字符串
+     */
+    public static String generateZeroString(int length) {
+        StringBuffer sb = new StringBuffer();
+        for (int i = 0; i < length; i++) {
+            sb.append('0');
+        }
+        return sb.toString();
+    }
+
+    /**
+     * 根据数字生成一个定长的字符串,长度不够前面补0
+     *
+     * @param num        数字
+     * @param fixedLenth 字符串长度
+     * @return 定长的字符串
+     */
+    public static String toFixedLengthString(long num, int fixedLenth) {
+        StringBuffer sb = new StringBuffer();
+        String strNum = String.valueOf(num);
+        if (fixedLenth - strNum.length() >= 0) {
+            sb.append(generateZeroString(fixedLenth - strNum.length()));
+        } else {
+            throw new RuntimeException("将数字" + num + "转化为长度为" + fixedLenth
+                    + "的字符串发生异常!");
+        }
+        sb.append(strNum);
+        return sb.toString();
+    }
+
+    /**
+     * 每次生成的len位数都不相同
+     *
+     * @param param
+     * @return 定长的数字
+     */
+    public static int getNotSimple(int[] param, int len) {
+        Random rand = new Random();
+        for (int i = param.length; i > 1; i--) {
+            int index = rand.nextInt(i);
+            int tmp = param[index];
+            param[index] = param[i - 1];
+            param[i - 1] = tmp;
+        }
+        int result = 0;
+        for (int i = 0; i < len; i++) {
+            result = result * 10 + param[i];
+        }
+        return result;
+    }
+
+
+    /**
+     * 获取随机的几位数字
+     *
+     * @param length
+     * @return
+     */
+    public static String generateNumberString(int length) {
+        StringBuffer sb = new StringBuffer();
+        Random random = new Random();
+        for (int i = 0; i < length; i++) {
+            sb.append(NUMBER_CHAR.charAt(random.nextInt(NUMBER_CHAR.length())));
+        }
+        return sb.toString();
+    }
+
+    /**
+     * @param number
+     * @param decimal
+     * @return
+     */
+    public static String round(double number, int decimal) {
+        return new BigDecimal(number).setScale(decimal, BigDecimal.ROUND_HALF_UP).toString();
+    }
+
+
+    /**
+     * max >= min
+     *
+     * @param min
+     * @param max
+     * @return 返回min(包括)和max(包括)之间的整数
+     */
+    public static int random(int min, int max) {
+        if (max > min) {
+            return new Random().nextInt(max + 1 - min) + min;
+        } else {
+            return min;
+        }
+    }
+
+    public static void main(String[] args) {
+        System.out.println(generateString(16).toLowerCase());
+    }
+
+}

+ 242 - 0
yqk-common/src/main/java/com/yx/face/boot/uitls/SMSOrIdCardUtils.java

@@ -0,0 +1,242 @@
+package com.yx.face.boot.uitls;
+
+import cn.hutool.core.util.DesensitizedUtil;
+import cn.hutool.core.util.IdcardUtil;
+import com.yx.face.model.enums.SexEnum;
+import org.apache.commons.lang3.StringUtils;
+
+import java.util.Calendar;
+import java.util.Date;
+import java.util.regex.Pattern;
+
+/**
+ * @author cyh
+ * @Description
+ * @date 2021/4/9 13:58
+ */
+public class SMSOrIdCardUtils {
+
+    //校验手机是否合规 2020年最全的国内手机号格式
+    private static final String REGEX_MOBILE = "^1\\d{10}$";
+
+    //校验身份证号码
+    private static final String REGEX_ID = "(^[1-9]\\d{5}(18|19|20)\\d{2}((0[1-9])|(10|11|12))(([0-2][1-9])|10|20|30|31)\\d{3}[0-9Xx]$)|" + "(^[1-9]\\d{5}\\d{2}((0[1-9])|(10|11|12))(([0-2][1-9])|10|20|30|31)\\d{3}$)";
+
+
+    /**
+     * 校验手机号
+     *
+     * @param phone 手机号
+     * @return boolean true:是  false:否
+     */
+    public static boolean isMobile(String phone) {
+        return Pattern.matches(REGEX_MOBILE, phone);
+    }
+
+    /**
+     * 校验身份证
+     *
+     * @param IDNumber
+     * @return boolean true:是  false:否
+     */
+    public static boolean isIdCard(String IDNumber) {
+        if (IDNumber == null || "".equals(IDNumber)) {
+            return false;
+        }
+        boolean matches = IDNumber.matches(REGEX_ID);
+
+        //判断第18位校验值
+        if (matches) {
+
+            if (IDNumber.length() == 18) {
+                try {
+                    char[] charArray = IDNumber.toCharArray();
+                    //前十七位加权因子
+                    int[] idCardWi = {7, 9, 10, 5, 8, 4, 2, 1, 6, 3, 7, 9, 10, 5, 8, 4, 2};
+                    //这是除以11后,可能产生的11位余数对应的验证码
+                    String[] idCardY = {"1", "0", "X", "9", "8", "7", "6", "5", "4", "3", "2"};
+                    int sum = 0;
+                    for (int i = 0; i < idCardWi.length; i++) {
+                        int current = Integer.parseInt(String.valueOf(charArray[i]));
+                        int count = current * idCardWi[i];
+                        sum += count;
+                    }
+                    char idCardLast = charArray[17];
+                    int idCardMod = sum % 11;
+                    if (idCardY[idCardMod].equals(String.valueOf(idCardLast))) {
+                        return true;
+                    } else {
+                        return false;
+                    }
+                } catch (Exception e) {
+                    e.printStackTrace();
+                    return false;
+                }
+            }
+        }
+        return matches;
+    }
+
+    /*
+    隐藏手机号中间的部分
+     */
+    public static String hidePhone(String phone) {
+        if (StringUtils.isBlank(phone) || phone.length() != 11) {
+            return phone;
+        }
+        return phone.replaceAll("(\\d{3})\\d{4}(\\d{4})", "$1****$2");
+    }
+
+
+    /*
+    隐藏身份证中间的部分
+     */
+    public static String hideIdNumber(String idNumber) {
+        if (!IdcardUtil.isValidCard(idNumber)) {
+            return idNumber;
+        }
+        return IdcardUtil.hide(idNumber, 4, 14);
+    }
+
+    /**
+     * 隐藏场所码中间的部分
+     *
+     * @param addressCode
+     * @return
+     */
+    public static String hideAddressCode(String addressCode) {
+        if (StringUtils.isBlank(addressCode)) {
+            return addressCode;
+        }
+        return addressCode.substring(0, 4) + "*****" + addressCode.substring(14);
+    }
+
+    /*
+    隐藏姓名  的名部分
+    */
+    public static String hideName(String name) {
+        return DesensitizedUtil.chineseName(name);
+    }
+
+
+    /*
+     * 根据身份证号获取年龄
+     * */
+    public static int getAge(String idCard) {
+        String birthday = idCard.substring(6, 14);
+        Calendar now = Calendar.getInstance();
+        int nowYear = now.get(Calendar.YEAR);
+        int nowMonth = (now.get(Calendar.MONTH) + 1);
+        int nowDay = now.get(Calendar.DAY_OF_MONTH);
+
+        int year = Integer.parseInt(birthday.substring(0, 4));
+        int month = Integer.parseInt(birthday.substring(4, 6));
+        int day = Integer.parseInt(birthday.substring(6));
+
+
+        int age = nowYear - year;
+        if (age <= 0 || age >= 100) {
+            return -1;
+        }
+        if (nowMonth - month > 0) {
+            return age;
+        }
+        if (nowMonth - month == 0) {
+            if (nowDay - day >= 0) {
+                return age;
+            }
+        }
+        return age - 1;
+    }
+
+    /**
+     * 通过身份证号获取性别
+     *
+     * @param identifyNumber
+     * @return 若身份证号不规范泽返回null
+     */
+    public static SexEnum getGender(String identifyNumber) {
+
+        if (Preconditions.isNotBlank(identifyNumber)) {
+            String gender;
+
+            if (identifyNumber.length() == 15) {
+                gender = identifyNumber.substring(14, 15);
+            } else if (identifyNumber.length() == 18) {
+                gender = identifyNumber.substring(16, 17);
+            } else {
+                return null;
+            }
+            // 奇数为男 偶数为女
+            return Integer.parseInt(gender) % 2 == 0 ? SexEnum.FEMALE : SexEnum.MALE;
+        }
+
+        return null;
+    }
+
+    /**
+     * 从身份证中获取出生日期
+     *
+     * @param idcard
+     * @return 当解析失败(身份证为空,身份证不正确等)时,返回empty
+     */
+    public static String getBirthDate(String idcard) {
+        if (Preconditions.isBlank(idcard)) {
+            return null;
+        }
+
+        if (idcard.length() == 18) {
+            try {
+                Date d = DateUtils.parse(idcard.substring(6, 14), DateUtils.YYYY_MM_DD);
+                return DateUtils.parseDateToStr(DateUtils.YYYY_MM_DD, d);
+            } catch (Exception e) {
+                return null;
+            }
+        }
+
+        if (idcard.length() == 15) {
+            try {
+                Date d = DateUtils.parse("19" + idcard.substring(6, 12), DateUtils.YYYY_MM_DD);
+                return DateUtils.parseDateToStr(DateUtils.YYYY_MM_DD, d);
+            } catch (Exception e) {
+                return null;
+            }
+        }
+        return null;
+    }
+
+    /**
+     * 根据年月日计算真实年龄
+     *
+     * @param birthday 1997-09-09
+     * @return
+     */
+    public static int calAgeByBirthday(String birthday) {
+        Date parseBirthDay = DateUtils.parse(birthday, DateUtils.YYYY_MM_DD);
+        Calendar cal = Calendar.getInstance();
+        if (cal.before(parseBirthDay)) { //出生日期晚于当前时间,无法计算
+            throw new IllegalArgumentException("出生日期晚于当前时间,无法计算");
+        }
+        int yearNow = cal.get(Calendar.YEAR);  //当前年份
+        int monthNow = cal.get(Calendar.MONTH);  //当前月份
+        int dayOfMonthNow = cal.get(Calendar.DAY_OF_MONTH); //当前日期
+        cal.setTime(parseBirthDay);
+        int yearBirth = cal.get(Calendar.YEAR);
+        int monthBirth = cal.get(Calendar.MONTH);
+        int dayOfMonthBirth = cal.get(Calendar.DAY_OF_MONTH);
+        int age = yearNow - yearBirth;   //计算整岁数
+        if (monthNow <= monthBirth) {
+            if (monthNow == monthBirth) {
+                if (dayOfMonthNow < dayOfMonthBirth) age--;//当前日期在生日之前,年龄减一
+            } else {
+                age--;//当前月份在生日之前,年龄减一
+            }
+        }
+        return age;
+    }
+
+    public static void main(String[] args) {
+        System.out.println(calAgeByBirthday("1993-03-01"));
+    }
+
+}

+ 125 - 0
yqk-common/src/main/java/com/yx/face/boot/uitls/Sm4Util.java

@@ -0,0 +1,125 @@
+package com.yx.face.boot.uitls;
+
+import cn.hutool.core.util.StrUtil;
+import cn.hutool.crypto.SecureUtil;
+import cn.hutool.crypto.symmetric.SymmetricCrypto;
+import com.alibaba.fastjson.JSONObject;
+import lombok.extern.slf4j.Slf4j;
+
+import java.nio.charset.Charset;
+/**
+ * @author shisl
+ * @package com.yx.face.boot.uitls
+ * @class Sm4Util
+ * @date 2023/6/2 上午10:52
+ * @description
+ */
+@Slf4j
+public class Sm4Util {
+
+    /**
+     * 加密
+     *
+     * @param privateKey 管理员提供
+     * @param str
+     * @return
+     */
+    public static String encrypt(final String privateKey, final String str) {
+        if (StrUtil.isBlank((CharSequence) str)) {
+            return "";
+        }
+        SymmetricCrypto sm4 = new SymmetricCrypto("SM4/ECB/PKCS5Padding", privateKey.getBytes());
+        String sm4Encrypt = sm4.encryptHex(str, Charset.forName("UTF-8"));
+        return sm4Encrypt;
+    }
+
+    /**
+     * 解密
+     *
+     * @param privateKey 管理员提供
+     * @param str
+     * @return
+     */
+    public static String decrypt(final String privateKey, final String str) {
+        if (StrUtil.isBlank((CharSequence) str)) {
+            return null;
+        }
+        try {
+            SymmetricCrypto sm4 = new SymmetricCrypto("SM4/ECB/PKCS5Padding", privateKey.getBytes());
+            String sm4Decrypt = sm4.decryptStr(str, Charset.forName("UTF-8"));
+            return sm4Decrypt;
+        } catch (Exception e) {
+            log.error("解密失败", e);
+            return null;
+        }
+    }
+
+    /**
+     * 验证签名
+     *
+     * @param appKey
+     * @param appSecret
+     * @param sign
+     * @param timestamp
+     * @return
+     */
+    public static Boolean checkSign(String appKey, String appSecret, String sign, String timestamp) {
+        if (Preconditions.isBlank(sign) || Preconditions.isBlank(timestamp)) {
+            return Boolean.FALSE;
+        }
+
+        String dbSign = SecureUtil.md5(new StringBuilder().append(appKey)
+                .append(appSecret)
+                .append(timestamp).toString()).toLowerCase();
+        if (!dbSign.equals(sign)) {
+            return Boolean.FALSE;
+        }
+        return Boolean.TRUE;
+    }
+
+    /**
+     * 获取签名
+     *
+     * @param appKey
+     * @param appSecret
+     * @param timestamp
+     * @return
+     */
+    public static String getSign(String appKey, String appSecret, String timestamp) {
+        String sign = SecureUtil.md5(new StringBuilder().append(appKey)
+                .append(appSecret)
+                .append(timestamp).toString()).toLowerCase();
+        return sign;
+    }
+
+
+    public static void main(String[] args) {
+        //基础信息
+//        Map<String, Object> map = new HashMap<>();
+//        map.put("idNumber", "330481199704031831");
+//        map.put("name", "王鑫刚");
+//        map.put("phone", "13515834834");
+//        map.put("qrcode", "");
+//        map.put("sn", "1351583T234834");
+//        map.put("verifyType", "IDCARD");
+
+        System.out.println(AesUtils.generateKey());
+        String s = AesUtils.encode("a2f0e24913f378add01b9f36546a2edb", "123456");
+        System.out.println(s);
+        System.out.println(AesUtils.decode("a2f0e24913f378add01b9f36546a2edb",s));
+
+
+        JSONObject jsonObject = new JSONObject();
+        jsonObject.put("sfzh", "330481199704031831");
+//        String str = "欧阳明";
+        String encrypt = Sm4Util.encrypt("dvhrjn7qycki05pd", jsonObject.toJSONString());
+        System.out.println(encrypt);
+        String decrypt = Sm4Util.decrypt("dvhrjn7qycki05pd", encrypt);
+        System.out.println(decrypt);
+        String timestamp = String.valueOf(System.currentTimeMillis());
+        System.out.println(timestamp);
+        System.out.println(Sm4Util.getSign("hha9LJw4TgV", "605f83d833be21f94582a920228e03fc9a072809", timestamp));
+
+    }
+
+}

+ 91 - 0
yqk-common/src/main/java/com/yx/face/boot/uitls/StringToHexUtils.java

@@ -0,0 +1,91 @@
+package com.yx.face.boot.uitls;
+
+/**
+ * @author shisl
+ * @package com.yx.face.boot.uitls
+ * @class StringToHexUtils
+ * @date 2023/8/28 上午10:41
+ * @description
+ */
+public class StringToHexUtils {
+
+    /**
+     * 字符串转换为16进制字符串
+     *
+     * @param s
+     * @return
+     */
+    public static String stringToHexString(String s) {
+        String str = "";
+        for (int i = 0; i < s.length(); i++) {
+            int ch = s.charAt(i);
+            String s4 = Integer.toHexString(ch);
+            str = str + s4;
+        }
+        return str;
+    }
+
+    /**
+     * 16进制字符串转换为字符串
+     *
+     * @param s
+     * @return
+     */
+    public static String hexStringToString(String s) {
+        if (s == null || s.equals("")) {
+            return null;
+        }
+        s = s.replace(" ", "");
+        byte[] baKeyword = new byte[s.length() / 2];
+        for (int i = 0; i < baKeyword.length; i++) {
+            try {
+                baKeyword[i] = (byte) (0xff & Integer.parseInt(
+                        s.substring(i * 2, i * 2 + 2), 16));
+            } catch (Exception e) {
+                e.printStackTrace();
+            }
+        }
+        try {
+            s = new String(baKeyword, "gbk");
+            new String();
+        } catch (Exception e1) {
+            e1.printStackTrace();
+        }
+        return s;
+    }
+
+    /**
+     * 16进制表示的字符串转换为字节数组
+     *
+     * @param s 16进制表示的字符串
+     * @return byte[] 字节数组
+     */
+    public static byte[] hexStringToByteArray(String s) {
+        int len = s.length();
+        byte[] b = new byte[len / 2];
+        for (int i = 0; i < len; i += 2) {
+            // 两位一组,表示一个字节,把这样表示的16进制字符串,还原成一个字节
+            b[i / 2] = (byte) ((Character.digit(s.charAt(i), 16) << 4) + Character
+                    .digit(s.charAt(i + 1), 16));
+        }
+        return b;
+    }
+
+    /**
+     * byte数组转16进制字符串
+     * @param bArray
+     * @return
+     */
+    public static final String bytesToHexString(byte[] bArray) {
+        StringBuffer sb = new StringBuffer(bArray.length);
+        String sTemp;
+        for (int i = 0; i < bArray.length; i++) {
+            sTemp = Integer.toHexString(0xFF & bArray[i]);
+            if (sTemp.length() < 2)
+                sb.append(0);
+            sb.append(sTemp.toUpperCase());
+        }
+        return sb.toString();
+    }
+}
+

+ 244 - 0
yqk-common/src/main/java/com/yx/face/boot/uitls/ThumbnailsUtil.java

@@ -0,0 +1,244 @@
+package com.yx.face.boot.uitls;
+
+import com.yx.face.boot.core.Constants;
+import lombok.extern.slf4j.Slf4j;
+import net.coobird.thumbnailator.Thumbnails;
+
+import javax.imageio.ImageIO;
+import java.awt.image.BufferedImage;
+import java.io.*;
+import java.math.BigDecimal;
+
+/**
+ * @description: 图片压制至小于指定大小
+ * @ClassName ThumbnailsUtil
+ * @Author WXG
+ * @Date 2021/10/20 15:28
+ */
+@Slf4j
+public class ThumbnailsUtil {
+    private static final Integer ZERO = 0;
+    private static final Integer ONE_ZERO_TWO_FOUR = 1024;
+    private static final Integer NINE_ZERO_ZERO = 900;
+    private static final Integer THREE_TWO_SEVEN_FIVE = 3275;
+    private static final Integer TWO_ZERO_FOUR_SEVEN = 2047;
+    private static final Double ZERO_EIGHT_FIVE = 0.85;
+    private static final Double ZERO_SIX = 0.6;
+    private static final Double ZERO_FOUR_FOUR = 0.44;
+    private static final Double ZERO_FOUR = 0.4;
+
+
+    public static byte[] compressPicForScale(byte[] imageBytes, long desFileSize) {
+        if (imageBytes == null || imageBytes.length <= ZERO || imageBytes.length < desFileSize * ONE_ZERO_TWO_FOUR) {
+            return imageBytes;
+        }
+        long srcSize = imageBytes.length;
+        double accuracy = getAccuracy(srcSize / ONE_ZERO_TWO_FOUR);
+        try {
+            while (imageBytes.length > desFileSize * ONE_ZERO_TWO_FOUR) {
+                ByteArrayInputStream inputStream = new ByteArrayInputStream(imageBytes);
+                ByteArrayOutputStream outputStream = new ByteArrayOutputStream(imageBytes.length);
+                Thumbnails.of(inputStream)
+                        .scale(accuracy)
+                        .outputQuality(accuracy)
+                        .toOutputStream(outputStream);
+                imageBytes = outputStream.toByteArray();
+            }
+            log.info("图片原大小={}kb | 压缩后大小={}kb",
+                    srcSize / ONE_ZERO_TWO_FOUR, imageBytes.length / ONE_ZERO_TWO_FOUR);
+        } catch (Exception e) {
+            log.error("【图片压缩】msg=图片压缩失败!", e);
+        }
+        return imageBytes;
+    }
+
+    public static double getAccuracy(long size) {
+        double accuracy;
+        if (size < NINE_ZERO_ZERO) {
+            accuracy = ZERO_EIGHT_FIVE;
+        } else if (size < TWO_ZERO_FOUR_SEVEN) {
+            accuracy = ZERO_SIX;
+        } else if (size < THREE_TWO_SEVEN_FIVE) {
+            accuracy = ZERO_FOUR_FOUR;
+        } else {
+            accuracy = ZERO_FOUR;
+        }
+        return accuracy;
+    }
+
+
+    /**
+     * 对图片进行原比例无损压缩,压缩后覆盖原图片
+     *
+     * @param path
+     * @param maxkb
+     */
+    public static byte[] compressCycle(String path, Integer maxkb) {
+        try {
+            return compressPhoto(new File(path), maxkb, null, null, 0.9f);
+        } catch (Exception e) {
+            log.error("压缩图片失败!", e);
+        }
+        return null;
+    }
+
+    public static byte[] compressCycle(byte[] bytes, Integer maxkb) {
+        try {
+            return compressPhoto(bytes, maxkb, null, null, 0.9f);
+        } catch (Exception e) {
+            log.error("压缩图片失败!", e);
+        }
+        return null;
+    }
+
+    public static byte[] compressPhoto(byte[] bytes, Integer maxkb, Integer photoWidth, Integer photoHeight, Float quality) throws Exception {
+
+        // 2.是否超過100kb?沒超過就不處理圖片
+        long fileSize = bytes.length;
+        if (fileSize <= maxkb * 1024) {
+            log.info("图片不超过{}kb,无需压缩。", maxkb);
+            return bytes;
+        }
+
+        // 3.压缩到300-500宽高,100kb
+        BufferedImage bim = ImageIO.read(new ByteArrayInputStream(bytes));
+        int imgWidth = bim.getWidth();
+        int imgHeight = bim.getHeight();
+
+        // 3.1.先按宽高判断是否需要缩放  outputQuality=1确保画质清晰
+        if (photoWidth != null && photoHeight != null && imgWidth >= photoWidth && imgHeight >= photoHeight) {
+            log.info("先按宽{}高{}压缩。", photoWidth, photoHeight);
+            ByteArrayOutputStream out = new ByteArrayOutputStream();//Closing a <tt>ByteArrayOutputStream</tt> has no effect.   因此無需close
+            Thumbnails.of(new ByteArrayInputStream(bytes)).size(photoWidth, photoHeight).outputQuality(1).outputFormat("jpg").toOutputStream(out);
+            bytes = out.toByteArray();
+        }
+        // 3.2.判断按宽高缩放后是否超过100kb,超过就按质量压缩(图片会变得更模糊!)
+//        quality = (float) getAccuracy(bytes.length / 1024);
+        bytes = compressPhotoByQuality(bytes, quality, maxkb);
+        return bytes;
+    }
+
+    public static void main(String[] args) {
+        byte[] bytes = compressCycle("/Users/leon/hanghui_workspace/face-server/file/upload/imagesnew/20230915/202007011329308612.jpg", 50);
+        String filename = "202007011329308612.jpg";
+        String filePath = FileUtils.getDirectory(Constants.UPLOAD_IMAGE_NEW);
+        try {
+            FileUtils.saveByCopy(filename, filePath, new ByteArrayInputStream(bytes));
+        } catch (IOException e) {
+            e.printStackTrace();
+        }
+
+    }
+
+    /**
+     * 【压缩图片】到要求的图片标准:  宽[300,500],高[300,500];100kb;jpg/jpeg
+     * 先按宽高压缩,压缩后如果还不满足100kb,則按质量递归压缩
+     *
+     * @param imgFile     源原文件
+     * @param maxkb       目标kb
+     * @param photoWidth  目标寬度 172px
+     * @param photoHeight 模板高度 240px
+     * @param quality     质量
+     * @return 处理后的文件byte[]
+     * @throws Exception
+     * @Title:compressPhoto
+     * @Description: TODO
+     */
+    public static byte[] compressPhoto(File imgFile, Integer maxkb, Integer photoWidth, Integer photoHeight, Float quality) throws Exception {
+        // 1.压缩图片是否存在
+        if (imgFile == null || !imgFile.exists()) {
+            throw new Exception("图片文件不存在。");
+        }
+        byte[] bytes = readFileToByteArray(imgFile);
+        if (bytes == null || bytes.length == 0) {
+            throw new Exception("图片文件为空。");
+        }
+        return compressPhoto(bytes, maxkb, photoWidth, photoHeight, quality);
+    }
+
+    /**
+     * 遞歸按quality質量處理,壓縮到maxkb後返回新的bytes值
+     *
+     * @param bytes   源文件字節
+     * @param quality 壓縮質量 (如果爲1則不處理)
+     * @param maxkb   要求壓縮到的最大kb
+     * @return
+     * @throws IOException
+     * @Title:compressPhotoByQuality
+     * @Description: TODO
+     * @date 2020年6月30日 下午2:24:36
+     * @author yqwang
+     */
+    public static byte[] compressPhotoByQuality(byte[] bytes, Float quality, long maxkb) throws IOException {
+        if (bytes == null) {
+            return bytes;
+        }
+        log.info("开始按质量压缩图片({}kb)。", bytes.length / 1024);
+        // 如果配置的1,則不再处理
+        if (quality == 1) {
+            log.info("quality=1,不执行压缩。");
+            return bytes;
+        }
+        // 滿足目標kb值,則返回
+        long fileSize = bytes.length;
+        if (fileSize <= maxkb * 1024) {
+            log.info("图片文件{}kb<={}kb,不再压缩质量。", fileSize / 1024, maxkb);
+            return bytes;
+        }
+        // Closing a <tt>ByteArrayOutputStream</tt> has no effect.   因此無需close
+        ByteArrayOutputStream out = null;
+        out = new ByteArrayOutputStream();
+        BufferedImage bim = ImageIO.read(new ByteArrayInputStream(bytes));
+        int imgWidth = bim.getWidth();
+        int imgHeight = bim.getHeight();
+        // 如果不處理size,只用quality,可能導致一致壓縮不到目標值,一致遞歸在當前方法中!!
+        int desWidth = new BigDecimal(imgWidth).multiply(new BigDecimal(quality)).intValue();
+        int desHeight = new BigDecimal(imgHeight).multiply(new BigDecimal(quality)).intValue();
+        log.info("图片将按照width={}*height={}进行压缩,画质quality={}。", desWidth, desHeight, quality);
+        Thumbnails.of(new ByteArrayInputStream(bytes)).size(desWidth, desHeight).outputQuality(quality).outputFormat("jpg").toOutputStream(out);
+        //遞歸
+        return compressPhotoByQuality(out.toByteArray(), quality, maxkb);
+    }
+
+    /**
+     * File to bytes[]
+     */
+    public static byte[] readFileToByteArray(File f) throws Exception {
+        byte[] fileb = null;
+        InputStream is = null;
+        ByteArrayOutputStream out = new ByteArrayOutputStream();
+
+        try {
+            is = new FileInputStream(f);
+            byte[] b = new byte[1024];
+
+            int n;
+            while ((n = is.read(b)) != -1) {
+                out.write(b, 0, n);
+            }
+
+            fileb = out.toByteArray();
+            return fileb;
+        } catch (Exception var16) {
+            throw new Exception("readFileToByteArray", var16);
+        } finally {
+            if (is != null) {
+                try {
+                    is.close();
+                } catch (Exception var15) {
+                    ;
+                }
+            }
+
+            if (out != null) {
+                try {
+                    out.close();
+                } catch (Exception var14) {
+                }
+            }
+
+        }
+    }
+
+
+}

+ 27 - 0
yqk-common/src/main/java/com/yx/face/boot/uitls/WebAddressUtil.java

@@ -0,0 +1,27 @@
+package com.yx.face.boot.uitls;
+
+import cn.hutool.core.util.StrUtil;
+import org.springframework.beans.factory.annotation.Value;
+import org.springframework.stereotype.Component;
+
+import java.net.InetAddress;
+import java.net.UnknownHostException;
+
+@Component
+public class WebAddressUtil {
+
+    @Value("${server.port}")
+    private String port;
+    @Value("${server.servlet.context-path}")
+    private String contextPath;
+
+    public static String address;
+    @Value("${web.address}")
+    public void setWebAddress(String address) throws UnknownHostException {
+        if(StrUtil.isNotBlank(address)){
+            WebAddressUtil.address = address;
+            return;
+        }
+        WebAddressUtil.address = "http://" + InetAddress.getLocalHost().getHostAddress() + ":" + port + "/" + contextPath + "/";
+    }
+}

+ 46 - 0
yqk-common/src/main/java/com/yx/face/boot/uitls/excel/ExcelIO.java

@@ -0,0 +1,46 @@
+package com.yx.face.boot.uitls.excel;
+
+
+import org.apache.poi.openxml4j.exceptions.InvalidFormatException;
+
+import java.io.File;
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * @author lilei
+ * @version V 0.1
+ * @describe {}
+ * @time 2017/8/9 16:10.
+ */
+public class ExcelIO {
+    public static ExcelReader getReader() {
+        return new ExcelReader();
+    }
+
+    public static ExcelWriter getWriter() {
+        return new ExcelWriter();
+    }
+
+    public static void main(String[] args) {
+        List<Map<String, Object>> mapList = new ArrayList<>();
+        Map<String, Object> map = new HashMap<>();
+        map.put("name", "tom");
+        map.put("age", 18);
+        mapList.add(map);
+        File file = new File("excelTest.csv");
+        try {
+            ExcelIO.getWriter().generate(mapList, "mySheet")
+                    .write(file);
+            List<Map<String, String>> maplist = ExcelIO.getReader().read(file).toMaplist();
+            System.out.println(JsonUtil.obj2Json(maplist));
+        } catch (IOException e) {
+            e.printStackTrace();
+        } catch (InvalidFormatException e) {
+            e.printStackTrace();
+        }
+    }
+}

+ 115 - 0
yqk-common/src/main/java/com/yx/face/boot/uitls/excel/ExcelReader.java

@@ -0,0 +1,115 @@
+package com.yx.face.boot.uitls.excel;
+
+import cn.hutool.core.util.StrUtil;
+import lombok.extern.slf4j.Slf4j;
+import org.apache.poi.openxml4j.exceptions.InvalidFormatException;
+import org.apache.poi.ss.usermodel.*;
+
+import java.io.File;
+import java.io.IOException;
+import java.io.InputStream;
+import java.text.DecimalFormat;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * @author lilei
+ * @version V 0.1
+ * @describe {}
+ * @time 2017/8/9 16:10.
+ */
+@Slf4j
+public class ExcelReader {
+    private Workbook workbook;
+
+    public ExcelReader read(File file) throws IOException, InvalidFormatException {
+        return read(file, null);
+    }
+
+    public ExcelReader read(File file, String password) throws IOException, InvalidFormatException {
+        this.workbook = WorkbookFactory.create(file, password);
+        return this;
+    }
+
+    public ExcelReader read(InputStream inputStream) throws IOException, InvalidFormatException {
+        return read(inputStream, null);
+    }
+
+    public ExcelReader read(InputStream inputStream, String password) throws IOException, InvalidFormatException {
+        this.workbook = WorkbookFactory.create(inputStream, password);
+        return this;
+    }
+
+    public List<Map<String, String>> toMaplist(String sheetName, int titleRowIndex) {
+        return toMaplist(sheetName, 0, titleRowIndex);
+    }
+
+    public List<Map<String, String>> toMaplist(int sheetIndex, int titleRowIndex) {
+        return toMaplist(null, sheetIndex, titleRowIndex);
+    }
+
+    public List<Map<String, String>> toMaplist() {
+        return toMaplist(null, 0, 0);
+    }
+
+    /**
+     * Workbook 中 指定Sheet 转换为 List<Map<String, Object>>
+     *
+     * @param sheetName     sheet名字
+     * @param sheetIndex    sheet位置
+     * @param titleRowIndex titleRow位置
+     * @return
+     * @throws IOException
+     */
+    public List<Map<String, String>> toMaplist(String sheetName, int sheetIndex, int titleRowIndex) {
+        List<Map<String, String>> result = new ArrayList<>();
+        Sheet sheet;
+        if (sheetName != null && sheetName.length() > 0) {
+            sheet = this.workbook.getSheet(sheetName);
+        } else {
+            sheet = this.workbook.getSheetAt(sheetIndex);
+        }
+        int lastRowNum = sheet.getLastRowNum();
+        Row titleRow = null;
+        int lastCellNum = 0;
+        String[] titles = new String[0];
+        for (int j = titleRowIndex; j < lastRowNum; j++) {
+            Map<String, String> map = new HashMap<>();
+            if (j == titleRowIndex) {
+                titleRow = sheet.getRow(j);
+                lastCellNum = titleRow.getLastCellNum();
+                titles = new String[lastCellNum];
+            }
+            Row dataRow = sheet.getRow(j + 1);
+            for (int k = 0; k < lastCellNum; k++) {
+                if (j == titleRowIndex) {
+                    titles[k] = titleRow.getCell(k).getStringCellValue();
+                }
+
+                if (dataRow.getCell(k) != null && dataRow.getCell(k).getCellType() == CellType.NUMERIC.getCode()) {
+                    try {
+                        if (DateUtil.isCellDateFormatted(dataRow.getCell(k))) {
+                            map.put(titles[k], dataRow.getCell(k) == null ? StrUtil.EMPTY : cn.hutool.core.date.DateUtil.formatDateTime(dataRow.getCell(k).getDateCellValue()));
+                        }else{
+                            DecimalFormat df = new DecimalFormat("0");
+                            map.put(titles[k], dataRow.getCell(k) == null ? StrUtil.EMPTY : df.format(dataRow.getCell(k).getNumericCellValue()));
+                        }
+                    }catch (Exception e){
+                        log.info("数据转换错误");
+                        e.printStackTrace();
+                    }
+                }else{
+                    map.put(titles[k], dataRow.getCell(k) == null ? StrUtil.EMPTY : dataRow.getCell(k).getStringCellValue());
+                }
+            }
+            result.add(map);
+        }
+        return result;
+    }
+
+    public Workbook getWorkbook() {
+        return workbook;
+    }
+}

+ 117 - 0
yqk-common/src/main/java/com/yx/face/boot/uitls/excel/ExcelWriter.java

@@ -0,0 +1,117 @@
+package com.yx.face.boot.uitls.excel;
+
+import com.alibaba.fastjson.JSON;
+import org.apache.poi.hssf.usermodel.HSSFWorkbook;
+import org.apache.poi.ss.usermodel.Row;
+import org.apache.poi.ss.usermodel.Sheet;
+import org.apache.poi.ss.usermodel.Workbook;
+
+import java.io.File;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.io.OutputStream;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * @author lilei
+ * @version V 0.1
+ * @describe {}
+ * @time 2017/8/9 16:10.
+ */
+public class ExcelWriter {
+    private Workbook workbook;
+
+    public ExcelWriter generate(String mapListJson, String sheetName) {
+        List<Map<String, Object>> mapList = JSON.parseObject(mapListJson, List.class);
+        return generate(mapList, sheetName);
+    }
+
+    /**
+     * 生成 <code>Workbook</code>
+     * Generate <code>Workbook</code>
+     *
+     * @param mapList 数据集 List<Map<String, Object>>
+     *                Attention: mapList中Object, 数字类型(int, float, double) 已针对处理, 其他类型请先自行处理, 或默认按toString()取值
+     * @return <code>ExcelWriter</code>
+     * @see Workbook
+     * @see HSSFWorkbook
+     */
+    public ExcelWriter generate(List<Map<String, Object>> mapList, String sheetName) {
+        if (mapList == null) {
+            throw new NullPointerException("mapList can not be null !");
+        }
+        Workbook workbook = new HSSFWorkbook();
+        Sheet sheet = workbook.createSheet(sheetName);
+        if (mapList.size() > 0) {
+            Row firstRow = null;
+            for (int i = 0; i < mapList.size(); i++) {
+                Map<String, Object> map = mapList.get(i);
+                Row row = sheet.createRow(i + 1);
+                if (i == 0) {
+                    firstRow = sheet.createRow(0);
+                }
+                Iterator<Map.Entry<String, Object>> entryIterator = map.entrySet().iterator();
+                int j = 0;
+                while (entryIterator.hasNext()) {
+                    Map.Entry<String, Object> entry = entryIterator.next();
+                    if (i == 0) {
+                        String keyObj = entry.getKey();
+                        String fieldName = keyObj == null ? "" : keyObj;
+                        firstRow.createCell(j).setCellValue(fieldName);
+                    }
+                    Object valObj = entry.getValue();
+                    if (valObj != null) {
+                        if (valObj instanceof Integer) {
+                            row.createCell(j).setCellValue(((Integer) valObj).intValue());
+                        } else if (valObj instanceof Double) {
+                            row.createCell(j).setCellValue(((Double) valObj).doubleValue());
+                        } else if (valObj instanceof Float) {
+                            row.createCell(j).setCellValue(((Float) valObj).floatValue());
+                        } else {
+                            row.createCell(j).setCellValue(valObj.toString());
+                        }
+                    } else {
+                        row.createCell(j).setCellValue("");
+                    }
+                    j++;
+                }
+            }
+        }
+        this.workbook = workbook;
+        return this;
+    }
+
+    /**
+     * 将 workbook 输出到 文件
+     * to file.
+     *
+     * @param file
+     * @throws IOException
+     */
+    public void write(File file) throws IOException {
+        try (FileOutputStream fos = new FileOutputStream(file)) {
+            this.workbook.write(fos);
+        }
+    }
+
+    /**
+     * 将 workbook 输出到 outputStream
+     * to outputStream.
+     *
+     * @param outputStream
+     * @throws IOException
+     */
+    public void write(OutputStream outputStream) throws IOException {
+        try (OutputStream os = outputStream) {
+            this.workbook.write(os);
+        }
+    }
+
+    public Workbook getWorkbook() {
+        return workbook;
+    }
+
+}
+

+ 49 - 0
yqk-common/src/main/java/com/yx/face/boot/uitls/excel/JsonUtil.java

@@ -0,0 +1,49 @@
+package com.yx.face.boot.uitls.excel;
+
+import com.fasterxml.jackson.core.JsonGenerator;
+import com.fasterxml.jackson.core.JsonParser;
+import com.fasterxml.jackson.core.JsonProcessingException;
+import com.fasterxml.jackson.databind.DeserializationFeature;
+import com.fasterxml.jackson.databind.ObjectMapper;
+
+import java.io.IOException;
+
+/**
+ * @author lilei
+ * @version V 0.1
+ * @describe {}
+ * @time 2017/8/9 16:10.
+ */
+public class JsonUtil {
+    private static final ObjectMapper MAPPER = new ObjectMapper();
+
+    /**
+     * 配置ObjectMapper
+     * https://stackoverflow.com/questions/3907929/should-i-declare-jacksons-objectmapper-as-a-static-field
+     *
+     * @return ObjectMapper
+     */
+    static {
+        MAPPER.configure(JsonGenerator.Feature.QUOTE_FIELD_NAMES, true).
+                configure(JsonParser.Feature.ALLOW_UNQUOTED_FIELD_NAMES, true).
+                configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);
+    }
+
+    public static String obj2Json(Object obj) {
+        try {
+            return MAPPER.writeValueAsString(obj);
+        } catch (JsonProcessingException e) {
+            e.printStackTrace();
+        }
+        return null;
+    }
+
+    public static <T> T json2Obj(String json, Class<T> clazz) {
+        try {
+            return MAPPER.readValue(json, clazz);
+        } catch (IOException e) {
+            e.printStackTrace();
+        }
+        return null;
+    }
+}

+ 560 - 0
yqk-common/src/main/java/com/yx/face/model/entity/Admin.java

@@ -0,0 +1,560 @@
+package com.yx.face.model.entity;
+
+import com.yx.face.boot.handle.IntegerTypeHandler;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import lombok.experimental.Accessors;
+import tk.mybatis.mapper.annotation.ColumnType;
+
+import javax.persistence.*;
+import java.io.Serializable;
+import java.math.BigDecimal;
+import java.util.Date;
+import java.util.List;
+
+/**
+ * @description: 管理人员信息表(Admin)实体类 <br>
+ * @author: PWB <br>
+ * @since: 1.0 <br>
+ * @date: 2021-06-04 14:25:42 <br>
+ */
+@Data
+@Accessors(chain = true)
+@Table(name = "admin")
+public class Admin implements Serializable {
+
+    /**
+     * 管理人员表主键id
+     */
+
+    @Id
+    @GeneratedValue(strategy = GenerationType.IDENTITY)
+
+    private Integer id;
+
+    /**
+     * 呢称
+     */
+
+
+    private String nickname;
+
+    /**
+     * 管理员名称
+     */
+
+
+    private String username;
+
+    /**
+     * 管理员密码
+     */
+
+
+    private String password;
+
+    /**
+     * 头像路径
+     */
+
+
+    private String avatar;
+
+    /**
+     * 身份证号
+     */
+
+
+    @Column(name = "id_number")
+    private String idNumber;
+
+    /**
+     * 管理员联系电话
+     */
+
+
+    private String phone;
+
+    /**
+     * 管理员邮箱
+     */
+    private String email;
+
+
+    @Column(name = "zfb_email")
+    private String zfbEmail;
+
+    /**
+     * 女-0 | 男- 1| 未选中-2
+     */
+
+
+    private Byte gender;
+
+    /**
+     * 管理员类型 1.管理员 2.省级总账号 3.省级 4.市级 5.区级
+     */
+
+
+    private Byte type;
+
+
+    /**
+     * 数据更新时间
+     */
+
+
+    @Column(name = "update_time")
+    private Date updateTime;
+
+    /**
+     * 数据创建时间
+     */
+
+
+    @Column(name = "create_time")
+    private Date createTime;
+    /*
+     * 省份地址编码
+     * */
+    @Column(name = "province_id")
+    private Integer provinceId;
+    /*
+     * 省份
+     * */
+    @Column(name = "province_name")
+    private String provinceName;
+    /*
+     * 城市地址编码
+     * */
+    @Column(name = "city_id")
+    private Integer cityId;
+    /*
+     * 城市
+     * */
+    @Column(name = "city_name")
+    private String cityName;
+    /*
+     * 县区地址编码
+     * */
+    @Column(name = "area_id")
+    private Integer areaId;
+    /*
+     * 县区
+     * */
+    @Column(name = "area_name")
+    private String areaName;
+    /*
+     * 街道编号
+     * */
+    @Column(name = "street_id")
+    private Integer streetId;
+    /*
+     * 街道 乡 镇名称
+     * */
+    @Column(name = "street_name")
+    private String streetName;
+    /*
+     * 详细地址
+     * */
+    private String address;
+    /*
+     * 派出所编码
+     * */
+    @Column(name = "police_station_code")
+    private String policeStationCode;
+    /*
+     * 街道 乡 镇名称
+     * */
+    @Column(name = "police_station_name")
+    private String policeStationName;
+    /*
+     * 标签id
+     * */
+    @Column(name = "tag_id")
+    private Integer tagId;
+    /*
+     * 导出权限 1.可以 2.不可以
+     * */
+    @Column(name = "is_out")
+    private Integer isOut;
+    /*
+     * 是否脱敏重要信息 1.脱敏 2.不脱敏
+     * */
+    @Column(name = "is_hide_important")
+    private Integer isHideImportant;
+
+    /*
+     * 常访客类型1常客2访客
+     * */
+    @Column(name = "white_visitor_type")
+    private String whiteVisitorType;
+
+    @ApiModelProperty(value = "自定义字段")
+    private String content;
+
+
+    /*
+     * 是否开启布控 1.开启  2.不开启 默认2
+     * */
+    @Column(name = "is_control_early_warning")
+    private Integer isControlEarlyWarning;
+    /*
+     * 脱敏的字段 1.姓名 2. 手机号 3.身份证
+     * */
+    @Column(name = "no_hide_cloumn")
+    private String noHideCloumn;
+
+    @ApiModelProperty(value = "是否开启下发")
+    @Column(name = "is_push")
+    private Integer isPush;
+
+    @ApiModelProperty(value = "二维码类型记录标识,0:通用码,1:常客码")
+    @Column(name = "code_type")
+    private String codeType;
+
+    @ApiModelProperty(value = "场所类型,0:通用场所,1:预约场所")
+    @Column(name = "place_type")
+    private Integer placeType;
+
+    @ApiModelProperty(value = "审核状态 0:待审核 1:已拒绝 2:已同意")
+    @Column(name = "review_status")
+    private Integer reviewStatus;
+
+    @ApiModelProperty(value = "租户id")
+    @Column(name = "tenant_id")
+    private Integer tenantId;
+
+    @ApiModelProperty("是否开启场所码,false:否,true: 是")
+    private Boolean placeCodeStatus;
+
+    @ApiModelProperty("注册到某个地址码")
+    private String addressCode;
+
+    @ApiModelProperty("场所码单位名称")
+    private String unitName;
+
+    @ApiModelProperty("场所码单位地址")
+    private String unitAddress;
+
+    @ApiModelProperty("场所码管理员健康码信息")
+    private String managerHealthCode;
+
+    /*
+     * 是否开启私有区域 1-开启 2-不开启
+     * 注释:楼宇场景下的公私有区域
+     * */
+    @Column(name = "is_open_private_area")
+    private Integer isOpenPrivateArea;
+
+    @ApiModelProperty("核酸有效期时间,单位小时,0:不限")
+    @Column(name = "nucleic_expiration_time")
+    private Integer nucleicExpirationTime;
+
+    @Column(name = "scenic_flag")
+    private Boolean scenicFlag;
+
+    /*
+     * 三码 1-健康码 2-核酸 3-行程码
+     * */
+    @Column(name = "three_code")
+    private String threeCode;
+    /*
+     * 核酸时长 三码中如果存在核酸 则需要添加核酸时长
+     * */
+    @Column(name = "hs_hour")
+    private Integer hsHour;
+
+    /*
+     * 常客有效时长(单位/天)
+     * */
+    @Column(name = "user_whitelist_effective_time")
+    private BigDecimal userWhitelistEffectiveTime;
+    /*
+     * 访客有效时长(单位/天)
+     * */
+    @Column(name = "user_visiter_effective_time")
+    private BigDecimal userVisiterEffectiveTime;
+    /*
+     * 风险区(中间逗号相隔)
+     * */
+    @Column(name = "risk_area")
+    private String riskArea;
+    /*
+     * 是否开启物理卡号:1-开启 2-不开启
+     * */
+    @Column(name = "card_physics")
+    private Integer cardPhysics;
+    /*
+     * 实名认证年龄段 为空则表示都需要实名认证 格式:20-50
+     * */
+    @Column(name = "real_authentication_age")
+    private String realAuthenticationAge;
+    /*
+     * 打卡上报字段配置
+     * */
+    @Deprecated //已弃用
+    @Column(name = "punch_report_fields_config")
+    private String punchReportFieldsConfig;
+
+
+    @ApiModelProperty("打卡方式 0 钉钉 1 通用")
+    private String clockWayType;
+
+    @Deprecated //已弃用
+    @ApiModelProperty("打卡信息推送地址")
+    private String clockWayPushUrl;
+    /*
+     * 不允许进入的年龄段 格式:20-50
+     * */
+    @Column(name = "not_allow_age")
+    private String notAllowAge;
+    /**
+     * 不允许进入的年龄段提示信息
+     */
+    @Column(name = "not_allow_age_msg")
+    private String notAllowAgeMsg;
+    /**
+     * 是否报警 true/false
+     */
+    @Column(name = "is_alarm")
+    private Boolean isAlarm = false;
+
+    @ApiModelProperty(value = "钉钉应用的唯一标识key")
+    private String dingtalkAppKey;
+
+    @ApiModelProperty(value = "钉钉应用的密钥")
+    private String dingtalkAppSecret;
+
+    /*
+     * 没有行程信息是否开门 1-开门(默认)0-关门
+     * */
+    @Column(name = "no_xc_open_door")
+    private Boolean noXcOpenDoor;
+
+    /*
+     * 24小时内核酸报告未出是否开门:1-开门(默认)0-关门
+     * */
+    @Column(name = "no_hs_open_door")
+    private Boolean noHsOpenDoor;
+
+    /*
+     * 去过中高风险地区是否开门 1-开门(默认)0-关门
+     * */
+    @Column(name = "risk_xc_open_door")
+    private Boolean riskXcOpenDoor;
+    /*
+     * 不允许通行的身份证地区代码,用/分隔
+     * */
+    @Column(name = "no_allow_area_code")
+    private String noAllowAreaCode;
+
+    /*
+     * 行程码需检测是否开门 1-开门(默认)0-关门
+     * */
+    @Column(name = "xc_need_check_open_door")
+    private Boolean xcNeedCheckOpenDoor;
+
+    /*
+     * 屏保照片
+     * */
+    @Column(name = "screen_photos")
+    private String screenPhotos;
+    /**
+     * 首页屏幕图片
+     */
+    @Column(name = "home_img_url")
+    private String homeImgUrl;
+
+    /**
+     * 开启问题上报 1:开启 0:不开启
+     */
+    @Column(name = "problem_report_flag")
+    private Integer problemReportFlag;
+
+    /**
+     * 开启区域消杀 1:开启 0:不开启
+     */
+    @Column(name = "disinfect_flag")
+    private Integer disinfectFlag;
+
+    /**
+     * 是否限制三天三检 1:是   0:否(默认)
+     */
+    @Column(name = "limit_gather")
+    private Integer limitGather;
+
+    /**
+     * 微信小程序登录方式 1-身份证 2-卡号认证
+     */
+    @Column(name = "wx_login_type")
+    private Integer wxLoginType;
+
+    /**
+     * 是否需要实名认证 1-需要 0-不需要
+     */
+    @Column(name = "is_need_real_authentication")
+    private Boolean isNeedRealAuthentication;
+    /*
+     * 是否开启访客零点清除功能 1-开启 0-关闭
+     * */
+    @Column(name = "is_open_visitor_clear")
+    private Boolean isOpenVisitorClear;
+
+    /*
+     * 企业账号的配置-小程序是否可被搜索选择 1-可以 0-不可以
+     * */
+    @Column(name = "is_can_search")
+    private Integer isCanSearch;
+    /*
+     * 自定义输入手机号标志位 1输入 2获取
+     * */
+    @Column(name = "mobile_auto_input_flag")
+    private Integer mobileAutoInputFlag;
+
+    /**
+     * ------ 账户添加配置信息2023-02-06 ------
+     **/
+    @ApiModelProperty(value = "是否开启健康码功能 0:关闭 1:开启 ")
+    private Integer isOpenHealthCode;
+
+    /**
+     * 是否开启进出记录统计
+     */
+    @Column(name = "open_in_out_statistics")
+    private Boolean openInOutStatistics;
+
+    /**
+     * ------ 账户添加配置信息2023-04-13 ------
+     **/
+    @ApiModelProperty("二维码是否显示 true/false")
+    private Boolean showQrcode = false;
+    @ApiModelProperty(value = "二维码的码值")
+    private String qrcodeText;
+    @ApiModelProperty(value = "广告图片的地址 ")
+    private String advertise;
+
+    /**
+     * 考试设备集合 用逗号隔开
+     */
+    @Column(name = "exam_devices")
+    private String examDevices;
+    /*
+     * 是否开启考试 1-开启 0-不开启
+     * */
+    @Column(name = "is_open_exam")
+    private Boolean isOpenExam;
+
+    @Deprecated
+    @ApiModelProperty(value = "商户平台id 已弃用")
+    private Long tenantPlatformId;
+
+    /**
+     * ------ 账户添加配置信息2023-04-25 ------
+     **/
+    @ApiModelProperty(value = "联动平台服务是否开启 true/false")
+    private Boolean openThirdLinkPlatform;
+    @ApiModelProperty(value = "顶部标题 设备显示配置 mainLine")
+    private String topTitle;
+    @ApiModelProperty(value = "成功-通行结果")
+    private String subLineSuccess;
+    @ApiModelProperty(value = "失败-通行结果")
+    private String subLineFail;
+    @ApiModelProperty(value = "左副框上层")
+    private String mainLineLeft;
+    @ApiModelProperty(value = "左副框下层")
+    private String subLineLeft;
+    @ApiModelProperty(value = "右副框上层")
+    private String mainLineRight;
+    @ApiModelProperty(value = "右副框下层")
+    private String subLineRight;
+    @ApiModelProperty(value = "成功-语音播报内容")
+    private String openVoiceMsgSuccess;
+    @ApiModelProperty(value = "失败-语音播报内容")
+    private String openVoiceMsgFail;
+
+    /**
+     * 人脸数据保留天数
+     */
+    @ApiModelProperty(value = "人脸数据保留天数")
+    private Integer faceLogHoldDays;
+    /*
+     * 常客小程序是否需要实名 0-否 1-需要
+     * */
+    private Boolean whitelistAppRealname;
+    /*
+     * 常客小程序是否需要照片 0-否 1-需要
+     * */
+    private Boolean whitelistAppPhoto;
+    /*
+    * 常客的登录参数列表
+    * @see
+    * */
+    @ColumnType(column = "whitelist_app_login",typeHandler = IntegerTypeHandler.class)
+    private List<Integer> whitelistAppLoginList;
+    /*
+     * 常客小程序是否需要手机号 0-否 1-需要
+     * */
+    private Boolean whitelistAppPhone;
+    /*
+     * 访客小程序是否需要实名 0-否 1-需要
+     * */
+    private Boolean visitorAppRealname;
+    /*
+     * 访客小程序是否需要照片 0-否 1-需要
+     * */
+    private Boolean visitorAppPhoto;
+    /*
+     * 访客的登录参数列表
+     * */
+    @ColumnType(column = "visitor_app_login",typeHandler = IntegerTypeHandler.class)
+    private List<Integer> visitorAppLoginList;
+    /*
+     * 访客小程序是否需要手机号 0-否 1-需要
+     * */
+    private Boolean visitorAppPhone;
+
+    /**
+     * 楼宇审核方式 1-常客审核 2-指定人员审核
+     * @see com.yx.face.model.enums.AdminBuildingCheckTypeEnum
+     * */
+    private Integer buildingCheckType;
+
+    @ApiModelProperty(value = "设备结果页类型 false:老版  true:新版")
+    private Boolean latestResultPage;
+    /**
+     * 机构编码
+     */
+    @Column(name = "org_out_id")
+    private String orgOutId;
+    /*
+    * 上级名称-显示使用
+    * */
+    @Column(name = "tenant_enterprise_name")
+    private String tenantEnterpriseName;
+    /*
+    * 下级名称-显示使用
+    * */
+    @Column(name = "enterprise_name")
+    private String enterpriseName;
+    @ApiModelProperty(value = "支付宝小程序单机二维码标题")
+    private String zfbMiniEthTitle;
+    @ApiModelProperty(value = "支付宝小程序联机二维码标题")
+    private String zfbMiniVguangTitle;
+
+    @ApiModelProperty(value = "是否开启进出预警 false-不开启 true-开启")
+    private Boolean isOpenInoutWarning;
+
+    /**
+     * ------ 2024-03-18添加 ------
+     **/
+    @ApiModelProperty(value = "员工管理接口是否开启 false-不开启 true-开启")
+    private Boolean userManageSwitch;
+    @ApiModelProperty(value = "区域管理接口是否开启 false-不开启 true-开启")
+    private Boolean zoneManageSwitch;
+
+    @ApiModelProperty(value = "是否开启梯控 false-不开启 true-开启")
+    private Boolean isOpenLadder;
+
+}
+

+ 84 - 0
yqk-common/src/main/java/com/yx/face/model/entity/AdminAuth.java

@@ -0,0 +1,84 @@
+package com.yx.face.model.entity;
+
+/**
+ * @author shisl
+ * @package com.yx.face.model.entity
+ * @class AdminAuth
+ * @date 2023/4/25 上午10:16
+ * @description
+ */
+import com.yx.face.model.enums.AdminAuthTypeEnum;
+import lombok.Data;
+import lombok.experimental.Accessors;
+
+import javax.persistence.*;
+import java.util.Date;
+@Data
+@Accessors(chain = true)
+@Table(name = "admin_auth")
+public class AdminAuth {
+    /*
+     * 主键自增id
+     * */
+    @Id
+    @GeneratedValue(strategy = GenerationType.IDENTITY)
+    private Integer id;
+
+    @Column(name = "app_id")
+    private String appId;
+
+    /**
+     * 权限校验的appKey
+     */
+    @Column(name = "app_key")
+    private String appKey;
+    /**
+     * 权限校验的appSecret
+     */
+    @Column(name = "app_secret")
+    private String appSecret;
+
+    /**
+     * 权限校验的privateKey 16位随机数 包含字母和数据
+     */
+    @Column(name = "private_key")
+    private String privateKey;
+
+    /**
+     * 权限类型
+     *
+     * @see AdminAuthTypeEnum
+     */
+    @Column(name = "type")
+    private Integer type;
+    /**
+     * 账号id
+     */
+    @Column(name = "admin_id")
+    private Integer adminId;
+
+    /**
+     * 接口地址
+     */
+    @Column(name = "interface_address")
+    private String interfaceAddress;
+
+
+    /**
+     * 接口地址绑区域JSON 例如:[{\"interfAddr\":\"三方接口地址\",\"zoneId\":\"所在区域ID\"},{\"interfAddr\":\"三方接口地址\",\"zoneId\":\"所在区域ID\"}]
+     *  InterfAddrJsonVo
+     *
+     */
+    @Column(name = "interf_addr_json")
+    private String interfAddrJson;
+
+    /**
+     * 数据创建时间
+     */
+    @Column(name = "create_time")
+    private Date createTime;
+
+    @Column(name = "is_deleted")
+    private Boolean isDeleted;
+
+}

+ 91 - 0
yqk-common/src/main/java/com/yx/face/model/entity/AdminData.java

@@ -0,0 +1,91 @@
+package com.yx.face.model.entity;
+
+import io.swagger.annotations.ApiModel;
+import lombok.Data;
+
+import java.util.Date;
+
+/**
+ * @description:
+ * @ClassName AdminData
+ * @Author WXG
+ * @Date 2021/11/12 16:06
+ */
+@ApiModel("管理员大屏数据")
+@Data
+public class AdminData {
+
+    /*
+    * 管理员id
+    * */
+    private Integer adminId;
+    /*
+     * 通行总人数
+     * */
+    private Integer totalNum;
+    /*
+     * 今日通行总人数
+     * */
+    private Integer todayNum;
+    /*
+     * 红码人数
+     * */
+    private Integer redNum;
+    /*
+     * 黄码人数
+     * */
+    private Integer yellowNum;
+    /*
+     * 绿码人数
+     * */
+    private Integer greenNum;
+    /*
+     * 健康码未知人数
+     * */
+    private Integer notKnowNum = 0;
+    /*
+     * 温度异常人数
+     * */
+    private Integer twExceptionNum;
+    /*
+     * 温度正常人数
+     * */
+    private Integer twNormal = 0;
+    /*
+     * 密接红码人员人数
+     * */
+    private Integer contactRedNum;
+    /*
+     * 密接黄码人员人数
+     * */
+    private Integer contactYellowNum;
+    /*
+     * 异常人员人数
+     * */
+    private Integer exceptionNum;
+    /*
+     * 已接种疫苗人数
+     * */
+    private Integer inoculationNum;
+    /*
+     * 未接种疫苗人数
+     * */
+    private Integer noInoculationNum = 0;
+    /*
+     * 七日内完成核酸检测人数
+     * */
+    private Integer nucleicNum;
+    /*
+     * 时间
+     * */
+    private Date time;
+    /*
+     * 有效时间
+     * */
+    private Date effectiveTime;
+    /*
+     *  查询到最大的记录条数
+     * */
+    private Integer biggerNum;
+
+}

+ 162 - 0
yqk-common/src/main/java/com/yx/face/model/entity/AdminDetail.java

@@ -0,0 +1,162 @@
+package com.yx.face.model.entity;
+
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.experimental.Accessors;
+
+import javax.persistence.*;
+import java.io.Serializable;
+import java.util.Date;
+
+/**
+ * <p>
+ *
+ * </p>
+ *
+ * @author wxg
+ * @since 2022-05-24
+ */
+@Data
+@EqualsAndHashCode(callSuper = false)
+@Accessors(chain = true)
+@Table(name = "admin_detail")
+public class AdminDetail implements Serializable {
+
+    private static final long serialVersionUID = 1L;
+
+    /**
+     * 序号
+     */
+    @Id
+    @GeneratedValue(strategy = GenerationType.IDENTITY)
+    private Integer id;
+
+    /**
+     * 常客码地址
+     */
+    @ApiModelProperty("常客码地址")
+    @Column(name = "regular_code")
+    private String regularCode;
+
+    /**
+     * 预约码内宾地址
+     */
+    @ApiModelProperty("预约码内宾地址")
+    @Column(name = "reservation_code")
+    private String reservationCode;
+
+    /**
+     * 预约码外宾地址
+     */
+    @ApiModelProperty("预约码外宾地址")
+    @Column(name = "reservation_en_code")
+    private String reservationEnCode;
+
+    /**
+     * 账号id
+     */
+    @Column(name = "admin_id")
+    private Integer adminId;
+
+    @ApiModelProperty("楼宇码地址")
+    @Column(name = "building_code")
+    private String buildingCode;
+
+    @ApiModelProperty("楼宇常客码地址")
+    @Column(name = "building_regular_code")
+    private String buildingRegularCode;
+
+    @ApiModelProperty("支付宝通用常客码地址")
+    @Column(name = "zfb_regular_code")
+    private String zfbRegularCode;
+
+    @ApiModelProperty("支付宝楼宇码地址")
+    @Column(name = "zfb_building_code")
+    private String zfbBuildingCode;
+
+    @ApiModelProperty("支付宝楼宇常客码地址")
+    @Column(name = "zfb_building_regular_code")
+    private String zfbBuildingRegularCode;
+
+    @ApiModelProperty("支付宝访客机二维码地址")
+    @Column(name = "zfb_fkj_code")
+    private String zfbFkjCode;
+
+    @ApiModelProperty("企业全称")
+    @Column(name = "enterprise_full_name")
+    private String enterpriseFullName;
+
+    @ApiModelProperty("企业简称")
+    @Column(name = "enterprise_simple_name")
+    private String enterpriseSimpleName;
+
+    @ApiModelProperty("主营范围")
+    @Column(name = "main_business_scope")
+    private String mainBusinessScope;
+
+    @ApiModelProperty("经营挂牌名称")
+    @Column(name = "for_the_name")
+    private String forTheName;
+
+    @ApiModelProperty("实际控制人姓名")
+    @Column(name = "actual_name")
+    private String actualName;
+
+    @ApiModelProperty("实际控制人电话")
+    @Column(name = "actual_phone")
+    private String actualPhone;
+
+    @ApiModelProperty("员工人数")
+    @Column(name = "employees_number")
+    private String employeesNumber;
+
+    @ApiModelProperty("租赁楼幢")
+    @Column(name = "lease_building")
+    private String leaseBuilding;
+
+    @ApiModelProperty("租赁楼层")
+    @Column(name = "lease_floor")
+    private String leaseFloor;
+
+    @ApiModelProperty("租赁房间号")
+    @Column(name = "room_number")
+    private String roomNumber;
+
+    @ApiModelProperty("租赁有效期")
+    @Column(name = "lease_term")
+    private Date leaseTerm;
+
+    @ApiModelProperty("营业执照信息录入方式,0:OCR录入,1:手动录入")
+    @Column(name = "information_input_type")
+    private Integer informationInputType;
+
+    @ApiModelProperty("公司代码")
+    @Column(name = "company_code")
+    private String companyCode;
+
+    @ApiModelProperty("公司法人")
+    @Column(name = "legal_person")
+    private String legalPerson;
+
+    @ApiModelProperty("公司类型")
+    @Column(name = "company_type")
+    private String companyType;
+
+    @ApiModelProperty("注册资金")
+    @Column(name = "registered_capital")
+    private String registeredCapital;
+
+    @ApiModelProperty("注册时间")
+    @Column(name = "registration_time")
+    private Date registrationTime;
+
+    @ApiModelProperty("用户id")
+    @Column(name = "user_id")
+    private Integer userId;
+
+    @ApiModelProperty("注册地址")
+    @Column(name = "registration_address")
+    private String registrationAddress;
+}
+

+ 33 - 0
yqk-common/src/main/java/com/yx/face/model/entity/AdminInoutWarnConfig.java

@@ -0,0 +1,33 @@
+package com.yx.face.model.entity;
+
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.experimental.Accessors;
+
+import javax.persistence.GeneratedValue;
+import javax.persistence.GenerationType;
+import javax.persistence.Id;
+import javax.persistence.Table;
+import java.io.Serializable;
+
+/**
+ * @description:
+ * @ClassName AdminInoutWarnConfig
+ * @Author WXG
+ * @Date 2023/12/4 17:53
+ */
+@Data
+@EqualsAndHashCode(callSuper = false)
+@Accessors(chain = true)
+@Table(name = "admin_inout_warn_config")
+public class AdminInoutWarnConfig  implements Serializable {
+
+    private static final long serialVersionUID = 1L;
+    @Id
+    @GeneratedValue(strategy = GenerationType.IDENTITY)
+    private Integer id;
+    private Integer adminId;//账号
+    private Integer hour;//统计的小时
+    private Integer pass;//通行类型
+    private Integer num;//次数
+}

+ 57 - 0
yqk-common/src/main/java/com/yx/face/model/entity/AdminPlaceInfo.java

@@ -0,0 +1,57 @@
+package com.yx.face.model.entity;
+
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import lombok.experimental.Accessors;
+
+import javax.persistence.GeneratedValue;
+import javax.persistence.GenerationType;
+import javax.persistence.Id;
+import javax.persistence.Table;
+import java.io.Serializable;
+import java.util.Date;
+
+/**
+ * 场所码信息表
+ *
+ * @author lileilei
+ * @since 2022-07-06
+ */
+@Data
+@Accessors(chain = true)
+@Table(name = "admin_place_info")
+@ApiModel(description = "场所码信息表")
+public class AdminPlaceInfo implements Serializable {
+    private static final long serialVersionUID = 1L;
+
+    @Id
+    @GeneratedValue(strategy = GenerationType.IDENTITY)
+    @ApiModelProperty(value = "序号")
+    private Integer id;
+
+    @ApiModelProperty(value = "注册到某个地址码")
+    private String addressCode;
+
+    @ApiModelProperty(value = "场所码单位名称")
+    private String unitName;
+
+    @ApiModelProperty(value = "场所码单位地址")
+    private String unitAddress;
+
+    @ApiModelProperty(value = "场所码管理员健康码信息")
+    private String managerHealthCode;
+
+    @ApiModelProperty(value = "账号id")
+    private Integer adminId;
+
+    @ApiModelProperty(value = "场所码区域代码 PlaceAreaEnum int值 ")
+    private Integer placeAreaCode;
+
+    @ApiModelProperty(value = "更新时间")
+    private Date updateTime;
+
+    @ApiModelProperty(value = "创建时间")
+    private Date createTime;
+
+}

+ 34 - 0
yqk-common/src/main/java/com/yx/face/model/entity/AdminTag.java

@@ -0,0 +1,34 @@
+package com.yx.face.model.entity;
+
+import lombok.Data;
+
+import javax.persistence.GeneratedValue;
+import javax.persistence.GenerationType;
+import javax.persistence.Id;
+import javax.persistence.Table;
+
+/**
+ * @description:
+ * @ClassName Tag
+ * @Author WXG
+ * @Date 2021/11/9 11:45
+ */
+@Data
+@Table(name = "admin_tag")
+public class AdminTag {
+
+    /**
+     * 标签表主键id
+     */
+    @Id
+    @GeneratedValue(strategy = GenerationType.IDENTITY)
+    private Integer id;
+    /**
+     * 部门名称
+     */
+    private String name;
+    /*
+    * 所属的省
+    * */
+    private Integer provinceId;
+}

+ 96 - 0
yqk-common/src/main/java/com/yx/face/model/entity/AppointmentPerson.java

@@ -0,0 +1,96 @@
+package com.yx.face.model.entity;
+
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.experimental.Accessors;
+
+import javax.persistence.*;
+import java.io.Serializable;
+import java.util.Date;
+
+/**
+ * <p>
+ * 常客
+ * </p>
+ *
+ * @author wxg
+ * @since 2022-05-24
+ */
+@Data
+@EqualsAndHashCode(callSuper = false)
+@Accessors(chain = true)
+@Table(name = "appointment_person")
+public class AppointmentPerson implements Serializable {
+
+    private static final long serialVersionUID = 1L;
+
+    /**
+     * 用户白名单id
+     */
+    @Id
+    @GeneratedValue(strategy = GenerationType.IDENTITY)
+    private Integer id;
+
+    /**
+     * 姓名
+     */
+    @ApiModelProperty("姓名")
+    @Column(name = "name")
+    private String name;
+
+    /**
+     * 手机号
+     */
+    @ApiModelProperty("手机号")
+    @Column(name = "phone")
+    private String phone;
+
+    /**
+     * 头像
+     */
+    @ApiModelProperty("头像")
+    @Column(name = "avatar")
+    private String avatar;
+
+    /**
+     * 状态 1已认证 2.未认证
+     */
+    @ApiModelProperty("状态 1已认证 2.未认证")
+    @Column(name = "status")
+    private Integer status;
+
+    /**
+     * 更新时间
+     */
+    @Column(name = "update_time")
+    private Date updateTime;
+
+    /**
+     * 创建时间
+     */
+    @Column(name = "create_time")
+    private Date createTime;
+
+    /**
+     * 人员类型,0:内宾,1:外宾
+     */
+    @ApiModelProperty("人员类型,0:内宾,1:外宾")
+    @Column(name = "type")
+    private Integer type;
+
+    /**
+     * 管理员id
+     */
+    @ApiModelProperty("管理员id")
+    @Column(name = "admin_id")
+    private Integer adminId;
+
+    /**
+     * 身份证号
+     */
+    @ApiModelProperty("身份证号")
+    @Column(name = "id_number")
+    private String idNumber;
+
+}

+ 42 - 0
yqk-common/src/main/java/com/yx/face/model/entity/AreaCode.java

@@ -0,0 +1,42 @@
+package com.yx.face.model.entity;
+
+
+import lombok.Data;
+
+import javax.persistence.*;
+
+/**
+ * @description: 地址编码表(AreaCode)实体类 <br>
+ * @author: PWB <br>
+ * @since: 1.0 <br>
+ * @date: 2021-06-04 14:25:45 <br>
+ */
+@Data
+@Table(name = "area_code")
+public class AreaCode {
+    /**
+     * 地址Id
+     */
+    @Id
+    @GeneratedValue(strategy = GenerationType.IDENTITY)
+    private Integer id;
+    /**
+     * 区域名称
+     */
+    private String name;
+    /**
+     * 区域Code
+     */
+    private String code;
+    /**
+     * 上级区域Code
+     */
+    @Column(name = "super_code")
+    private String superCode;
+    /*
+    * 0 省级/1  市级/2  区、县/3  乡镇、街道办
+    * */
+    @Column(name = "type")
+    private Integer type;
+}
+

+ 40 - 0
yqk-common/src/main/java/com/yx/face/model/entity/Base.java

@@ -0,0 +1,40 @@
+package com.yx.face.model.entity;
+
+import lombok.Data;
+
+import javax.persistence.GeneratedValue;
+import javax.persistence.GenerationType;
+import javax.persistence.Id;
+import java.io.Serializable;
+import java.util.Date;
+
+@Data
+public class Base implements Serializable {
+
+    /**
+     * 主键
+     */
+    @Id
+    @GeneratedValue(strategy = GenerationType.IDENTITY)
+    private Long id;
+
+    /**
+     * 删除状态0-未删 1-已删除
+     */
+    private Boolean isDeleted;
+
+    /**
+     * 版本号
+     */
+    private Integer version;
+
+    /**
+     * 创建时间
+     */
+    private Date createTime;
+
+    /**
+     * 更新时间
+     */
+    private Date updateTime;
+}

+ 54 - 0
yqk-common/src/main/java/com/yx/face/model/entity/BussinessNumber.java

@@ -0,0 +1,54 @@
+package com.yx.face.model.entity;
+
+import lombok.Data;
+
+import javax.persistence.*;
+import java.io.Serializable;
+import java.util.Date;
+
+/**
+ * <p>
+ * 
+ * </p>
+ *
+ * @author wxg
+ * @since 2022-03-17
+ */
+@Data
+@Table(name = "bussiness_number")
+public class BussinessNumber implements Serializable {
+
+    private static final long serialVersionUID = 1L;
+
+    /**
+     * 商户号id
+     */
+    @Id
+    @GeneratedValue(strategy = GenerationType.IDENTITY)
+    private Integer id;
+
+    /**
+     * 商户号
+     */
+    @Column(name = "bussiness_number")
+    private String bussinessNumber;
+
+    /**
+     * 数据更新时间
+     */
+    @Column(name = "update_time")
+    private Date updateTime;
+
+    /**
+     * 数据创建时间
+     */
+    @Column(name = "create_time")
+    private Date createTime;
+
+    /**
+     * 管理员id
+     */
+    @Column(name = "admin_id")
+    private Integer adminId;
+
+}

+ 100 - 0
yqk-common/src/main/java/com/yx/face/model/entity/DisinfectArea.java

@@ -0,0 +1,100 @@
+package com.yx.face.model.entity;
+
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.experimental.Accessors;
+
+import javax.persistence.*;
+import java.io.Serializable;
+import java.util.Date;
+
+/**
+ * <p>
+ * 
+ * </p>
+ *
+ * @author wxg
+ * @since 2022-11-11
+ */
+@Data
+@EqualsAndHashCode(callSuper = false)
+@Accessors(chain = true)
+@Table(name = "disinfect_area")
+public class DisinfectArea implements Serializable {
+
+    private static final long serialVersionUID = 1L;
+
+    /**
+     * 消杀区域表id
+     */
+    @Id
+    @GeneratedValue(strategy = GenerationType.IDENTITY)
+    private Integer id;
+
+    /**
+     * 创建时间
+     */
+    @Column(name = "create_time")
+    private Date createTime;
+
+    /**
+     * 管理员id
+     */
+    @Column(name = "admin_id")
+    private Integer adminId;
+
+    /**
+     * 消杀区域名称
+     */
+    @Column(name = "disinfect_area_name")
+    private String disinfectAreaName;
+
+    /**
+     * 消杀区域地址
+     */
+    @Column(name = "disinfect_area_address")
+    private String disinfectAreaAddress;
+
+    /**
+     * 消杀区域公告
+     */
+    @Column(name = "disinfect_area_notice")
+    private String disinfectAreaNotice;
+
+    /**
+     * 消杀区域负责人
+     */
+    @Column(name = "disinfect_area_onus")
+    private String disinfectAreaOnus;
+
+    /**
+     * 消杀区域负责人手机号
+     */
+    @Column(name = "disinfect_area_phone")
+    private String disinfectAreaPhone;
+
+    /**
+     * 每日消杀次数,根据消杀的时间段
+     */
+    @Column(name = "disinfect_num")
+    private Integer disinfectNum;
+
+    /**
+     * 每日消杀的时间段 存json数组,包含 id 开始时间 结束时间
+     */
+    @Column(name = "disinfect_time_break")
+    private String disinfectTimeBreak;
+
+    /**
+     * 消杀区域二维码
+     */
+    @Column(name = "disinfect_qrcode")
+    private String disinfectQrcode;
+
+    /**
+     * 是否删除 0-未删 1-已删
+     */
+    @Column(name = "is_del")
+    private Boolean isDel;
+
+}

+ 124 - 0
yqk-common/src/main/java/com/yx/face/model/entity/DisinfectRecord.java

@@ -0,0 +1,124 @@
+package com.yx.face.model.entity;
+
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.experimental.Accessors;
+
+import javax.persistence.*;
+import java.io.Serializable;
+import java.util.Date;
+
+/**
+ * <p>
+ * 
+ * </p>
+ *
+ * @author wxg
+ * @since 2022-11-11
+ */
+@Data
+@EqualsAndHashCode(callSuper = false)
+@Accessors(chain = true)
+@Table(name = "disinfect_record")
+public class DisinfectRecord implements Serializable {
+
+    private static final long serialVersionUID = 1L;
+
+    /**
+     * 消杀人员表id
+     */
+    @Id
+    @GeneratedValue(strategy = GenerationType.IDENTITY)
+    private Integer id;
+
+    /**
+     * 消杀人员姓名
+     */
+    @Column(name = "name")
+    private String name;
+
+    /**
+     * 消杀人员手机号
+     */
+    @Column(name = "phone")
+    private String phone;
+
+    /**
+     * 消杀人员身份证号
+     */
+    @Column(name = "id_number")
+    private String idNumber;
+
+    /**
+     * 消杀人员user_id
+     */
+    @Column(name = "user_id")
+    private Long userId;
+
+    /**
+     * 创建时间
+     */
+    @Column(name = "create_time")
+    private Date createTime;
+
+    /**
+     * 管理员id
+     */
+    @Column(name = "admin_id")
+    private Integer adminId;
+
+    /**
+     * 消杀区域id
+     */
+    @Column(name = "disinfect_area_id")
+    private Integer disinfectAreaId;
+
+    /**
+     * 消杀区域名称
+     */
+    @Column(name = "disinfect_area_name")
+    private String disinfectAreaName;
+
+    /**
+     * 消杀区域地址
+     */
+    @Column(name = "disinfect_area_address")
+    private String disinfectAreaAddress;
+
+    /**
+     * 状态 1-完成 2-未完成
+     */
+    @Column(name = "status")
+    private Integer status;
+
+    /**
+     * 消杀时间段id
+     */
+    @Column(name = "disinfect_time_break_id")
+    private String disinfectTimeBreakId;
+
+    /**
+     * 消杀时间日期 年月日
+     */
+    @Column(name = "disinfect_time_date")
+    private String disinfectTimeDate;
+
+    /**
+     * 消杀时间开始时间
+     */
+    @Column(name = "disinfect_time_start")
+    private String disinfectTimeStart;
+
+    /**
+     * 消杀时间结束时间
+     */
+    @Column(name = "disinfect_time_end")
+    private String disinfectTimeEnd;
+
+    /**
+     * 消杀备注
+     */
+    @Column(name = "disinfect_remarks")
+    private String disinfectRemarks;
+
+}

+ 76 - 0
yqk-common/src/main/java/com/yx/face/model/entity/DisinfectUser.java

@@ -0,0 +1,76 @@
+package com.yx.face.model.entity;
+
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.experimental.Accessors;
+
+import javax.persistence.*;
+import java.io.Serializable;
+import java.util.Date;
+
+/**
+ * <p>
+ * 消杀人员表
+ * </p>
+ *
+ * @author wxg
+ * @since 2022-11-11
+ */
+@Data
+@EqualsAndHashCode(callSuper = false)
+@Accessors(chain = true)
+@Table(name = "disinfect_user")
+public class DisinfectUser implements Serializable {
+
+    private static final long serialVersionUID = 1L;
+
+    /**
+     * 消杀人员表id
+     */
+    @Id
+    @GeneratedValue(strategy = GenerationType.IDENTITY)
+    private Integer id;
+
+    /**
+     * 姓名
+     */
+    @Column(name = "name")
+    private String name;
+
+    /**
+     * 身份证号
+     */
+    @Column(name = "id_number")
+    private String idNumber;
+
+    /**
+     * 消杀权限 1-消杀 2-检查,存json数组
+     */
+    @Column(name = "disinfect_auth")
+    private String disinfectAuth;
+
+    /**
+     * 负责的区域列表id 存json数组
+     */
+    @Column(name = "disinfect_area_id_list")
+    private String disinfectAreaIdList;
+
+    /**
+     * 创建时间
+     */
+    @Column(name = "create_time")
+    private Date createTime;
+
+    /**
+     * 管理员id
+     */
+    @Column(name = "admin_id")
+    private Integer adminId;
+
+    /**
+     * 是否删除 0-未删 1-已删
+     */
+    @Column(name = "is_del")
+    private Boolean isDel;
+
+}

+ 54 - 0
yqk-common/src/main/java/com/yx/face/model/entity/DownFaceNew.java

@@ -0,0 +1,54 @@
+package com.yx.face.model.entity;
+
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import lombok.experimental.Accessors;
+
+import java.util.Date;
+
+/**
+ * @description:
+ * @ClassName DownFace
+ * @Author WXG
+ * @Date 2022/1/18 18:28
+ */
+@ApiModel("人脸下发")
+@Data
+@Accessors(chain = true)
+public class DownFaceNew {
+
+    @ApiModelProperty(value = "设备编号 必须")
+    private String sn;
+
+    @ApiModelProperty(value = "唯一序号 一般是user_info的id 必须,如有特殊情况,也可以不为userId但需要保证唯一,不与userId冲突")
+    private Long userId;
+
+    @ApiModelProperty(value = "姓名 必须")
+    private String name;
+
+    @ApiModelProperty(value = "照片 必须")
+    private String photo;
+
+    @ApiModelProperty(value = "手机号")
+    private String phone;
+
+    @ApiModelProperty(value = "身份证号")
+    private String cardid;
+
+    @ApiModelProperty(value = "物理卡号")
+    private String cardIdEx;
+
+    @ApiModelProperty(value = "有效开始时间 默认当前时间-10")
+    private Date validPeriodStart;
+
+    @ApiModelProperty(value = "有效结束时间默认 访客:一天 | 常客:一年 | 黑名单:一百年")
+    private Date validPeriodEnd;
+
+    @ApiModelProperty(value = "权限级别 104:访客 | 105:常客 | 101:黑名单 | 必须")
+    private Integer rightno;
+
+    @ApiModelProperty(value = "人员类型 通行证人脸:1 | 常客:2 | 访客:3")
+    private Integer userType;
+
+}

+ 119 - 0
yqk-common/src/main/java/com/yx/face/model/entity/DragonAuth.java

@@ -0,0 +1,119 @@
+package com.yx.face.model.entity;
+
+import lombok.Data;
+import lombok.experimental.Accessors;
+
+import javax.persistence.*;
+import java.util.Date;
+
+/**
+ * @author shisl
+ * @package com.yx.face.model.entity
+ * @class DragonAuth
+ * @date 2023/11/7 上午9:36
+ * @description 巨龙接口授权
+ */
+@Data
+@Accessors(chain = true)
+@Table(name = "dragon_auth")
+public class DragonAuth {
+
+    @Id
+    @GeneratedValue(strategy = GenerationType.IDENTITY)
+    private Integer id;
+    /**
+     * 权限校验的appKey
+     */
+    @Column(name = "app_key")
+    private String appKey;
+    /**
+     * 权限校验的appSecret
+     */
+    @Column(name = "app_secret")
+    private String appSecret;
+
+    /**
+     * 权限校验的privateKey 16位随机数 包含字母和数据
+     */
+    @Column(name = "private_key")
+    private String privateKey;
+
+    /**
+     * 布控开关
+     */
+    @Column(name = "bk_switch")
+    private Boolean bkSwitch;
+
+    /**
+     * appId 32位 9805f4fb52a90a6941935fc3290673f4
+     */
+    @Column(name = "app_id")
+    private String appId;
+
+    /**
+     * 数据创建时间
+     */
+    @Column(name = "create_time")
+    private Date createTime;
+
+
+    @Column(name = "is_deleted")
+    private Boolean isDeleted;
+
+    /**
+     * 照片开关
+     */
+    @Column(name = "xp_switch")
+    private Boolean xpSwitch;
+
+    /**
+     * 照片开关
+     */
+    @Column(name = "dz_switch")
+    private Boolean dzSwitch;
+
+    /**
+     * 调用次数 null不限制
+     */
+    @Column(name = "limit_times")
+    private Integer limitTimes;
+
+    /**
+     * 已调用次数
+     */
+    @Column(name = "had_req_times")
+    private Integer hadReqTimes;
+
+    /**
+     * 单位时间调用频次 0或null不限制
+     */
+    @Column(name = "limit_frequency")
+    private Integer limitFrequency;
+
+    /**
+     * 调用频次单位时间 单位秒 0或null不限制
+     */
+    @Column(name = "limit_frequency_time")
+    private Integer limitFrequencyTime;
+
+    /**
+     * 最后一次请求时间
+     */
+    @Column(name = "latest_req_time")
+    private Date latestReqTime;
+
+    /**
+     * 省常口查询开关 默认0:关闭
+     */
+    @Column(name = "search_switch_province")
+    private Boolean searchSwitchProvince;
+
+    /**
+     * 公安部查询开关 默认0:关闭
+     */
+    @Column(name = "search_switch_gongan")
+    private Boolean searchSwitchGongan;
+
+
+
+}

+ 126 - 0
yqk-common/src/main/java/com/yx/face/model/entity/ExamUserWhitelist.java

@@ -0,0 +1,126 @@
+package com.yx.face.model.entity;
+
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.experimental.Accessors;
+
+import javax.persistence.*;
+import java.util.Date;
+
+/**
+ * <p>
+ * 考试用户白名单
+ * </p>
+ *
+ * @author wxg
+ * @since 2023-04-14
+ */
+@Data
+@EqualsAndHashCode(callSuper = false)
+@Accessors(chain = true)
+@Table(name = "exam_user_whitelist")
+public class ExamUserWhitelist{
+
+    @Id
+    @GeneratedValue(strategy = GenerationType.IDENTITY)
+    private Integer id;
+
+    /**
+     * 姓名
+     */
+    @Column(name = "name")
+    private String name;
+
+    /**
+     * 手机号
+     */
+    @Column(name = "phone")
+    private String phone;
+
+    /**
+     * 身份证号
+     */
+    @Column(name = "id_number")
+    private String idNumber;
+
+    /**
+     * 更新时间
+     */
+    @Column(name = "update_time")
+    private Date updateTime;
+
+    /**
+     * 创建时间
+     */
+    @Column(name = "create_time")
+    private Date createTime;
+
+    /**
+     * 管理员id
+     */
+    @Column(name = "admin_id")
+    private Integer adminId;
+
+
+    /**
+     * 场次
+     */
+    @Column(name = "exam_session")
+    private String examSession;
+
+    /**
+     * 准考证号
+     */
+    @Column(name = "exam_code")
+    private String examCode;
+
+    /**
+     * 报考类型
+     */
+    @Column(name = "exam_type")
+    private String examType;
+
+    /**
+     * 备注
+     */
+    @Column(name = "remark")
+    private String remark;
+
+    /**
+     * 开始时间
+     */
+    @Column(name = "start_time")
+    private Date startTime;
+
+    /**
+     * 结束时间
+     */
+    @Column(name = "end_time")
+    private Date endTime;
+
+    /**
+     * 状态 0:未入场 1:已入场
+     */
+    @Column(name = "status")
+    private Integer status;
+
+    /**
+     * 是否删除 0-未删除  1-已删除
+     */
+    @Column(name = "is_deleted")
+    private Boolean isDeleted;
+
+    /**
+     * 入场时间
+     */
+    @Column(name = "in_time")
+    private Date inTime;
+
+    /**
+     * 照片
+     */
+    @Column(name = "photo")
+    private String photo;
+
+
+}

+ 177 - 0
yqk-common/src/main/java/com/yx/face/model/entity/FaceDevice.java

@@ -0,0 +1,177 @@
+package com.yx.face.model.entity;
+
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import lombok.experimental.Accessors;
+
+import javax.persistence.*;
+import java.util.Date;
+
+/**
+ * @description: 人脸设备信息表(FaceDevice)实体类 <br>
+ * @author: PWB <br>
+ * @since: 1.0 <br>
+ * @date: 2021-06-08 21:24:00 <br>
+ */
+@Data
+@Accessors(chain = true)
+@Table(name = "face_device")
+public class FaceDevice {
+
+    /**
+     * 设备id
+     */
+
+    @Id
+    @GeneratedValue(strategy = GenerationType.IDENTITY)
+    private Integer id;
+
+    /**
+     * 设备编号
+     */
+
+
+    private String sn;
+
+    /**
+     * 名称or标签
+     */
+
+
+    private String name;
+
+    /**
+     * 停用-0|启用-1
+     */
+
+
+    private Integer enable;
+
+    /**
+     * 离线-0|在线-1
+     */
+
+
+    private Integer online;
+
+    /**
+     * 设备联网IP
+     */
+
+
+    @Column(name = "inter_ip")
+    private String interIp;
+
+    /**
+     * 绑定人员数
+     */
+
+
+    @Column(name = "user_count")
+    private Integer userCount;
+
+    /**
+     * 通行数量
+     */
+
+
+    @Column(name = "pass_count")
+    private Integer passCount;
+
+    /**
+     * app版本
+     */
+
+
+    @Column(name = "app_version")
+    private String appVersion;
+
+    /**
+     * 管理员id
+     */
+
+
+    @Column(name = "admin_id")
+    private Integer adminId;
+
+    /**
+     * 备注
+     */
+
+
+    private String remark;
+
+    /**
+     * 未授权-0|已授权-1
+     */
+
+
+    private Integer auth;
+
+    /**
+     * 不限-0|进-1|出-2
+     */
+
+
+    private Integer pass;
+
+    /**
+     * 更新时间
+     */
+
+
+    @Column(name = "update_time")
+    private Date updateTime;
+
+    /**
+     * 创建时间
+     */
+
+
+    @Column(name = "create_time")
+    private Date createTime;
+    /*
+    * 第三方id
+    * */
+    @Column(name = "third_party_id")
+    private Integer thirdPartyId;
+
+    /*
+     * 设备类型id
+     * */
+    @Column(name = "face_device_type_id")
+    private Integer faceDeviceTypeId;
+
+    @ApiModelProperty("场所码注册状态,0:否 ,1:是")
+    private Boolean placeRegisterStatus;
+
+    /*
+     * 区域类型 1-公有区域 2-私有区域
+     * */
+    @Column(name = "area_type")
+    private Integer areaType;
+
+    /*
+     * 1.楼宇公有 2.企业公有 3.企业私有
+     * */
+    @Column(name = "admin_area_type")
+    private Integer adminAreaType;
+    @ApiModelProperty("场所码id")
+    private Integer adminPlaceInfoId;
+
+    @ApiModelProperty("是否更改有效期 0否,1是")
+    private Boolean validityPeriodStatus;
+
+    @ApiModelProperty("开始有效期")
+    private Date startTime;
+
+    @ApiModelProperty("结束有效期")
+    private Date endTime;
+
+    @ApiModelProperty("任务列表id")
+    private Integer issuedTaskInfoId;
+
+    @Column(name = "report_time")
+    private Date reportTime;
+}
+

+ 41 - 0
yqk-common/src/main/java/com/yx/face/model/entity/FaceDeviceDetail.java

@@ -0,0 +1,41 @@
+package com.yx.face.model.entity;
+
+import lombok.Data;
+import lombok.experimental.Accessors;
+
+import javax.persistence.*;
+import java.io.Serializable;
+
+/**
+ * <p>
+ * 
+ * </p>
+ *
+ * @author wxg
+ * @since 2022-04-19
+ */
+@Data
+@Accessors(chain = true)
+@Table(name = "face_device_detail")
+public class FaceDeviceDetail implements Serializable {
+
+    /**
+     * 主键
+     */
+    @Id
+    @GeneratedValue(strategy = GenerationType.IDENTITY)
+    private Integer id;
+
+    /**
+     * 单位编号
+     */
+    @Column(name = "company_id")
+    private String companyId;
+
+    /**
+     * 设备id
+     */
+    @Column(name = "face_device_id")
+    private Integer faceDeviceId;
+
+}

+ 38 - 0
yqk-common/src/main/java/com/yx/face/model/entity/FaceDeviceLogo.java

@@ -0,0 +1,38 @@
+package com.yx.face.model.entity;
+
+import lombok.Data;
+
+import javax.persistence.*;
+
+/**
+ * @description: 人脸设备信息表(FaceDevice)实体类 <br>
+ * @author: PWB <br>
+ * @since: 1.0 <br>
+ * @date: 2021-06-08 21:24:00 <br>
+ */
+@Data
+@Table(name = "face_device_logo")
+public class FaceDeviceLogo {
+
+    /**
+     * 设备id
+     */
+
+    @Id
+    @GeneratedValue(strategy = GenerationType.IDENTITY)
+    private Integer id;
+
+
+    /**
+     * 管理员id
+     */
+    @Column(name = "admin_id")
+    private Integer adminId;
+
+    /**
+     * 图片路径
+     */
+    @Column(name = "logo_img")
+    private String logoImg;
+}
+

+ 63 - 0
yqk-common/src/main/java/com/yx/face/model/entity/FaceDeviceType.java

@@ -0,0 +1,63 @@
+package com.yx.face.model.entity;
+
+import lombok.Data;
+
+import javax.persistence.*;
+import java.util.Date;
+
+/**
+ * <p>
+ * 设备类型
+ * </p>
+ *
+ * @author c
+ * @since 2022-01-10
+ */
+@Data
+@Table(name = "face_device_type")
+public class FaceDeviceType {
+
+    /**
+     * 第三方列表id
+     */
+    @Id
+    @GeneratedValue(strategy = GenerationType.IDENTITY)
+    private Integer id;
+
+    /**
+     * 第三方名称
+     */
+    @Column(name = "name")
+    private String name;
+
+    /**
+     * 预留字段1
+     */
+    @Column(name = "extend1")
+    private String extend1;
+
+    /**
+     * 预留字段2
+     */
+    @Column(name = "extend2")
+    private String extend2;
+
+    /**
+     * 更新时间
+     */
+    @Column(name = "update_time")
+    private Date updateTime;
+
+    /**
+     * 创建时间
+     */
+    @Column(name = "create_time")
+    private Date createTime;
+
+
+    /**
+     * 类型编码
+     */
+    @Column(name = "code")
+    private String code;
+}

+ 255 - 0
yqk-common/src/main/java/com/yx/face/model/entity/FaceLog.java

@@ -0,0 +1,255 @@
+package com.yx.face.model.entity;
+
+import lombok.Data;
+import lombok.experimental.Accessors;
+
+import javax.persistence.*;
+import java.util.Date;
+
+/**
+ * @description: 天波人脸设备进出记录表(FaceLog)实体类 <br>
+ * @author: PWB <br>
+ * @since: 1.0 <br>
+ * @date: 2021-06-04 14:25:46 <br>
+ */
+@Data
+@Accessors(chain = true)
+@Table(name = "face_log")
+public class FaceLog {
+
+    // 通用
+    public static final Integer NORMAL = 0;
+
+    // 进门
+    public static final Integer IN = 1;
+
+    // 出门
+    public static final Integer OUT = 2;
+
+    /**
+     * 天波人脸记录id
+     */
+    @Id
+    @GeneratedValue(strategy = GenerationType.IDENTITY)
+    private Long id;
+
+    /**
+     * 记录唯一序号
+     */
+    private Long recordid;
+
+    /**
+     * 0:离线(即开门提示逻辑由设备离线处理事后上报)
+     * 1:在线(即开门提示逻辑由平台实时控制
+     */
+    private Integer action;
+
+    /**
+     * 设备SN
+     */
+    @Column(name = "device_sn")
+    private String deviceSn;
+
+    /**
+     * 用户id
+     */
+    @Column(name = "user_id")
+    private Long userId;
+
+    /**
+     * 用户姓名
+     */
+    private String name;
+
+    /**
+     * 手机号码
+     */
+    private String phone;
+
+    /**
+     * 照片
+     */
+    private String photo;
+
+    /**
+     * 10进制(当verifytype=2 时,表示身份证号码)
+     */
+    private String cardid;
+
+    /**
+     * 物理卡号(卡号2)
+     */
+    @Column(name = "cardIdEx")
+    private String cardidex;
+
+    /**
+     * 0人脸
+     * 1卡
+     * 2 身份证
+     * 3 二维码
+     * 4 远程
+     * 6 IC卡+人脸
+     */
+    @Column(name = "verify_type")
+    private Integer verifyType;
+
+    /**
+     * 106 (管理员)
+     * 105(操作员)
+     * 104(普通员工 默认)
+     * 103(访客)
+     * 102(禁止)
+     * 101 (黑名单)
+     */
+    private Integer rightno;
+
+    /**
+     * 考勤时间格式 yyyy-MM-dd HH:mm:ss
+     */
+    @Column(name = "face_time")
+    private String faceTime;
+
+    /**
+     * 终端上设置的组织id
+     */
+    private String orgid;
+
+    /**
+     * 0 通用
+     * 1进门
+     * 2出门
+     */
+    @Column(name = "out_type")
+    private Integer outType;
+
+    /**
+     * 身份证信息JSON串
+     * name 姓名
+     * sex 性别
+     * nation民族
+     * born出生年月
+     * address地址
+     * apartment签发机关
+     * period有效期限
+     * no身份证号
+     * country国籍
+     * cn_name中文名
+     * Idcard_version证件版本
+     * card_type身份证类型
+     * photo 身份证照片
+     */
+    @Column(name = "id_card")
+    private String idCard;
+
+    /**
+     * 体温测量度数
+     */
+    private String extend3;
+
+    /**
+     * 佩戴口罩
+     * 0:未戴
+     * 1:已戴
+     * 2:未启用口罩检测/开启仅检测体温
+     */
+    private String extend1;
+
+    /**
+     * 人脸相似度分值
+     */
+    @Column(name = "verify_score")
+    private String verifyScore;
+
+    /**
+     * 体温是否异常 0 正常 1 异常
+     */
+    @Column(name = "tw_status")
+    private String twStatus;
+
+    /**
+     * 健康码状态00 绿码 01 黄码 10 红码
+     */
+    @Column(name = "jkm_status")
+    private String jkmStatus;
+
+    /**
+     * .
+     * 健康码状态 0 健康码 1 国康码
+     */
+    @Column(name = "jkm_type")
+    private String jkmType;
+
+    /**
+     * 阴性 阳性
+     */
+    @Column(name = "hs_status")
+    private String hsStatus;
+
+    /**
+     * 疫苗状态 0针 等等依次累加
+     */
+    @Column(name = "ym_status")
+    private String ymStatus;
+
+    /**
+     * 行程信息
+     */
+    @Column(name = "xc_info")
+    private String xcInfo;
+
+    /**
+     * admin id
+     */
+    @Column(name = "admin_id")
+    private Integer adminId;
+
+    /**
+     * 健康码组装数据
+     */
+    private String extend5;
+
+    /**
+     * 创建时间
+     */
+    @Column(name = "create_time")
+    private Date createTime;
+
+
+    /**
+     * 性别
+     */
+    private String gender;
+    /**
+     * 生日 出生日期
+     */
+    private String birthday;
+    /** 是否有效 true-有效 false-无效*/
+    private Boolean status;
+    /** 原因*/
+    /** @see com.yx.face.model.enums.FaceLogStatusEnum */
+    private Integer reasonType;
+    /**
+     * 设备品牌名称
+     */
+    @Column(name = "third_party_name")
+    private String thirdPartyName;
+    /**
+     * 设备类型名称
+     */
+    @Column(name = "face_device_type_name")
+    private String faceDeviceTypeName;
+
+    /**
+     * 账号名称
+     */
+    private String username;
+
+    /**
+     * 设备地点
+     */
+    @Column(name = "device_name")
+    private String deviceName;
+    @Column(name = "country_code")
+    private String countryCode;
+}
+

+ 58 - 0
yqk-common/src/main/java/com/yx/face/model/entity/FaceLogDetail.java

@@ -0,0 +1,58 @@
+package com.yx.face.model.entity;
+
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.experimental.Accessors;
+
+import javax.persistence.*;
+import java.io.Serializable;
+import java.util.Date;
+
+/**
+ * <p>
+ * 进出记录自定义字段附表
+ * </p>
+ *
+ * @author wxg
+ * @since 2022-12-09
+ */
+@Data
+@EqualsAndHashCode(callSuper = false)
+@Accessors(chain = true)
+@Table(name = "face_log_detail")
+public class FaceLogDetail implements Serializable {
+
+    private static final long serialVersionUID = 1L;
+
+    /**
+     * 进出记录自定义字段附表id
+     */
+    @Id
+    @GeneratedValue(strategy = GenerationType.IDENTITY)
+    private Long id;
+
+    /**
+     * 进出记录id
+     */
+    @Column(name = "face_log_id")
+    private Long faceLogId;
+
+    /**
+     * 自定义字段Id
+     */
+    @Column(name = "context_id")
+    private String contextId;
+
+    /**
+     * 自定义字段值
+     */
+    @Column(name = "context_custom_name_val")
+    private String contextCustomNameVal;
+
+    /**
+     * 创建时间
+     */
+    @Column(name = "create_time")
+    private Date createTime;
+
+}

+ 25 - 0
yqk-common/src/main/java/com/yx/face/model/entity/FaceLogFrom.java

@@ -0,0 +1,25 @@
+package com.yx.face.model.entity;
+
+import lombok.Data;
+
+import javax.persistence.*;
+import java.io.Serializable;
+
+
+@Data
+@Table(name = "face_log_from")
+public class FaceLogFrom implements Serializable {
+
+    @Id
+    @GeneratedValue(strategy = GenerationType.IDENTITY)
+    private Long id;
+
+    @Column(name = "face_log_id")
+    private Long faceLogId;
+
+    @Column(name = "img_base")
+    private byte[] imgBase;
+
+    @Column(name = "sfz_img_base")
+    private byte[] sfzImgBase;
+}

+ 97 - 0
yqk-common/src/main/java/com/yx/face/model/entity/FacePass.java

@@ -0,0 +1,97 @@
+package com.yx.face.model.entity;
+
+import lombok.Data;
+import lombok.experimental.Accessors;
+
+import javax.persistence.*;
+import java.util.Date;
+
+/**
+ * @description: 人脸下发表(FacePass)实体类 <br>
+ * @author: PWB <br>
+ * @since: 1.0 <br>
+ * @date: 2021-06-04 14:25:47 <br>
+ */
+@Data
+@Accessors(chain = true)
+@Table(name = "face_pass")
+public class FacePass {
+
+    /**
+     * 设备人脸下发id
+     */
+    @Id
+    @GeneratedValue(strategy = GenerationType.IDENTITY)
+    private Long id;
+
+    /**
+     * 用户id
+     */
+    @Column(name = "user_id")
+    private Long userId;
+
+    /**
+     * 设备编号
+     */
+    @Column(name = "device_sn")
+    private String deviceSn;
+
+    /**
+     * 设备id
+     */
+    @Column(name = "device_id")
+    private Integer deviceId;
+
+    /**
+     * 有效期开始时间
+     */
+    @Column(name = "start_time")
+    private Date startTime;
+
+    /**
+     * 有效期结束时间
+     */
+    @Column(name = "end_time")
+    private Date endTime;
+
+    /**
+     * 通行证人脸-1|常客-2|访客-3
+     */
+    private Integer type;
+
+    /**
+     * 无效-0|下发中-1|成功-2|失败-3
+     */
+    private Integer status;
+
+    /**
+     * admin id
+     */
+    @Column(name = "admin_id")
+    private Integer adminId;
+
+    /**
+     * admin id
+     */
+    @Column(name = "task_id")
+    private String taskId;
+
+    /**
+     * 更新时间
+     */
+    @Column(name = "update_time")
+    private Date updateTime;
+
+    /**
+     * 创建时间
+     */
+    @Column(name = "create_time")
+    private Date createTime;
+
+    /**
+     * 备注
+     */
+    private String remark;
+
+}
+

+ 77 - 0
yqk-common/src/main/java/com/yx/face/model/entity/FaceRequestLog.java

@@ -0,0 +1,77 @@
+package com.yx.face.model.entity;
+
+import lombok.Data;
+
+import javax.persistence.*;
+import java.util.Date;
+
+/**
+ * @description: 天波人脸服务请求日志表(FaceRequestLog)实体类 <br>
+ * @author: PWB <br>
+ * @since: 1.0 <br>
+ * @date: 2021-06-04 14:25:47 <br>
+ */
+@Data
+@Table(name = "face_request_log")
+public class FaceRequestLog {
+
+    /**
+     * 请求天波人脸服务id
+     */
+
+    @Id
+    @GeneratedValue(strategy = GenerationType.IDENTITY)
+    private Long id;
+
+    /**
+     * 接口名
+     */
+
+    @Column(name = "name")
+    private String name;
+
+    /**
+     * 接口路径
+     */
+
+    @Column(name = "context")
+    private String context;
+
+    /**
+     * 请求参数
+     */
+
+    @Column(name = "params")
+    private String params;
+
+    /**
+     * 请求中-0|成功-1|失败-2
+     */
+
+    @Column(name = "status")
+    private Integer status;
+
+    /**
+     * 耗时
+     */
+    @Column(name = "used_time")
+    private Long usedTime;
+
+    /**
+     * 更新时间
+     */
+
+
+    @Column(name = "update_time")
+    private Date updateTime;
+
+    /**
+     * 创建时间
+     */
+
+
+    @Column(name = "create_time")
+    private Date createTime;
+
+}
+

+ 75 - 0
yqk-common/src/main/java/com/yx/face/model/entity/FaceTask.java

@@ -0,0 +1,75 @@
+package com.yx.face.model.entity;
+
+import lombok.Data;
+
+import javax.persistence.*;
+import java.util.Date;
+
+/**
+ * @description: 人脸清除定时任务(FaceTask)实体类 <br>
+ * @author: PWB <br>
+ * @since: 1.0 <br>
+ * @date: 2021-06-10 13:52:10 <br>
+ */
+@Data
+@Table(name = "face_task")
+public class FaceTask {
+
+    /**
+     * 人脸清除定时任务id
+     */
+
+    @Id
+    @GeneratedValue(strategy = GenerationType.IDENTITY)
+
+    private Long id;
+
+    /**
+     * 设备id
+     */
+
+
+    @Column(name = "device_sn")
+    private String deviceSn;
+
+    /**
+     * 用户id
+     */
+
+
+    @Column(name = "user_id")
+    private Long userId;
+
+    /**
+     * 任务时间
+     */
+
+
+    @Column(name = "task_time")
+    private Date taskTime;
+
+    /**
+     * 未执行-0|已执行-1
+     */
+
+
+    private Integer status;
+
+    /**
+     * 更新时间
+     */
+
+
+    @Column(name = "update_time")
+    private Date updateTime;
+
+    /**
+     * 创建时间
+     */
+
+
+    @Column(name = "create_time")
+    private Date createTime;
+
+}
+

+ 43 - 0
yqk-common/src/main/java/com/yx/face/model/entity/FkjFloorConfig.java

@@ -0,0 +1,43 @@
+package com.yx.face.model.entity;
+
+import com.fasterxml.jackson.annotation.JsonFormat;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import javax.persistence.GeneratedValue;
+import javax.persistence.GenerationType;
+import javax.persistence.Id;
+import javax.persistence.Table;
+import java.io.Serializable;
+import java.util.Date;
+
+/**
+ * @author shisl
+ * @package com.yx.face.model.entity
+ * @class FkjFloorConfig
+ * @date 2024/1/4 下午4:20
+ * @description
+ */
+@Data
+@Table(name = "fkj_floor_config")
+public class FkjFloorConfig implements Serializable {
+
+    @Id
+    @GeneratedValue(strategy = GenerationType.IDENTITY)
+    private Long id;
+
+    @ApiModelProperty(value = "账号id")
+    private Integer adminId;
+
+    @ApiModelProperty(value = "FkjFloorInitConfig楼层配置数组JSON字符串 [{\"hexadecimalFloor\":16,\"actualityFloor\":\"M\"}]")
+    private String floorConfig ;
+
+    @ApiModelProperty(value = "创建时间")
+    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
+    private Date createTime;
+
+    @ApiModelProperty(value = "更新时间")
+    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
+    private Date updateTime;
+
+}

+ 40 - 0
yqk-common/src/main/java/com/yx/face/model/entity/FkjHeartTracking.java

@@ -0,0 +1,40 @@
+package com.yx.face.model.entity;
+
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import javax.persistence.GeneratedValue;
+import javax.persistence.GenerationType;
+import javax.persistence.Id;
+import javax.persistence.Table;
+import java.io.Serializable;
+import java.util.Date;
+
+/**
+ * @author shisl
+ * @package com.yx.face.model.entity
+ * @class FkjHeartTracking
+ * @date 2023/7/28 下午11:55
+ * @description 访客机设备心跳记录
+ */
+@Data
+@Table(name = "fkj_heart_tracking")
+public class FkjHeartTracking implements Serializable {
+
+    @Id
+    @GeneratedValue(strategy = GenerationType.IDENTITY)
+    private Integer id;
+
+    private Integer adminId;
+
+    @ApiModelProperty(value = "设备编号")
+    private String sn;
+
+    @ApiModelProperty(value = "创建时间")
+    private Date createTime;
+
+    @ApiModelProperty(value = "最后一次tracking心跳时间")
+    private Date lastTrackingTime;
+
+
+}

+ 68 - 0
yqk-common/src/main/java/com/yx/face/model/entity/FkjQrcode.java

@@ -0,0 +1,68 @@
+package com.yx.face.model.entity;
+
+import com.fasterxml.jackson.annotation.JsonFormat;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import javax.persistence.GeneratedValue;
+import javax.persistence.GenerationType;
+import javax.persistence.Id;
+import javax.persistence.Table;
+import java.io.Serializable;
+import java.util.Date;
+
+/**
+ * @author shisl
+ * @package com.yx.face.model.entity
+ * @class Visitee
+ * @date 2023/7/28 下午10:33
+ * @description 访客机二维码
+ */
+@Data
+@Table(name = "fkj_qrcode")
+public class FkjQrcode implements Serializable {
+
+    @Id
+    @GeneratedValue(strategy = GenerationType.IDENTITY)
+    private Long id;
+
+    @ApiModelProperty(value = "账号id")
+    private Integer adminId;
+
+    @ApiModelProperty(value = "账号名称")
+    private String adminName;
+
+    @ApiModelProperty(value = "姓名")
+    private String name;
+
+    @ApiModelProperty(value = "受访人姓名")
+    private String visiteeName;
+
+    @ApiModelProperty(value = "身份证号")
+    private String idNumber;
+
+    @ApiModelProperty(value = "手机号")
+    private String phone;
+
+    @ApiModelProperty(value = "单机版二维码")
+    private String ethQrcode;
+
+    @ApiModelProperty(value = "微光互联二维码")
+    private String vguangQrcode;
+
+    @ApiModelProperty(value = "开始时间")
+    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
+    private Date startTime;
+
+    @ApiModelProperty(value = "结束时间")
+    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
+    private Date endTime;
+
+    @ApiModelProperty(value = "创建时间")
+    private Date createTime;
+
+    @ApiModelProperty(value = "更新时间")
+    private Date updateTime;
+
+
+}

+ 32 - 0
yqk-common/src/main/java/com/yx/face/model/entity/HealthCode.java

@@ -0,0 +1,32 @@
+package com.yx.face.model.entity;
+
+import lombok.Data;
+
+import javax.persistence.*;
+import java.util.Date;
+
+/**
+ * @description: (HealthCode)实体类 <br>
+ * @author: PWB <br>
+ * @since: 1.0 <br>
+ * @date: 2021-06-07 06:26:53 <br>
+ */
+@Data
+@Table(name = "health_code")
+public class HealthCode {
+
+
+    @Id
+    @GeneratedValue(strategy = GenerationType.IDENTITY)
+
+    private Long id;
+
+
+    private String params;
+
+
+    @Column(name = "create_time")
+    private Date createTime;
+
+}
+

+ 82 - 0
yqk-common/src/main/java/com/yx/face/model/entity/HealthCodeConfig.java

@@ -0,0 +1,82 @@
+package com.yx.face.model.entity;
+
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import lombok.experimental.Accessors;
+
+import javax.persistence.GeneratedValue;
+import javax.persistence.GenerationType;
+import javax.persistence.Id;
+import javax.persistence.Transient;
+import java.io.Serializable;
+import java.util.Date;
+
+/**
+ *
+ *
+ * @author lileilei
+ * @since 2022-08-29
+ */
+@Data
+@Accessors(chain = true)
+@ApiModel(description = "")
+public class HealthCodeConfig implements Serializable  {
+    private static final long serialVersionUID = 1L;
+
+    @Id
+    @GeneratedValue(strategy = GenerationType.IDENTITY)
+    private Integer id;
+
+    @ApiModelProperty(value = "设备sn")
+    private String sn;
+
+    @ApiModelProperty(value = "设备地点")
+    private String address;
+
+    @ApiModelProperty(value = "公司名字")
+    private String companyName;
+
+    @ApiModelProperty(value = "负责人")
+    private String head;
+
+    @ApiModelProperty(value = "负责人电话")
+    private String headPhone;
+
+    @ApiModelProperty(value = "是否开启场所码")
+    private Boolean enableStatus;
+
+    @ApiModelProperty(value = "注册到某个地址码")
+    private String addressCode;
+
+    @ApiModelProperty(value = "场所码单位名称")
+    private String unitName;
+
+    @ApiModelProperty(value = "场所码单位地址")
+    private String unitAddress;
+
+    @ApiModelProperty(value = "场所码管理员健康码信息")
+    private String managerHealthCode;
+
+    @ApiModelProperty(value = "创建时间")
+    private Date createTime;
+
+    @ApiModelProperty(value = "修改时间")
+    private Date updateTime;
+
+    @ApiModelProperty("每秒请求数")
+    private Integer requestNumber;
+
+    @ApiModelProperty("总请求上限数")
+    private Integer requestNumberLimit;
+
+    @ApiModelProperty("已请求次数")
+    private Integer requestedTimes;
+
+    @ApiModelProperty("注册状态")
+    private Boolean registerStatus;
+
+    @ApiModelProperty("剩余请求次数")
+    @Transient
+    private Integer validRequestTimes;
+}

+ 37 - 0
yqk-common/src/main/java/com/yx/face/model/entity/InOutStatistics.java

@@ -0,0 +1,37 @@
+package com.yx.face.model.entity;
+
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import javax.persistence.GeneratedValue;
+import javax.persistence.GenerationType;
+import javax.persistence.Id;
+import javax.persistence.Table;
+import java.util.Date;
+
+@Data
+@Table(name = "in_out_statistics")
+public class InOutStatistics {
+
+    @Id
+    @GeneratedValue(strategy = GenerationType.IDENTITY)
+    private Long id;
+
+    @ApiModelProperty("进门人数")
+    private Integer inNum;
+
+    @ApiModelProperty("出门人数")
+    private Integer outNum;
+
+    @ApiModelProperty("滞留人数")
+    private Integer stayNum;
+
+    @ApiModelProperty(value = "所属账号")
+    private Integer adminId;
+
+    @ApiModelProperty(value = "统计日期 yyyy-MM-dd")
+    private Date statisticDate;
+
+    @ApiModelProperty(value = "创建时间 yyyy-MM-dd HH:mm:ss")
+    private Date createTime;
+}

+ 81 - 0
yqk-common/src/main/java/com/yx/face/model/entity/IotvspUserInfo.java

@@ -0,0 +1,81 @@
+package com.yx.face.model.entity;
+
+import com.alibaba.fastjson.annotation.JSONField;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import lombok.experimental.Accessors;
+
+import javax.persistence.Column;
+import javax.persistence.Table;
+
+/**
+ * @author shisl
+ * @package cn.hanghui.outapi.platform.alipay.entity.po
+ * @class IotvspUserInfo
+ * @date 2023/5/5 下午4:29
+ * @description iotvsp用户库
+ */
+@Data
+@Accessors(chain = true)
+@Table(name = "iotvsp_user_info")
+public class IotvspUserInfo extends Base {
+
+    /**
+     * 证件类型,IDENTITY_CARD身份证,PASS_PORT护照,STU_NUM学生学号,COMPANY_NUM工号,TAIWAN_CARD台胞证,HK_MC_CARD港澳证件
+     */
+    private String certType;
+    /**
+     * 证件号码
+     */
+    private String certNo;
+    /**
+     * 用户姓名
+     */
+    private String certName;
+    /**
+     * 手机号
+     */
+    private String phone;
+    /**
+     * 扩展信息
+     */
+    private String ext;
+
+    /**
+     * 用户id,和录入人员获取unique_id顺序一致
+     */
+    @Column(name = "vid")
+    private String vid;
+
+    /**
+     * 用户入库响应回来的unique_id
+     */
+    private String uniqueId;
+
+    /**
+     * 机构编码
+     */
+    @Column(name = "org_out_id")
+    private String orgOutId;
+
+    /**
+     * isv的商户id
+     */
+    @ApiModelProperty(value = "isv的商户id")
+    @JSONField(name = "isv_pid")
+    private String isvPid;
+
+    /**
+     * 业务id状态,默认0入库中   1成功 2失败
+     */
+    @ApiModelProperty(value = "业务id状态,默认0入库中 1成功 2失败")
+    @JSONField(name = "state")
+    private Integer state = 0;
+    /**
+     * 消息
+     */
+    @JSONField(name = "msg")
+    private String msg;
+
+
+}

+ 53 - 0
yqk-common/src/main/java/com/yx/face/model/entity/IssuedTaskInfo.java

@@ -0,0 +1,53 @@
+package com.yx.face.model.entity;
+
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import lombok.experimental.Accessors;
+
+import javax.persistence.GeneratedValue;
+import javax.persistence.GenerationType;
+import javax.persistence.Id;
+import javax.persistence.Table;
+import java.io.Serializable;
+import java.util.Date;
+
+/**
+ * 下发任务列表
+ *
+ * @author lileilei
+ * @since 2022-07-13
+ */
+@Data
+@Accessors(chain = true)
+@Table(name = "issued_task_info")
+@ApiModel(description = "下发任务列表")
+public class IssuedTaskInfo implements Serializable  {
+
+    private static final long serialVersionUID = 1L;
+    @Id
+    @GeneratedValue(strategy = GenerationType.IDENTITY)
+    private Integer id;
+
+    @ApiModelProperty(value = "设备sn")
+    private String sn;
+
+    @ApiModelProperty(value = "下发类型:0-批量导入,1-全量下发")
+    private String issuedType;
+
+    @ApiModelProperty(value = "状态:0-处理中,1-下发中,2-已完成,3-已取消")
+    private String status;
+
+    @ApiModelProperty(value = "错误信息列表")
+    private String msgAddress;
+
+    @ApiModelProperty(value = "账号id")
+    private Integer adminId;
+
+    @ApiModelProperty(value = "更新时间")
+    private Date updateTime;
+
+    @ApiModelProperty(value = "创建时间")
+    private Date createTime;
+
+}

+ 44 - 0
yqk-common/src/main/java/com/yx/face/model/entity/MiddlewareDeviceUser.java

@@ -0,0 +1,44 @@
+package com.yx.face.model.entity;
+
+import lombok.Data;
+
+import javax.persistence.GeneratedValue;
+import javax.persistence.GenerationType;
+import javax.persistence.Id;
+import javax.persistence.Table;
+import java.io.Serializable;
+import java.util.Date;
+
+/**
+ * @author shisl
+ * @package com.yx.face.model.entity
+ * @class MiddlewareDeviceUser
+ * @date 2024/1/21 下午10:13
+ * @description
+ */
+@Data
+@Table(name = "middleware_device_user")
+public class MiddlewareDeviceUser implements Serializable {
+
+    @Id
+    @GeneratedValue(strategy = GenerationType.IDENTITY)
+    private Long id;
+
+    /**
+     * user_info表id
+     */
+    private Long userId;
+
+    /**
+     * 智能门锁用户id 设备返回
+     */
+    private String pin;
+
+    private String deviceSn;
+
+    private Integer adminId;
+
+    private Date createTime;
+
+
+}

+ 80 - 0
yqk-common/src/main/java/com/yx/face/model/entity/Place.java

@@ -0,0 +1,80 @@
+package com.yx.face.model.entity;
+
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.experimental.Accessors;
+
+import javax.persistence.*;
+import java.io.Serializable;
+import java.util.Date;
+
+/**
+ * <p>
+ *
+ * </p>
+ *
+ * @author wxg
+ * @since 2022-05-24
+ */
+@Data
+@EqualsAndHashCode(callSuper = false)
+@Accessors(chain = true)
+@Table(name = "place")
+public class Place implements Serializable {
+
+    private static final long serialVersionUID = 1L;
+
+    @Id
+    @GeneratedValue(strategy = GenerationType.IDENTITY)
+    private Integer id;
+
+    /**
+     * 场所标题
+     */
+    @Column(name = "title")
+    @ApiModelProperty("场所标题")
+    private String title;
+
+    /**
+     * 场所图片
+     */
+    @Column(name = "picture")
+    @ApiModelProperty("场所图片")
+    private String picture;
+
+    /**
+     * 禁用身份证前缀
+     */
+    @Column(name = "disable_id_card")
+    @ApiModelProperty("禁用身份证前缀")
+    private String disableIdCard;
+
+    /**
+     * 账号id
+     */
+    @Column(name = "admin_id")
+    @ApiModelProperty("账号id")
+    private Integer adminId;
+
+    /**
+     * 创建时间
+     */
+    @Column(name = "create_time")
+    private Date createTime;
+
+    /**
+     * 更新时间
+     */
+    @Column(name = "update_time")
+    private Date updateTime;
+
+    @ApiModelProperty("是否启用健康码,0:否,1:是")
+    @Column(name = "health_code_status")
+    private Integer healthCodeStatus;
+
+    @ApiModelProperty("场所说明")
+    @Column(name = "instructions")
+    private String instructions;
+
+}

+ 119 - 0
yqk-common/src/main/java/com/yx/face/model/entity/PlaceDetail.java

@@ -0,0 +1,119 @@
+package com.yx.face.model.entity;
+
+
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.experimental.Accessors;
+
+import javax.persistence.*;
+import java.io.Serializable;
+import java.util.Date;
+
+/**
+ * <p>
+ *
+ * </p>
+ *
+ * @author wxg
+ * @since 2022-05-24
+ */
+@Data
+@EqualsAndHashCode(callSuper = false)
+@Accessors(chain = true)
+@Table(name = "place_detail")
+public class PlaceDetail implements Serializable {
+
+    private static final long serialVersionUID = 1L;
+
+    @Id
+    @GeneratedValue(strategy = GenerationType.IDENTITY)
+    private Integer id;
+
+    /**
+     * 预约开始时间
+     */
+    @Column(name = "start_time")
+    @ApiModelProperty("预约开始时间")
+    private Date startTime;
+
+    /**
+     * 预约结束时间
+     */
+    @Column(name = "end_time")
+    @ApiModelProperty("预约结束时间")
+    private Date endTime;
+
+    /**
+     * 限定人数
+     */
+    @Column(name = "limit_number")
+    @ApiModelProperty("限定人数")
+    private Integer limitNumber;
+
+    /**
+     * 剩余人数
+     */
+    @Column(name = "remaining_number")
+    private Integer remainingNumber;
+
+    /**
+     * 场所id
+     */
+    @Column(name = "place_Id")
+    private Integer placeId;
+
+    /**
+     * 账号id
+     */
+    @Column(name = "admin_id")
+    private Integer adminId;
+
+    /**
+     * 创建时间
+     */
+    @Column(name = "create_time")
+    private Date createTime;
+
+    /**
+     * 更新时间
+     */
+    @Column(name = "upDate_time")
+    private Date upDateTime;
+
+    /**
+     * 删除标识,0:未删,1:已删
+     */
+    @Column(name = "del_flag")
+    private Boolean delFlag;
+
+    @ApiModelProperty("场所说明")
+    @Column(name = "instructions")
+    private String instructions;
+
+    @ApiModelProperty("场所预约日期时间段")
+    @Column(name = "date_time_range")
+    private String dateTimeRange;
+
+    @ApiModelProperty("预约开始小时格式化时间")
+    @Column(name = "start_time_str")
+    private String startTimeStr;
+
+    @ApiModelProperty("预约开始小时格式化时间")
+    @Column(name = "end_time_str")
+    private String endTimeStr;
+
+    @ApiModelProperty("天数日期格式化时间")
+    @Column(name = "date_time_str")
+    private String dateTimeStr;
+
+    @ApiModelProperty("完整开始结束格式化时间")
+    @Column(name = "full_time_str")
+    private String fullTimeStr;
+
+    /**
+     * 状态 1-启用 0-停用
+     */
+    @Column(name = "status")
+    private Boolean status;
+}

+ 82 - 0
yqk-common/src/main/java/com/yx/face/model/entity/PlaceRecord.java

@@ -0,0 +1,82 @@
+package com.yx.face.model.entity;
+
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.experimental.Accessors;
+
+import javax.persistence.GeneratedValue;
+import javax.persistence.GenerationType;
+import javax.persistence.Id;
+import javax.persistence.Table;
+import java.io.Serializable;
+import java.util.Date;
+
+/**
+ * 场所记录表
+ *
+ * @author lileilei
+ * @since 2022-06-22
+ */
+@Data
+@EqualsAndHashCode(callSuper = false)
+@Accessors(chain = true)
+@Table(name = "place_record")
+@ApiModel(description = "场所记录表")
+public class PlaceRecord implements Serializable  {
+    private static final long serialVersionUID = 1L;
+
+    @Id
+    @GeneratedValue(strategy = GenerationType.IDENTITY)
+    private Integer id;
+
+    @ApiModelProperty(value = "姓名")
+    private String name;
+
+    @ApiModelProperty(value = "身份证")
+    private String idNumber;
+
+    @ApiModelProperty(value = "健康码状态")
+    private String level;
+
+    @ApiModelProperty(value = "采样时间")
+    private Date checkTime;
+
+    @ApiModelProperty(value = "报告时间")
+    private Date reportTime;
+
+    @ApiModelProperty(value = "核酸检测结果")
+    private String checkResult;
+
+    @ApiModelProperty(value = "1 未去过中高风险地区 2 去过中高风险地区 3 未查询到结果")
+    private String travelValidation;
+
+    @ApiModelProperty(value = "0 未接种 1-接种完成 2-未完全接种. 3- 完成加强针")
+    private String vaccinated;
+
+    @ApiModelProperty(value = "注册到某个地址码")
+    private String addressCode;
+
+    @ApiModelProperty(value = "场所码单位名称")
+    private String unitName;
+
+    @ApiModelProperty(value = "场所码单位地址")
+    private String unitAddress;
+
+    @ApiModelProperty(value = "场所码管理员健康码信息")
+    private String managerHealthCode;
+
+    @ApiModelProperty(value = "用户健康码信息")
+    private String healthCode;
+
+    @ApiModelProperty(value = "账号id")
+    private Integer adminId;
+
+    @ApiModelProperty(value = "更新时间")
+    private Date updateTime;
+
+    @ApiModelProperty(value = "创建时间")
+    private Date createTime;
+
+}

+ 73 - 0
yqk-common/src/main/java/com/yx/face/model/entity/PoliceStation.java

@@ -0,0 +1,73 @@
+package com.yx.face.model.entity;
+
+import lombok.Data;
+
+import javax.persistence.*;
+import java.util.Date;
+
+/**
+ * @description: 派出所信息表(PoliceStation)实体类 <br>
+ * @author: PWB <br>
+ * @since: 1.0 <br>
+ * @date: 2021-06-04 14:25:48 <br>
+ */
+@Data
+@Table(name = "police_station")
+public class PoliceStation {
+
+    /**
+     * 派出所id
+     */
+
+    @Id
+    @GeneratedValue(strategy = GenerationType.IDENTITY)
+
+    private Integer id;
+
+    /**
+     * 派出所名称
+     */
+
+
+    private String name;
+
+    /**
+     * 派出所码
+     */
+
+
+    private String code;
+
+    /**
+     * 地址code
+     */
+
+
+    @Column(name = "address_code")
+    private Integer addressCode;
+
+    /**
+     * 地址
+     */
+
+
+    private String address;
+
+    /**
+     * 更新时间
+     */
+
+
+    @Column(name = "update_time")
+    private Date updateTime;
+
+    /**
+     * 创建时间
+     */
+
+
+    @Column(name = "create_time")
+    private Date createTime;
+
+}
+

+ 49 - 0
yqk-common/src/main/java/com/yx/face/model/entity/PrivateArea.java

@@ -0,0 +1,49 @@
+package com.yx.face.model.entity;
+
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.experimental.Accessors;
+
+import javax.persistence.*;
+import java.io.Serializable;
+import java.util.Date;
+
+/**
+ * <p>
+ * 私有区域表
+ * </p>
+ *
+ * @author wxg
+ * @since 2022-06-29
+ */
+@Data
+@EqualsAndHashCode(callSuper = false)
+@Accessors(chain = true)
+@Table(name = "private_area")
+public class PrivateArea implements Serializable {
+
+    private static final long serialVersionUID = 1L;
+
+    @Id
+    @GeneratedValue(strategy = GenerationType.IDENTITY)
+    private Integer id;
+
+    /**
+     * 私有区域名称
+     */
+    @Column(name = "private_area_name")
+    private String privateAreaName;
+
+    /**
+     * 账号id
+     */
+    @Column(name = "admin_id")
+    private Integer adminId;
+
+    /**
+     * 创建时间
+     */
+    @Column(name = "create_time")
+    private Date createTime;
+
+}

+ 55 - 0
yqk-common/src/main/java/com/yx/face/model/entity/PrivateAreaDevice.java

@@ -0,0 +1,55 @@
+package com.yx.face.model.entity;
+
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.experimental.Accessors;
+
+import javax.persistence.*;
+import java.io.Serializable;
+import java.util.Date;
+
+/**
+ * <p>
+ * 私有区域设备关联表
+ * </p>
+ *
+ * @author wxg
+ * @since 2022-06-29
+ */
+@Data
+@EqualsAndHashCode(callSuper = false)
+@Accessors(chain = true)
+@Table(name = "private_area_device")
+public class PrivateAreaDevice implements Serializable {
+
+    private static final long serialVersionUID = 1L;
+
+    @Id
+    @GeneratedValue(strategy = GenerationType.IDENTITY)
+    private Integer id;
+
+    /**
+     * 设备id
+     */
+    @Column(name = "device_id")
+    private Integer deviceId;
+
+    /**
+     * 私有区域id
+     */
+    @Column(name = "private_area_id")
+    private Integer privateAreaId;
+
+    /**
+     * 账号id
+     */
+    @Column(name = "admin_id")
+    private Integer adminId;
+
+    /**
+     * 创建时间
+     */
+    @Column(name = "create_time")
+    private Date createTime;
+
+}

Some files were not shown because too many files changed in this diff