Quellcode durchsuchen

农科院基础搭建

wwh vor 1 Jahr
Commit
71daea91be
100 geänderte Dateien mit 5748 neuen und 0 gelöschten Zeilen
  1. 158 0
      huimv.nongke.secure/huimv.nongke.secure/pom.xml
  2. 21 0
      huimv.nongke.secure/huimv.nongke.secure/src/main/java/com/huimv/secure/SecureAppllication.java
  3. 34 0
      huimv.nongke.secure/huimv.nongke.secure/src/main/java/com/huimv/secure/common/exception/ExceptionEnum.java
  4. 6 0
      huimv.nongke.secure/huimv.nongke.secure/src/main/java/com/huimv/secure/common/exception/MExceptionEnum.java
  5. 20 0
      huimv.nongke.secure/huimv.nongke.secure/src/main/java/com/huimv/secure/common/exception/MiException.java
  6. 20 0
      huimv.nongke.secure/huimv.nongke.secure/src/main/java/com/huimv/secure/common/token/TokenConstant.java
  7. 186 0
      huimv.nongke.secure/huimv.nongke.secure/src/main/java/com/huimv/secure/common/token/TokenSign.java
  8. 154 0
      huimv.nongke.secure/huimv.nongke.secure/src/main/java/com/huimv/secure/common/utils/AirQualityIndexUtil.java
  9. 93 0
      huimv.nongke.secure/huimv.nongke.secure/src/main/java/com/huimv/secure/common/utils/ChineseCharToEnUtil.java
  10. 87 0
      huimv.nongke.secure/huimv.nongke.secure/src/main/java/com/huimv/secure/common/utils/ConstUtil.java
  11. 156 0
      huimv.nongke.secure/huimv.nongke.secure/src/main/java/com/huimv/secure/common/utils/DataUill.java
  12. 27 0
      huimv.nongke.secure/huimv.nongke.secure/src/main/java/com/huimv/secure/common/utils/GeneratorCodeConfig.java
  13. 27 0
      huimv.nongke.secure/huimv.nongke.secure/src/main/java/com/huimv/secure/common/utils/GetMD5Str.java
  14. 56 0
      huimv.nongke.secure/huimv.nongke.secure/src/main/java/com/huimv/secure/common/utils/IDCardValidator.java
  15. 27 0
      huimv.nongke.secure/huimv.nongke.secure/src/main/java/com/huimv/secure/common/utils/IpTools.java
  16. 39 0
      huimv.nongke.secure/huimv.nongke.secure/src/main/java/com/huimv/secure/common/utils/NumberUtils.java
  17. 89 0
      huimv.nongke.secure/huimv.nongke.secure/src/main/java/com/huimv/secure/common/utils/OpenapiUtil.java
  18. 79 0
      huimv.nongke.secure/huimv.nongke.secure/src/main/java/com/huimv/secure/common/utils/PageFactory.java
  19. 8 0
      huimv.nongke.secure/huimv.nongke.secure/src/main/java/com/huimv/secure/common/utils/PageResult.java
  20. 344 0
      huimv.nongke.secure/huimv.nongke.secure/src/main/java/com/huimv/secure/common/utils/PdfUtil.java
  21. 29 0
      huimv.nongke.secure/huimv.nongke.secure/src/main/java/com/huimv/secure/common/utils/PercentUtil.java
  22. 25 0
      huimv.nongke.secure/huimv.nongke.secure/src/main/java/com/huimv/secure/common/utils/PhoneNumberValidator.java
  23. 38 0
      huimv.nongke.secure/huimv.nongke.secure/src/main/java/com/huimv/secure/common/utils/PlatformException.java
  24. 331 0
      huimv.nongke.secure/huimv.nongke.secure/src/main/java/com/huimv/secure/common/utils/Print.java
  25. 97 0
      huimv.nongke.secure/huimv.nongke.secure/src/main/java/com/huimv/secure/common/utils/Result.java
  26. 41 0
      huimv.nongke.secure/huimv.nongke.secure/src/main/java/com/huimv/secure/common/utils/ResultCode.java
  27. 71 0
      huimv.nongke.secure/huimv.nongke.secure/src/main/java/com/huimv/secure/common/utils/ResultUtil.java
  28. 116 0
      huimv.nongke.secure/huimv.nongke.secure/src/main/java/com/huimv/secure/common/utils/SendSMS.java
  29. 191 0
      huimv.nongke.secure/huimv.nongke.secure/src/main/java/com/huimv/secure/common/utils/SnowflakeSequence.java
  30. 44 0
      huimv.nongke.secure/huimv.nongke.secure/src/main/java/com/huimv/secure/common/utils/StringUtilsWork.java
  31. 184 0
      huimv.nongke.secure/huimv.nongke.secure/src/main/java/com/huimv/secure/common/utils/UploadImage.java
  32. 122 0
      huimv.nongke.secure/huimv.nongke.secure/src/main/java/com/huimv/secure/common/utils/VerifyUtil.java
  33. 16 0
      huimv.nongke.secure/huimv.nongke.secure/src/main/java/com/huimv/secure/config/ApiPrefixAutoConfiguration.java
  34. 34 0
      huimv.nongke.secure/huimv.nongke.secure/src/main/java/com/huimv/secure/config/DistributedLockManager.java
  35. 76 0
      huimv.nongke.secure/huimv.nongke.secure/src/main/java/com/huimv/secure/config/InterceptorConfig.java
  36. 82 0
      huimv.nongke.secure/huimv.nongke.secure/src/main/java/com/huimv/secure/config/JWTInterceptor.java
  37. 26 0
      huimv.nongke.secure/huimv.nongke.secure/src/main/java/com/huimv/secure/config/MybatisPlusConfig.java
  38. 20 0
      huimv.nongke.secure/huimv.nongke.secure/src/main/java/com/huimv/secure/controller/AgeRangesController.java
  39. 20 0
      huimv.nongke.secure/huimv.nongke.secure/src/main/java/com/huimv/secure/controller/BaseDeviceController.java
  40. 20 0
      huimv.nongke.secure/huimv.nongke.secure/src/main/java/com/huimv/secure/controller/BaseFarmController.java
  41. 20 0
      huimv.nongke.secure/huimv.nongke.secure/src/main/java/com/huimv/secure/controller/BaseLocationController.java
  42. 20 0
      huimv.nongke.secure/huimv.nongke.secure/src/main/java/com/huimv/secure/controller/BaseProcessController.java
  43. 20 0
      huimv.nongke.secure/huimv.nongke.secure/src/main/java/com/huimv/secure/controller/BillAccessDoorController.java
  44. 20 0
      huimv.nongke.secure/huimv.nongke.secure/src/main/java/com/huimv/secure/controller/BillCleanController.java
  45. 20 0
      huimv.nongke.secure/huimv.nongke.secure/src/main/java/com/huimv/secure/controller/BillGateController.java
  46. 20 0
      huimv.nongke.secure/huimv.nongke.secure/src/main/java/com/huimv/secure/controller/BillGoodsInventoryController.java
  47. 20 0
      huimv.nongke.secure/huimv.nongke.secure/src/main/java/com/huimv/secure/controller/BillLuggageController.java
  48. 20 0
      huimv.nongke.secure/huimv.nongke.secure/src/main/java/com/huimv/secure/controller/BillPcrController.java
  49. 20 0
      huimv.nongke.secure/huimv.nongke.secure/src/main/java/com/huimv/secure/controller/BillPersonnelAdmissionController.java
  50. 20 0
      huimv.nongke.secure/huimv.nongke.secure/src/main/java/com/huimv/secure/controller/ConfigurationController.java
  51. 20 0
      huimv.nongke.secure/huimv.nongke.secure/src/main/java/com/huimv/secure/controller/DeviceListController.java
  52. 20 0
      huimv.nongke.secure/huimv.nongke.secure/src/main/java/com/huimv/secure/controller/ExistController.java
  53. 20 0
      huimv.nongke.secure/huimv.nongke.secure/src/main/java/com/huimv/secure/controller/PeopleListController.java
  54. 20 0
      huimv.nongke.secure/huimv.nongke.secure/src/main/java/com/huimv/secure/controller/SysAccountGroupController.java
  55. 20 0
      huimv.nongke.secure/huimv.nongke.secure/src/main/java/com/huimv/secure/controller/SysAccountMultilevelController.java
  56. 20 0
      huimv.nongke.secure/huimv.nongke.secure/src/main/java/com/huimv/secure/controller/SysGroupController.java
  57. 20 0
      huimv.nongke.secure/huimv.nongke.secure/src/main/java/com/huimv/secure/controller/SysGroupMenuController.java
  58. 20 0
      huimv.nongke.secure/huimv.nongke.secure/src/main/java/com/huimv/secure/controller/SysMenuController.java
  59. 20 0
      huimv.nongke.secure/huimv.nongke.secure/src/main/java/com/huimv/secure/controller/SysUserController.java
  60. 30 0
      huimv.nongke.secure/huimv.nongke.secure/src/main/java/com/huimv/secure/entity/AgeRanges.java
  61. 74 0
      huimv.nongke.secure/huimv.nongke.secure/src/main/java/com/huimv/secure/entity/BaseDevice.java
  62. 45 0
      huimv.nongke.secure/huimv.nongke.secure/src/main/java/com/huimv/secure/entity/BaseFarm.java
  63. 67 0
      huimv.nongke.secure/huimv.nongke.secure/src/main/java/com/huimv/secure/entity/BaseLocation.java
  64. 96 0
      huimv.nongke.secure/huimv.nongke.secure/src/main/java/com/huimv/secure/entity/BaseProcess.java
  65. 66 0
      huimv.nongke.secure/huimv.nongke.secure/src/main/java/com/huimv/secure/entity/BillAccessDoor.java
  66. 131 0
      huimv.nongke.secure/huimv.nongke.secure/src/main/java/com/huimv/secure/entity/BillClean.java
  67. 71 0
      huimv.nongke.secure/huimv.nongke.secure/src/main/java/com/huimv/secure/entity/BillGate.java
  68. 76 0
      huimv.nongke.secure/huimv.nongke.secure/src/main/java/com/huimv/secure/entity/BillGoodsInventory.java
  69. 65 0
      huimv.nongke.secure/huimv.nongke.secure/src/main/java/com/huimv/secure/entity/BillLuggage.java
  70. 134 0
      huimv.nongke.secure/huimv.nongke.secure/src/main/java/com/huimv/secure/entity/BillPcr.java
  71. 144 0
      huimv.nongke.secure/huimv.nongke.secure/src/main/java/com/huimv/secure/entity/BillPersonnelAdmission.java
  72. 48 0
      huimv.nongke.secure/huimv.nongke.secure/src/main/java/com/huimv/secure/entity/Configuration.java
  73. 62 0
      huimv.nongke.secure/huimv.nongke.secure/src/main/java/com/huimv/secure/entity/DeviceList.java
  74. 38 0
      huimv.nongke.secure/huimv.nongke.secure/src/main/java/com/huimv/secure/entity/Exist.java
  75. 69 0
      huimv.nongke.secure/huimv.nongke.secure/src/main/java/com/huimv/secure/entity/PeopleList.java
  76. 35 0
      huimv.nongke.secure/huimv.nongke.secure/src/main/java/com/huimv/secure/entity/SysAccountGroup.java
  77. 135 0
      huimv.nongke.secure/huimv.nongke.secure/src/main/java/com/huimv/secure/entity/SysAccountMultilevel.java
  78. 37 0
      huimv.nongke.secure/huimv.nongke.secure/src/main/java/com/huimv/secure/entity/SysGroup.java
  79. 37 0
      huimv.nongke.secure/huimv.nongke.secure/src/main/java/com/huimv/secure/entity/SysGroupMenu.java
  80. 47 0
      huimv.nongke.secure/huimv.nongke.secure/src/main/java/com/huimv/secure/entity/SysMenu.java
  81. 178 0
      huimv.nongke.secure/huimv.nongke.secure/src/main/java/com/huimv/secure/entity/SysUser.java
  82. 11 0
      huimv.nongke.secure/huimv.nongke.secure/src/main/java/com/huimv/secure/entity/dto/PcrDto.java
  83. 22 0
      huimv.nongke.secure/huimv.nongke.secure/src/main/java/com/huimv/secure/entity/dto/PrintAdmissionDto.java
  84. 22 0
      huimv.nongke.secure/huimv.nongke.secure/src/main/java/com/huimv/secure/entity/dto/PrintIsolateDto.java
  85. 16 0
      huimv.nongke.secure/huimv.nongke.secure/src/main/java/com/huimv/secure/entity/dto/PrintLuggageDto.java
  86. 29 0
      huimv.nongke.secure/huimv.nongke.secure/src/main/java/com/huimv/secure/entity/dto/UserAccountDto.java
  87. 28 0
      huimv.nongke.secure/huimv.nongke.secure/src/main/java/com/huimv/secure/entity/dto/UserAndAccountGroup.java
  88. 10 0
      huimv.nongke.secure/huimv.nongke.secure/src/main/java/com/huimv/secure/entity/dto/WeCahtVo.java
  89. 16 0
      huimv.nongke.secure/huimv.nongke.secure/src/main/java/com/huimv/secure/entity/pojo/UserPagePojo.java
  90. 43 0
      huimv.nongke.secure/huimv.nongke.secure/src/main/java/com/huimv/secure/entity/vo/AccountVo.java
  91. 48 0
      huimv.nongke.secure/huimv.nongke.secure/src/main/java/com/huimv/secure/entity/vo/BaseProcessByLocationVo.java
  92. 12 0
      huimv.nongke.secure/huimv.nongke.secure/src/main/java/com/huimv/secure/entity/vo/BaseProcessVo.java
  93. 13 0
      huimv.nongke.secure/huimv.nongke.secure/src/main/java/com/huimv/secure/entity/vo/BillAdmissionAndGoods.java
  94. 18 0
      huimv.nongke.secure/huimv.nongke.secure/src/main/java/com/huimv/secure/entity/vo/BillAdmissionVo.java
  95. 25 0
      huimv.nongke.secure/huimv.nongke.secure/src/main/java/com/huimv/secure/entity/vo/BillGoodsInventoryVo.java
  96. 30 0
      huimv.nongke.secure/huimv.nongke.secure/src/main/java/com/huimv/secure/entity/vo/CleanAndDryVo.java
  97. 99 0
      huimv.nongke.secure/huimv.nongke.secure/src/main/java/com/huimv/secure/entity/vo/CleanAndDryVo2.java
  98. 15 0
      huimv.nongke.secure/huimv.nongke.secure/src/main/java/com/huimv/secure/entity/vo/CleanVo.java
  99. 12 0
      huimv.nongke.secure/huimv.nongke.secure/src/main/java/com/huimv/secure/entity/vo/DeviceVo.java
  100. 0 0
      huimv.nongke.secure/huimv.nongke.secure/src/main/java/com/huimv/secure/entity/vo/DoorVo.java

+ 158 - 0
huimv.nongke.secure/huimv.nongke.secure/pom.xml

@@ -0,0 +1,158 @@
+<?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>org.springframework.boot</groupId>
+        <artifactId>spring-boot-starter-parent</artifactId>
+        <version>2.4.1</version>
+        <relativePath/> <!-- lookup parent from repository -->
+    </parent>
+
+    <groupId>com.huimv.nongke</groupId>
+    <artifactId>huimv.nongke.secure</artifactId>
+    <name>huimv.nongke.secure</name>
+    <version>1.0-SNAPSHOT</version>
+
+    <description>Demo project for Spring Boot</description>
+    <properties>
+        <java.version>8</java.version>
+    </properties>
+
+    <dependencies>
+        <dependency>
+            <groupId>org.springframework.boot</groupId>
+            <artifactId>spring-boot-starter-web</artifactId>
+        </dependency>
+
+        <dependency>
+            <groupId>org.projectlombok</groupId>
+            <artifactId>lombok</artifactId>
+            <optional>true</optional>
+        </dependency>
+        <dependency>
+            <groupId>org.springframework.boot</groupId>
+            <artifactId>spring-boot-starter-test</artifactId>
+            <scope>test</scope>
+        </dependency>
+
+        <dependency>
+            <groupId>mysql</groupId>
+            <artifactId>mysql-connector-java</artifactId>
+        </dependency>
+
+
+
+        <dependency>
+            <groupId>com.alibaba</groupId>
+            <artifactId>druid-spring-boot-starter</artifactId>
+            <version>1.2.5</version>
+        </dependency>
+        <dependency>
+            <groupId>com.auth0</groupId>
+            <artifactId>java-jwt</artifactId>
+            <version>3.3.0</version>
+        </dependency>
+        <dependency>
+            <groupId>com.belerweb</groupId>
+            <artifactId>pinyin4j</artifactId>
+            <version>2.5.1</version>
+        </dependency>
+        <dependency>
+            <groupId>io.jsonwebtoken</groupId>
+            <artifactId>jjwt</artifactId>
+            <version>0.9.1</version>
+        </dependency>
+        <dependency>
+            <groupId>net.sf.json-lib</groupId>
+            <artifactId>json-lib</artifactId>
+            <version>2.2.3</version>
+            <classifier>jdk15</classifier>
+        </dependency>
+        <dependency>
+            <groupId>com.alibaba</groupId>
+            <artifactId>fastjson</artifactId>
+            <version>1.2.28</version>
+        </dependency>
+        <dependency>
+            <groupId>cn.dustlight.captcha</groupId>
+            <artifactId>redis-store</artifactId>
+            <version>0.0.6</version>
+        </dependency>
+        <dependency>
+            <groupId>cn.dustlight.captcha</groupId>
+            <artifactId>captcha-core</artifactId>
+            <version>0.0.6</version>
+        </dependency>
+        <dependency>
+            <groupId>cn.hutool</groupId>
+            <artifactId>hutool-all</artifactId>
+            <version>5.7.11</version>
+        </dependency>
+        <dependency>
+            <groupId>com.baomidou</groupId>
+            <artifactId>mybatis-plus-boot-starter</artifactId>
+            <version>3.4.2</version>
+        </dependency>
+        <dependency>
+            <groupId>com.baomidou</groupId>
+            <artifactId>mybatis-plus-extension</artifactId>
+            <version>3.4.2</version>
+        </dependency>
+        <dependency>
+            <groupId>com.baomidou</groupId>
+            <artifactId>mybatis-plus-generator</artifactId>
+            <version>3.2.0</version>
+        </dependency>
+
+
+        <dependency>
+            <groupId>org.apache.httpcomponents</groupId>
+            <artifactId>httpclient</artifactId>
+            <version>4.5.14</version>
+        </dependency>
+        <dependency>
+            <groupId>com.jcraft</groupId>
+            <artifactId>jsch</artifactId>
+            <version>0.1.54</version>
+        </dependency>
+        <dependency>
+            <groupId>org.jxls</groupId>
+            <artifactId>jxls</artifactId>
+            <version>2.6.0</version>
+        </dependency>
+        <dependency>
+            <groupId>org.jxls</groupId>
+            <artifactId>jxls-poi</artifactId>
+            <version>1.1.0</version>
+        </dependency>
+
+
+
+
+    </dependencies>
+
+    <build>
+        <plugins>
+            <plugin>
+                <groupId>org.springframework.boot</groupId>
+                <artifactId>spring-boot-maven-plugin</artifactId>
+                <!--                <configuration>-->
+                <!--                    <includeSystemScope>true</includeSystemScope>-->
+                <!--                    <skip>true</skip>-->
+                <!--                    <mainClass>HuimvAdminApplication</mainClass>-->
+                <!--                </configuration>-->
+            </plugin>
+            <!--在这里修改版本-->
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-resources-plugin</artifactId>
+                <version>2.4.3</version>
+            </plugin>
+            <!---->
+        </plugins>
+
+    </build>
+</project>

+ 21 - 0
huimv.nongke.secure/huimv.nongke.secure/src/main/java/com/huimv/secure/SecureAppllication.java

@@ -0,0 +1,21 @@
+package com.huimv.secure;
+
+import org.apache.catalina.Context;
+import org.apache.catalina.connector.Connector;
+import org.apache.tomcat.util.descriptor.web.SecurityCollection;
+import org.apache.tomcat.util.descriptor.web.SecurityConstraint;
+import org.mybatis.spring.annotation.MapperScan;
+import org.springframework.boot.SpringApplication;
+import org.springframework.boot.autoconfigure.SpringBootApplication;
+import org.springframework.boot.web.embedded.tomcat.TomcatServletWebServerFactory;
+import org.springframework.context.annotation.Bean;
+
+@SpringBootApplication
+@MapperScan("com.huimv.secure.mapper")
+public class SecureAppllication {
+
+    public static void main(String[] args) {
+        SpringApplication.run(SecureAppllication.class, args);
+    }
+
+}

+ 34 - 0
huimv.nongke.secure/huimv.nongke.secure/src/main/java/com/huimv/secure/common/exception/ExceptionEnum.java

@@ -0,0 +1,34 @@
+package com.huimv.secure.common.exception;
+
+public enum ExceptionEnum implements MExceptionEnum{
+   //自定义的状态码
+   TOKEN_NULL("401","token为空"),
+   TOKEN_OVERDUE("403","token过期"),
+   VERIFCATION_FAID("410","验证码获取失败"),
+   VERIFCATION_OVERDUE("411","验证码获取失败");
+
+
+   //错误码
+   public String code;
+   //提示信息
+   public String message;
+
+   //构造函数
+   ExceptionEnum(String code,String message){
+      this.code = code;
+      this.message = message;
+   }
+
+   //获取状态码
+   @Override
+   public String getCode(){
+      return code;
+   }
+   
+   //获取提示信息
+   @Override
+   public String getMessage(){
+      return message;
+   }
+ 
+}

+ 6 - 0
huimv.nongke.secure/huimv.nongke.secure/src/main/java/com/huimv/secure/common/exception/MExceptionEnum.java

@@ -0,0 +1,6 @@
+package com.huimv.secure.common.exception;
+
+public interface MExceptionEnum{
+    public String getCode();
+    public String getMessage();
+}

+ 20 - 0
huimv.nongke.secure/huimv.nongke.secure/src/main/java/com/huimv/secure/common/exception/MiException.java

@@ -0,0 +1,20 @@
+package com.huimv.secure.common.exception;
+
+
+public class MiException extends RuntimeException{
+    private ExceptionEnum exceptionEnum;
+
+    public MiException(ExceptionEnum exceptionEnum){
+        this.exceptionEnum = exceptionEnum;
+    }
+
+    public ExceptionEnum getExceptionEnum(){
+        return exceptionEnum;
+    }
+
+    //用来输出异常信息和状态码
+    public void printException(MiException e){
+        ExceptionEnum exceptionEnum = e.getExceptionEnum();
+        System.out.println("异常代码:" + exceptionEnum.getCode() + ",异常信息:" + exceptionEnum.getMessage());
+    }
+}

+ 20 - 0
huimv.nongke.secure/huimv.nongke.secure/src/main/java/com/huimv/secure/common/token/TokenConstant.java

@@ -0,0 +1,20 @@
+package com.huimv.secure.common.token;
+ 
+import java.util.HashMap;
+import java.util.Map;
+
+public class TokenConstant {
+ 
+    private static Map<String,String> map=new HashMap();
+ 
+ 
+    public static String getToken(){
+            return map.get("token");
+    }
+ 
+    public static void updateTokenMap(String token){
+        map.put("token",token);
+    }
+ 
+ 
+}

+ 186 - 0
huimv.nongke.secure/huimv.nongke.secure/src/main/java/com/huimv/secure/common/token/TokenSign.java

@@ -0,0 +1,186 @@
+package com.huimv.secure.common.token;
+
+import cn.hutool.core.util.ObjectUtil;
+import io.jsonwebtoken.*;
+import org.apache.commons.lang.StringUtils;
+
+import javax.servlet.http.HttpServletRequest;
+import java.util.Date;
+
+public class TokenSign {
+
+    /**
+     * 过期时间7天
+     */
+    private static final long EXPIRE_TIME = 7 * 24 * 60 * 60 * 1000;
+
+    /**
+     * 私钥,使用它生成token,最好进行下加密
+     */
+    private static final String TOKEN_SECRET = "Token";
+    private static final String APP_SECRET = "ukc8BDbRigUDaY6pZFfWus2jZWLPHO";
+    private static final int REFRESH_TIME = 300;
+
+
+    /**
+     * 产生token
+     *
+     * @return
+     */
+    public static String sign(String userName, Integer id, String farmIds, String workId,Integer userType) {
+
+        String JwtToken = Jwts.builder()
+                //头部信息
+                .setHeaderParam("typ", "JWT")
+                .setHeaderParam("alg", "HS256")
+                .setSubject("hm-user")
+                .setIssuedAt(new Date())
+                //过期时间
+                .setExpiration(new Date(System.currentTimeMillis() + EXPIRE_TIME))
+                //token主体部分,存储用户信息
+                .claim("userName", userName)
+                .claim("id", id)
+                .claim("type", userType)
+                .claim("farmIds", farmIds)
+                .claim("workId", workId)
+                .signWith(SignatureAlgorithm.HS256, APP_SECRET)
+                .compact();
+
+        return JwtToken;
+    }
+
+
+    /**
+     * token校验是否正确
+     *
+     * @param token
+     * @return
+     */
+
+    public static boolean verify(String token) {
+
+        if (StringUtils.isBlank(token)) {
+            return false;
+        }
+        try {
+            Jwts.parser().setSigningKey(APP_SECRET).parseClaimsJws(token);
+        } catch (Exception e) {
+            e.printStackTrace();
+            return false;
+        }
+        return true;
+
+    }
+
+
+    /**
+     * 根据token获取会员id
+     *
+     * @param request
+     * @return
+     */
+    public static Integer getMemberIdByJwtToken(HttpServletRequest request) {
+        String jwtToken = request.getHeader("accessToken");
+        if (StringUtils.isBlank(jwtToken)) {
+            return null;
+        }
+        Claims claims = getClaims(jwtToken);
+        if (ObjectUtil.isEmpty(claims) || ObjectUtil.isEmpty(claims.get("id"))) {
+
+        }
+        return (Integer) claims.get("id");
+    }
+    /*根据token获取工作地点*/
+    public static String getWorkIdByJwtToken(HttpServletRequest request) {
+        String jwtToken = request.getHeader("accessToken");
+        if (StringUtils.isBlank(jwtToken)) {
+            return null;
+        }
+        Claims claims = getClaims(jwtToken);
+        if(ObjectUtil.isEmpty(claims)||ObjectUtil.isEmpty(claims.get("workId"))){
+
+        }
+        return (String) claims.get("workId");
+    }
+
+    /**
+     * 根据token获取用户类型
+     *
+     * @param request
+     * @return
+     */
+    public static Integer getUserTypeByJwtToken(HttpServletRequest request) {
+        String jwtToken = request.getHeader("accessToken");
+        if (StringUtils.isBlank(jwtToken)) {
+            return null;
+        }
+        Claims claims = getClaims(jwtToken);
+        if (ObjectUtil.isEmpty(claims) || ObjectUtil.isEmpty(claims.get("type"))) {
+
+        }
+        return (Integer) claims.get("type");
+    }
+
+    public static String getFarmIds(HttpServletRequest request) {
+        String jwtToken = request.getHeader("accessToken");
+        if (StringUtils.isBlank(jwtToken)) {
+            return null;
+        }
+        Claims claims = getClaims(jwtToken);
+        return (String) claims.get("farmIds");
+    }
+
+    public static String getUserNameByJwtToken(HttpServletRequest request) {
+        String jwtToken = request.getHeader("accessToken");
+        if (StringUtils.isBlank(jwtToken)) {
+            return null;
+        }
+        Claims claims = getClaims(jwtToken);
+        return (String) claims.get("userName");
+    }
+
+    /**
+     * 获取claims对象
+     *
+     * @param jwtToken
+     * @return
+     */
+    public static Claims getClaims(String jwtToken) {
+        try {
+            Jws<Claims> claimsJws = Jwts.parser().setSigningKey(APP_SECRET).parseClaimsJws(jwtToken);
+            return claimsJws.getBody();
+        } catch (Exception e) {
+            return null;
+        }
+
+
+    }
+
+    /**
+     * 是否过期
+     *
+     * @param claims
+     * @return -1:有效,0:有效,1:过期,2:被篡改
+     */
+    public static int verifyToken(Claims claims) {
+        if (claims == null) {
+            return 1;
+        }
+        try {
+            claims.getExpiration()
+                    .before(new Date());
+            // 需要自动刷新TOKEN
+            if ((claims.getExpiration().getTime() - System.currentTimeMillis()) < REFRESH_TIME * 1000) {
+                return -1;
+            } else {
+                return 0;
+            }
+        } catch (ExpiredJwtException ex) {
+            return 1;
+        } catch (Exception e) {
+            return 2;
+        }
+    }
+
+
+}

+ 154 - 0
huimv.nongke.secure/huimv.nongke.secure/src/main/java/com/huimv/secure/common/utils/AirQualityIndexUtil.java

@@ -0,0 +1,154 @@
+package com.huimv.secure.common.utils;
+
+
+import net.sf.json.JSONObject;
+
+import java.io.*;
+import java.net.HttpURLConnection;
+import java.net.URL;
+import java.net.URLEncoder;
+import java.nio.charset.StandardCharsets;
+import java.util.HashMap;
+import java.util.Map;
+
+/**
+ * @Author Anchor
+ * @Date 2021/7/16 10:30
+ * @Version 1.0.1
+ */
+public class AirQualityIndexUtil {
+
+
+
+    /**
+     * 天气情况查询接口地址
+     */
+    public static String API_URL = "http://apis.juhe.cn/simpleWeather/query";
+    /**
+     * 请求key  ---这个key是杨迪自己注册的.免费版.....希望公司后面买正式版
+     */
+    public static String API_KEY = "b9876f1d1eaec3ae987fcd54646060f7";
+
+    /**
+     * 根据城市名查询天气情况
+     *
+     * @param cityName
+     */
+    public  static   String  queryWeather(String cityName) {
+        //组合参数
+        Map<String, Object> params = new HashMap<>();
+        params.put("city", cityName);
+        params.put("key", API_KEY);
+        String queryParams = urlEncode(params);
+        String response = doGet(API_URL, queryParams);
+        System.out.println(response);
+        try {
+            JSONObject jsonObject = JSONObject.fromObject(response);
+            int errorCode = jsonObject.getInt("error_code");
+            if (errorCode == 0) {
+                System.out.println("调用接口成功");
+                JSONObject result = jsonObject.getJSONObject("result");
+                JSONObject realtime = result.getJSONObject("realtime");
+               /* System.out.printf("城市:%s%n", result.getString("city"));
+                System.out.printf("天气:%s%n", realtime.getString("info"));
+                System.out.printf("温度:%s%n", realtime.getString("temperature"));
+                System.out.printf("湿度:%s%n", realtime.getString("humidity"));
+                System.out.printf("风向:%s%n", realtime.getString("direct"));
+                System.out.printf("风力:%s%n", realtime.getString("power"));
+                System.out.printf("空气质量:%s%n", realtime.getString("aqi"));
+                */
+                return    realtime.getString("aqi");
+            } else {
+                System.out.println("调用接口失败:" + jsonObject.getString("reason"));
+            }
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+        return   null;
+    }
+
+    /**
+     * get方式的http请求
+     *
+     * @param httpUrl 请求地址
+     * @return 返回结果
+     */
+    public static String doGet(String httpUrl, String queryParams) {
+        HttpURLConnection connection = null;
+        InputStream inputStream = null;
+        BufferedReader bufferedReader = null;
+        //返回结果字符串
+        String result = null;
+        try {
+            //创建远程url连接对象
+            URL url = new URL(new StringBuffer(httpUrl).append("?").append(queryParams).toString());
+            //通过远程url连接对象打开一个连接,强转成httpURLConnection类
+            connection = (HttpURLConnection) url.openConnection();
+            //设置连接方式:get
+            connection.setRequestMethod("GET");
+            //设置连接主机服务器的超时时间:5000毫秒
+            connection.setConnectTimeout(5000);
+            //设置读取远程返回的数据时间:6000毫秒
+            connection.setReadTimeout(6000);
+            //发送请求
+            connection.connect();
+            //通过connection连接,获取输入流
+            if (connection.getResponseCode() == 200) {
+                inputStream = connection.getInputStream();
+                //封装输入流,并指定字符集
+                bufferedReader = new BufferedReader(new InputStreamReader(inputStream, StandardCharsets.UTF_8));
+                //存放数据
+                StringBuilder sbf = new StringBuilder();
+                String temp;
+                while ((temp = bufferedReader.readLine()) != null) {
+                    sbf.append(temp);
+                    sbf.append(System.getProperty("line.separator"));
+                }
+                result = sbf.toString();
+            }
+        } catch (IOException e) {
+            e.printStackTrace();
+        } finally {
+            //关闭资源
+            if (null != bufferedReader) {
+                try {
+                    bufferedReader.close();
+                } catch (IOException e) {
+                    e.printStackTrace();
+                }
+            }
+            if (null != inputStream) {
+                try {
+                    inputStream.close();
+                } catch (IOException e) {
+                    e.printStackTrace();
+                }
+            }
+            if (connection != null) {
+                //关闭远程连接
+                connection.disconnect();
+            }
+        }
+        return result;
+    }
+
+    /**
+     * 将map型转为请求参数型
+     *
+     * @param data
+     * @return
+     */
+    public static String urlEncode(Map<String, ?> data) {
+        StringBuilder sb = new StringBuilder();
+        for (Map.Entry<String, ?> i : data.entrySet()) {
+            try {
+                sb.append(i.getKey()).append("=").append(URLEncoder.encode(i.getValue() + "", "UTF-8")).append("&");
+            } catch (UnsupportedEncodingException e) {
+                e.printStackTrace();
+            }
+        }
+        String result = sb.toString();
+        result = result.substring(0, result.lastIndexOf("&"));
+        return result;
+    }
+}

+ 93 - 0
huimv.nongke.secure/huimv.nongke.secure/src/main/java/com/huimv/secure/common/utils/ChineseCharToEnUtil.java

@@ -0,0 +1,93 @@
+package com.huimv.secure.common.utils;
+
+import net.sourceforge.pinyin4j.PinyinHelper;
+import net.sourceforge.pinyin4j.format.HanyuPinyinCaseType;
+import net.sourceforge.pinyin4j.format.HanyuPinyinOutputFormat;
+import net.sourceforge.pinyin4j.format.HanyuPinyinToneType;
+import net.sourceforge.pinyin4j.format.HanyuPinyinVCharType;
+import net.sourceforge.pinyin4j.format.exception.BadHanyuPinyinOutputFormatCombination;
+
+public class ChineseCharToEnUtil {
+    /**
+     * 将字符串中的中文转化为拼音,其他字符不变
+     *
+     * @param inputString
+     * @return
+     */
+    public static String getPingYin(String inputString) {
+        HanyuPinyinOutputFormat format = new HanyuPinyinOutputFormat();
+        format.setCaseType(HanyuPinyinCaseType.LOWERCASE);
+        format.setToneType(HanyuPinyinToneType.WITHOUT_TONE);
+        format.setVCharType(HanyuPinyinVCharType.WITH_V);
+ 
+        char[] input = inputString.trim().toCharArray();
+        String output = "";
+ 
+        try {
+            for (int i = 0; i < input.length; i++) {
+                if (Character.toString(input[i]).matches("[\\u4E00-\\u9FA5]+")) {
+                    String[] temp = PinyinHelper.toHanyuPinyinStringArray(input[i], format);
+                    output += temp[0];
+                } else
+                    output += Character.toString(input[i]);
+            }
+        } catch (BadHanyuPinyinOutputFormatCombination e) {
+            e.printStackTrace();
+        }
+        return output;
+    }
+    /**
+     * 获取汉字串拼音首字母,英文字符不变
+     * @param chinese 汉字串
+     * @return 汉语拼音首字母
+     */
+    public static String getFirstSpell(String chinese) {
+        StringBuffer pybf = new StringBuffer();
+        char[] arr = chinese.toCharArray();
+        HanyuPinyinOutputFormat defaultFormat = new HanyuPinyinOutputFormat();
+        defaultFormat.setCaseType(HanyuPinyinCaseType.LOWERCASE);
+        defaultFormat.setToneType(HanyuPinyinToneType.WITHOUT_TONE);
+        for (int i = 0; i < arr.length; i++) {
+            if (arr[i] > 128) {
+                try {
+                    String[] temp = PinyinHelper.toHanyuPinyinStringArray(arr[i], defaultFormat);
+                    if (temp != null && temp.length > 0){
+                        pybf.append(temp[0].charAt(0));
+                    }
+                } catch (BadHanyuPinyinOutputFormatCombination e) {
+                    e.printStackTrace();
+                }
+            } else {
+                pybf.append(arr[i]);
+            }
+        }
+        return pybf.toString().replaceAll("\\W", "").trim();
+    }
+    /**
+     * 获取汉字串拼音,英文字符不变
+     * @param chinese 汉字串
+     * @return 汉语拼音
+     */
+    public static String getFullSpell(String chinese) {
+        StringBuffer pybf = new StringBuffer();
+        char[] arr = chinese.toCharArray();
+        HanyuPinyinOutputFormat defaultFormat = new HanyuPinyinOutputFormat();
+        defaultFormat.setCaseType(HanyuPinyinCaseType.LOWERCASE);
+        defaultFormat.setToneType(HanyuPinyinToneType.WITHOUT_TONE);
+        for (int i = 0; i < arr.length; i++) {
+            if (arr[i] > 128) {
+                try {
+                    pybf.append(PinyinHelper.toHanyuPinyinStringArray(arr[i], defaultFormat)[0]);
+                } catch (BadHanyuPinyinOutputFormatCombination e) {
+                    e.printStackTrace();
+                }
+            } else {
+                pybf.append(arr[i]);
+            }
+        }
+        return pybf.toString();
+    }
+
+
+ 
+}

+ 87 - 0
huimv.nongke.secure/huimv.nongke.secure/src/main/java/com/huimv/secure/common/utils/ConstUtil.java

@@ -0,0 +1,87 @@
+package com.huimv.secure.common.utils;
+
+/**
+ * @Project : huimv-breed
+ * @Package : IntelliJ IDEA
+ * @Description : TODO
+ * @Version : 1.0
+ * @Author : ZhuoNing
+ * @Create : 2022/9/27
+ **/
+public class ConstUtil {
+   public static final String SECRET_KEY = "huimvkeji";
+   public final static Integer ERR_NOFOUND_CODE = 10004;
+   public final static String ERR_NOFOUND_INFO = "暂无数据.";
+
+   public final static Integer ERR_CHILDMENU_CODE = 10005;
+   public final static String ERR_CHILDMENU_INFO = "存在下级菜单,请先删除下级菜单.";
+
+   public final static Integer ERR_NO_EXIST_CODE = 10006;
+   public final static String ERR_NO_EXIST_INFO = "账号或密码错误.";
+
+   public final static Integer ERR_FARM_TIMEOUT_CODE = 10007;
+   public final static String ERR_FARM_TIMEOUT_INFO = "牧场已经中止服务.";
+
+   public final static Integer ERR_FARM_CANCEL_CODE = 10008;
+   public final static String ERR_FARM_CANCEL_INFO = "牧场已经注销.";
+
+   public final static Integer ERR_MYMENU_EMPTY_CODE = 10009;
+   public final static String ERR_MYMENU_EMPTY_INFO = "该用户无任何授权菜单.";
+
+   public final static Integer ERR_MYGROUP_EMPTY_CODE = 10010;
+   public final static String ERR_MYGROUP_EMPTY_INFO = "该用户无任何授权权限组.";
+
+   public final static Integer ERR_NO_DELETE_ADMIN_CODE = 10011;
+   public final static String ERR_NO_DELETE_ADMIN_INFO = "平台管理员账户不能删除.";
+
+   public final static Integer ERR_FARM_OVERDUE_CODE = 10012;
+   public final static String ERR_FARM_OVERDUE_INFO = "该牧场未在服务有效期";
+
+   public final static Integer ERR_SERVICE_SAME_CODE = 10013;
+   public final static String ERR_SERVICE_SAME_INFO = "当前服务周期时间不能和已经存在的服务时间重合.";
+
+   public final static Integer ERR_ACCOUNT_SAME_CODE = 10014;
+   public final static String ERR_ACCOUNT_SAME_INFO = "当前填写的账号名称已经存在,请重命名.";
+
+   public final static Integer ERR_RECORD_EMPTY_CODE = 10015;
+   public final static String ERR_RECORD_EMPTY_INFO = "暂无数据.";
+
+   public final static Integer ERR_SALE_LESS_CODE = 10016;
+   public final static String ERR_SALE_LESS_INFO = "本批次剩余数量不足,不满足销售数量.";
+
+   public final static Integer ERR_ELIMINATE_LESS_CODE = 10017;
+   public final static String ERR_ELIMINATE_LESS_INFO = "本批次剩余数量不足,不满足淘汰数量.";
+
+   public static final Integer ERR_EARTAG_NOT_EXIST_CODE = 10018;
+   public static final String ERR_EARTAG_NOT_EXIST_INFO = "耳标号不存在.";
+
+   public static final Integer ERR_NOT_BOAR_CODE = 10019;
+   public static final String ERR_NOT_BOAR_INFO = "你当前输入的是母猪耳标号,不能采精。只有公猪才能采精.";
+
+   public static final Integer ERR_SAME_GENDER_CODE = 10020;
+   public static final String ERR_SAME_GENDE_INFO = "配种对象为同一性别类型.";
+
+   public static final Integer ERR_GESTATION_CHECK_OBJECT_CODE = 10021;
+   public static final String ERR_GESTATION_CHECK_OBJECT_INFO = "妊检对象只能是雌性(母).";
+
+   public static final Integer ERR_BIRTH_OBJECT_CODE = 10022;
+   public static final String ERR_BIRTH_OBJECT_INFO = "分娩对象只能是雌性(母).";
+
+   public static final Integer ERR_ABLACTATION_CODE = 10023;
+   public static final String ERR_ABLACTATION_INFO = "断奶对象只能是雌性(母).";
+
+   public static final Integer ERR_INVALID_EARMARK_CODE = 10024;
+   public static final String ERR_INVALID_EARMARK_INFO = "该耳标所属对象已经销售或淘汰.";
+
+   public static final Integer ERR_SAME_EARMARK_CODE = 10025;
+   public static final String ERR_SAME_EARMARK_INFO = "该耳标号与其他记录存在耳标重名.";
+
+   public static final Integer ERR_SAME_BATCH_CODE = 10026;
+   public static final String ERR_SAME_BATCH_INFO = "该批次号与其他记录存在批次号重名.";
+
+   public static final Integer ERR_UPDATE_PASSWORD_CODE = 10027;
+   public static final String ERR_UPDATE_PASSWORD_INFO = "更新密码出错.";
+
+   public static final Integer ERR_PASSWORD_ERROR_CODE = 10028;
+   public static final String ERR_PASSWORD_ERROR_INFO = "密码输入错误.";
+}

+ 156 - 0
huimv.nongke.secure/huimv.nongke.secure/src/main/java/com/huimv/secure/common/utils/DataUill.java

@@ -0,0 +1,156 @@
+package com.huimv.secure.common.utils;
+  
+import java.text.SimpleDateFormat;
+import java.util.Calendar;
+import java.util.Date;
+
+public class DataUill {
+  
+
+  
+    // 获得当天0点时间
+    public static Date getTimesmorning() {
+        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() {
+        Calendar cal = Calendar.getInstance();
+        cal.setTimeInMillis(getTimesmorning().getTime()-3600*24*1000);
+        return cal.getTime();
+    }
+    // 获得当天近7天时间
+    public static Date getWeekFromNow() {
+        Calendar cal = Calendar.getInstance();
+        cal.setTimeInMillis( getTimesmorning().getTime()-3600*24*1000*7);
+        return cal.getTime();
+    }
+  
+    // 获得当天24点时间
+    public static Date getTimesnight() {
+        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 getTimesWeekmorning() {
+        Calendar cal = Calendar.getInstance();
+        cal.set(cal.get(Calendar.YEAR), cal.get(Calendar.MONDAY), cal.get(Calendar.DAY_OF_MONTH), 0, 0, 0);
+        cal.set(Calendar.DAY_OF_WEEK, Calendar.MONDAY);
+        return cal.getTime();
+    }
+  
+    // 获得本周日24点时间
+    public static Date getTimesWeeknight() {
+        Calendar cal = Calendar.getInstance();
+        cal.setTime(getTimesWeekmorning());
+        cal.add(Calendar.DAY_OF_WEEK, 7);
+        return cal.getTime();
+    }
+  
+    // 获得本月第一天0点时间
+    public static Date getTimesMonthmorning() {
+        Calendar cal = Calendar.getInstance();
+        cal.set(cal.get(Calendar.YEAR), cal.get(Calendar.MONDAY), 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 getTimesMonthnight() {
+        Calendar cal = Calendar.getInstance();
+        cal.set(cal.get(Calendar.YEAR), cal.get(Calendar.MONDAY), 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(getTimesMonthmorning());
+        cal.add(Calendar.MONTH, -1);
+        return cal.getTime();
+    }
+
+    public static Date getTwoLastMonthStartMorning() {
+        Calendar cal = Calendar.getInstance();
+        cal.setTime(getTimesMonthmorning());
+        cal.add(Calendar.MONTH, -2);
+        return cal.getTime();
+    }
+  
+    public static Date getCurrentQuarterStartTime() {
+        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 >= 1 && currentMonth <= 3)
+                c.set(Calendar.MONTH, 0);
+            else if (currentMonth >= 4 && currentMonth <= 6)
+                c.set(Calendar.MONTH, 3);
+            else if (currentMonth >= 7 && currentMonth <= 9)
+                c.set(Calendar.MONTH, 4);
+            else if (currentMonth >= 10 && 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
+     *
+     * @return
+     */
+    public static Date getCurrentQuarterEndTime() {
+        Calendar cal = Calendar.getInstance();
+        cal.setTime(getCurrentQuarterStartTime());
+        cal.add(Calendar.MONTH, 3);
+        return cal.getTime();
+    }
+  
+  
+    public static Date getCurrentYearStartTime() {
+        Calendar cal = Calendar.getInstance();
+        cal.set(cal.get(Calendar.YEAR), cal.get(Calendar.MONDAY), cal.get(Calendar.DAY_OF_MONTH), 0, 0, 0);
+        cal.set(Calendar.DAY_OF_MONTH, cal.getActualMinimum(Calendar.YEAR));
+        return cal.getTime();
+    }
+  
+    public static Date getCurrentYearEndTime() {
+        Calendar cal = Calendar.getInstance();
+        cal.setTime(getCurrentYearStartTime());
+        cal.add(Calendar.YEAR, 1);
+        return cal.getTime();
+    }
+  
+    public static Date getLastYearStartTime() {
+        Calendar cal = Calendar.getInstance();
+        cal.setTime(getCurrentYearStartTime());
+        cal.add(Calendar.YEAR, -1);
+        return cal.getTime();
+    }
+    public static Date getNextDay(Date date,Integer num) {
+        Calendar calendar = Calendar.getInstance();
+        calendar.setTime(date);
+        calendar.add(Calendar.DAY_OF_MONTH, +num);//+1今天的时间加一天
+        date = calendar.getTime();
+        return date;
+    }
+
+}

+ 27 - 0
huimv.nongke.secure/huimv.nongke.secure/src/main/java/com/huimv/secure/common/utils/GeneratorCodeConfig.java

@@ -0,0 +1,27 @@
+package com.huimv.secure.common.utils;
+
+import com.baomidou.mybatisplus.core.exceptions.MybatisPlusException;
+import com.baomidou.mybatisplus.core.toolkit.StringUtils;
+
+import java.util.Scanner;
+
+/**
+ * 自动生成mybatisplus的相关代码
+ */
+public class GeneratorCodeConfig {
+
+    public static String scanner(String tip) {
+        Scanner scanner = new Scanner(System.in);
+        StringBuilder help = new StringBuilder();
+        help.append("请输入" + tip + ":");
+        System.out.println(help.toString());
+        if (scanner.hasNext()) {
+            String ipt = scanner.next();
+            if (StringUtils.isNotBlank(ipt)) {
+                return ipt;
+            }
+        }
+        throw new MybatisPlusException("请输入正确的" + tip + "!");
+    }
+
+}

+ 27 - 0
huimv.nongke.secure/huimv.nongke.secure/src/main/java/com/huimv/secure/common/utils/GetMD5Str.java

@@ -0,0 +1,27 @@
+package com.huimv.secure.common.utils;
+
+import java.math.BigInteger;
+import java.security.MessageDigest;
+
+public class GetMD5Str {
+    /**
+     * 对字符串md5加密
+     *
+     * @param str
+     * @return
+     * @throws Exception
+     */
+    public static String getMD5Str(String str) throws Exception {
+        try {
+            // 生成一个MD5加密计算摘要
+            MessageDigest md = MessageDigest.getInstance("MD5");
+            // 计算md5函数
+            md.update(str.getBytes());
+            // digest()最后确定返回md5 hash值,返回值为8为字符串。因为md5 hash值是16位的hex值,实际上就是8位的字符
+            // BigInteger函数则将8位的字符串转换成16位hex值,用字符串来表示;得到字符串形式的hash值
+            return new BigInteger(1, md.digest()).toString(16);
+        } catch (Exception e) {
+            throw new Exception("MD5加密出现错误,"+e.toString());
+        }
+    }
+}

+ 56 - 0
huimv.nongke.secure/huimv.nongke.secure/src/main/java/com/huimv/secure/common/utils/IDCardValidator.java

@@ -0,0 +1,56 @@
+package com.huimv.secure.common.utils;
+
+import java.util.regex.Pattern;
+
+public class IDCardValidator {
+
+    public static boolean isValidIDCard(String idCardNumber) {
+        // 正则表达式用于验证身份证号
+        String pattern = "\\d{17}[0-9Xx]";
+
+        // 判断输入的身份证号是否符合规则
+        if (!Pattern.matches(pattern, idCardNumber)) {
+            return false;
+        }
+
+        // 获取身份证号的前17位
+        String idCardDigits = idCardNumber.substring(0, 17);
+
+        // 验证身份证号的前17位是否为数字
+        if (!isNumeric(idCardDigits)) {
+            return false;
+        }
+
+        // 验证身份证号的最后一位是否为合法校验位
+        return isValidCheckDigit(idCardNumber);
+    }
+
+    // 判断字符串是否为纯数字
+    private static boolean isNumeric(String str) {
+        return str.matches("\\d+");
+    }
+
+    // 验证身份证号的校验位是否合法
+    private static boolean isValidCheckDigit(String idCardNumber) {
+        String checkDigit = idCardNumber.substring(17);
+        String[] checkCodes = {"1", "0", "X", "9", "8", "7", "6", "5", "4", "3", "2"};
+        int sum = 0;
+        for (int i = 0; i < 17; i++) {
+            int coefficient = Integer.parseInt(idCardNumber.substring(i, i + 1));
+            int weight = (int) Math.pow(2, 17 - i) % 11;
+            sum += coefficient * weight;
+        }
+        return checkDigit.equalsIgnoreCase(checkCodes[sum % 11]);
+    }
+
+    public static void main(String[] args) {
+        String idCardNumber = "身份证号"; // 替换为要验证的身份证号
+        boolean isValid = isValidIDCard(idCardNumber);
+        if (isValid) {
+            System.out.println("身份证号正确!");
+        } else {
+            System.out.println("身份证号错误!");
+        }
+    }
+}
+

+ 27 - 0
huimv.nongke.secure/huimv.nongke.secure/src/main/java/com/huimv/secure/common/utils/IpTools.java

@@ -0,0 +1,27 @@
+package com.huimv.secure.common.utils;
+
+import org.springframework.stereotype.Component;
+
+import javax.servlet.http.HttpServletRequest;
+
+/**
+ * @author yejijie
+ * @created 2020年7月17日 上午11:24:20
+*/
+@Component
+public class IpTools {
+
+    public static String getRemoteHost(HttpServletRequest request){
+        String ip = request.getHeader("x-forwarded-for");
+        if(ip == null || ip.length() == 0 || "unknown".equalsIgnoreCase(ip)){
+            ip = request.getHeader("Proxy-Client-IP");
+        }
+        if(ip == null || ip.length() == 0 || "unknown".equalsIgnoreCase(ip)){
+            ip = request.getHeader("WL-Proxy-Client-IP");
+        }
+        if(ip == null || ip.length() == 0 || "unknown".equalsIgnoreCase(ip)){
+            ip = request.getRemoteAddr();
+        }
+        return ip.equals("0:0:0:0:0:0:0:1")?"127.0.0.1":ip;
+    }
+}

+ 39 - 0
huimv.nongke.secure/huimv.nongke.secure/src/main/java/com/huimv/secure/common/utils/NumberUtils.java

@@ -0,0 +1,39 @@
+package com.huimv.secure.common.utils;
+
+
+import com.baomidou.mybatisplus.core.toolkit.StringUtils;
+
+import java.text.DecimalFormat;
+import java.util.Random;
+
+public class NumberUtils {
+
+    public static DecimalFormat df = new DecimalFormat("#,##0.00");
+    public static String format(String str) {
+        if (StringUtils.isBlank(str)){
+            return "0.00";
+        }
+        return df.format(Double.valueOf(str));
+    }
+    //num 是小数位数
+    public static String getNum(Integer min,Integer max, Integer num) {
+        Random rand = new Random();
+        int result = rand.nextInt(max - min ) +min;
+        if (num >0){
+            return result+"."+(rand.nextInt((int) Math.pow(10,num)));
+        }
+        return  result+"";
+    }
+    // 是小数位数
+    public static String getNumFloat(Double min, Double max) {
+        double v = Math.random() * (max - min) + min;
+        DecimalFormat df = new DecimalFormat("0.0");
+        return df.format(v);
+    }
+
+    public static String getNumFloat2(Double min, Double max) {
+        double v = Math.random() * (max - min) + min;
+        DecimalFormat df = new DecimalFormat("0.00");
+        return df.format(v);
+    }
+}

+ 89 - 0
huimv.nongke.secure/huimv.nongke.secure/src/main/java/com/huimv/secure/common/utils/OpenapiUtil.java

@@ -0,0 +1,89 @@
+package com.huimv.secure.common.utils;
+
+import javax.imageio.ImageIO;
+import java.awt.image.BufferedImage;
+import java.io.ByteArrayOutputStream;
+import java.io.File;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.net.MalformedURLException;
+import java.net.URL;
+import java.util.Base64;
+import java.util.Base64.Decoder;
+import java.util.Base64.Encoder;
+
+/**
+ * Openapi接口调用过程中会用到的一些工具方法
+ * @author shengyiling
+ *
+ */
+public class OpenapiUtil {
+
+	/**
+	 * BASE64加密网络图片,返回加密之后的字符串
+	 * @param imageUrl 图片的绝对地址
+	 * @param extensioName 图片的扩展名,例如 jpg、bmp等
+	 * @return 加密之后的字符串
+	 */
+	public static String encodeImage2Base64(URL imageUrl, String extensioName){
+		ByteArrayOutputStream outputStream = null;  
+        try {  
+            BufferedImage bufferedImage = ImageIO.read(imageUrl);  //读取网络图片
+            outputStream = new ByteArrayOutputStream();  //文件输出流
+            ImageIO.write(bufferedImage, extensioName, outputStream);  
+        } catch (MalformedURLException e1) {  
+            e1.printStackTrace();  
+        } catch (IOException e) {  
+            e.printStackTrace();  
+        }  
+        Encoder encoder = Base64.getEncoder();
+        
+        return encoder.encodeToString(outputStream.toByteArray());// 返回Base64编码过的字节数组字符串  
+	}
+	
+	/** 
+     * 将本地图片进行Base64位编码 
+     *  
+     * @param imgUrl 
+     *            图片的url路径,如http://.....xx.jpg 
+     * @param extensioName 图片的扩展名
+     * @return 加密之后的字符串
+     */  
+    public static String encodeImgageToBase64(File imageFile, String extensioName) {// 将图片文件转化为字节数组字符串,并对其进行Base64编码处理  
+        ByteArrayOutputStream outputStream = null;  
+        try {  
+            BufferedImage bufferedImage = ImageIO.read(imageFile);  
+            outputStream = new ByteArrayOutputStream();  
+            ImageIO.write(bufferedImage, extensioName, outputStream);  
+        } catch (MalformedURLException e1) {  
+            e1.printStackTrace();  
+        } catch (IOException e) {  
+            e.printStackTrace();  
+        }  
+        // 对字节数组Base64编码  
+        Encoder encoder = Base64.getEncoder(); 
+        
+        return encoder.encodeToString(outputStream.toByteArray());// 返回Base64编码过的字节数组字符串  
+    }
+    
+    
+    /**
+     * 将Base64位编码的图片进行解码,并保存到指定目录
+     * @param base64Str 利用base64加密之后的字符串
+     * @param path 文件解密之后存放的地址 例如:D://
+     * @param imgName 文件解密之后命名的名称 例如: test.jpg
+     */
+    public static void decodeBase64ToImage(String base64Str, String path,  
+            String imgName) {  
+        Decoder decoder = Base64.getDecoder();  
+        try {  
+            FileOutputStream write = new FileOutputStream(new File(path  
+                    + imgName));  
+            byte[] decoderBytes = decoder.decode(base64Str);  
+            write.write(decoderBytes);  
+            write.close();  
+        } catch (IOException e) {  
+            e.printStackTrace();  
+        }  
+    }  
+}

+ 79 - 0
huimv.nongke.secure/huimv.nongke.secure/src/main/java/com/huimv/secure/common/utils/PageFactory.java

@@ -0,0 +1,79 @@
+/*
+Copyright [2020] [https://www.xiaonuo.vip]
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+  http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+
+Snowy采用APACHE LICENSE 2.0开源协议,您在使用过程中,需要注意以下几点:
+
+1.请不要删除和修改根目录下的LICENSE文件。
+2.请不要删除和修改Snowy源码头部的版权声明。
+3.请保留源码和相关描述文件的项目出处,作者声明等。
+4.分发源码时候,请注明软件出处 https://gitee.com/xiaonuobase/snowy
+5.在修改包名,模块名称,项目代码等时,请注明软件出处 https://gitee.com/xiaonuobase/snowy
+6.若您的项目无法满足以上几点,可申请商业授权,获取Snowy商业授权许可,请在官网购买授权,地址为 https://www.xiaonuo.vip
+ */
+package com.huimv.secure.common.utils;
+
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+
+
+/**
+ * 默认分页参数构建
+ *
+ * @author yubaoshan
+ * @date 2017/11/15 13:52
+ */
+public class PageFactory {
+
+    /**
+     * 每页大小(默认20)
+     */
+    private static final String PAGE_SIZE_PARAM_NAME = "pageSize";
+
+    /**
+     * 第几页(从1开始)
+     */
+    private static final String PAGE_NO_PARAM_NAME = "pageNo";
+
+    /**
+     * 默认分页,在使用时PageFactory.defaultPage会自动获取pageSize和pageNo参数
+     *
+     * @author xuyuxiang
+     * @date 2020/3/30 16:42
+     */
+    public static <T> Page<T> defaultPage() {
+
+        int pageSize = 20;
+        int pageNo = 1;
+
+
+        return new Page<>(pageNo, pageSize);
+    }
+}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+

+ 8 - 0
huimv.nongke.secure/huimv.nongke.secure/src/main/java/com/huimv/secure/common/utils/PageResult.java

@@ -0,0 +1,8 @@
+package com.huimv.secure.common.utils;
+
+import java.util.List;
+
+public class PageResult<T> {
+    private Long total;
+    private List<T> rows;
+}

+ 344 - 0
huimv.nongke.secure/huimv.nongke.secure/src/main/java/com/huimv/secure/common/utils/PdfUtil.java

@@ -0,0 +1,344 @@
+package com.huimv.secure.common.utils;
+
+//import cn.bt.common.utils.StringUtils;
+//import cn.bt.modules.process.instance.enums.InstanceStatusEnum;
+//import com.itextpdf.text.*;
+//import com.itextpdf.text.pdf.*;
+
+import cn.hutool.core.io.IoUtil;
+
+import javax.servlet.http.HttpServletResponse;
+import java.io.BufferedInputStream;
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.InputStream;
+
+/**
+ * @Author: xp
+ * @Date: 2021/7/14
+ */
+public class PdfUtil {
+
+    /**
+     * 返回PDF流
+     *
+     * @param response 相应设置
+     * @param pathName 水印文件路径和名称
+     * @throws Exception 异常
+     */
+    /*public static void returnPdfStream(HttpServletResponse response, String pathName) throws Exception {
+        response.setContentType("application/pdf");
+
+        File file = new File(pathName);
+        if (file.exists()) {
+            FileInputStream in = new FileInputStream(file);
+            OutputStream out = response.getOutputStream();
+            byte[] b = new byte[1024 * 4];
+            int n;
+            while ((n = in.read(b)) > -1) {
+                out.write(b, 0, n);
+            }
+            out.flush();
+            in.close();
+            out.close();
+        }
+    }*/
+    public static void returnPdfStream2(HttpServletResponse response, String pathName, String subsidyNane) throws Exception {
+        InputStream in = null;
+        try {
+            File file = new File(pathName);
+             in = new BufferedInputStream(new FileInputStream(file));
+            String filename = new String((subsidyNane+".pdf").getBytes(), "ISO8859_1");
+            response.setContentType("application/binary;charset=ISO8859_1");
+            response.setHeader("Content-disposition", "attachment; filename=" + filename);// 组装附件名称和格式
+            IoUtil.copy(in, response.getOutputStream());
+        } catch (Exception e) {
+            System.out.println("------------ 这里除了问题!!!-----------");
+            System.out.println(e);
+        }finally {
+            if (in != null) {
+                in.close();
+            }
+        }
+    }
+
+    public static void returnPdfStream3(HttpServletResponse response, String pathName, String subsidyNane) throws Exception {
+        InputStream in = null;
+        try {
+            File file = new File(pathName);
+            in = new BufferedInputStream(new FileInputStream(file));
+            String filename = new String((subsidyNane+".xls").getBytes(), "ISO8859_1");
+            response.setContentType("application/binary;charset=ISO8859_1");
+            response.setHeader("Content-disposition", "attachment; filename=" + filename);// 组装附件名称和格式
+            IoUtil.copy(in, response.getOutputStream());
+        } catch (Exception e) {
+            System.out.println("------------ 这里除了问题!!!-----------");
+            System.out.println(e);
+        }finally {
+            if (in != null) {
+                in.close();
+            }
+        }
+    }
+
+    /**
+     * 返回水印图片路径
+     *
+     * @param instanceStatus 流程状态
+     * @return 水印图片路径
+     */
+//    public static String returnWatermarkPath(int instanceStatus) {
+//        String watermarkPath = "ioffice-api/src/main/resources/static/watermark";
+//        if (InstanceStatusEnum.E_0.getCode().equals(instanceStatus)) {
+//            watermarkPath = watermarkPath + "/已作废.png";
+//
+//        } else if (InstanceStatusEnum.E_2.getCode().equals(instanceStatus)) {
+//            watermarkPath = watermarkPath + "/审批通过.png";
+//
+//        } else {
+//            watermarkPath = watermarkPath + "/审批中.png";
+//        }
+//        return watermarkPath;
+//    }
+//
+//    /**
+//     * 建立一个书写器(Writer)与document对象关联,通过书写器(Writer)可以将文档写入到磁盘中。
+//     *
+//     * @param pdfPath     保存路径
+//     * @param document    文档
+//     * @param pdfPathName 文件保存路径和名称
+//     * @return 书写器(Writer)
+//     * @throws Exception
+//     */
+//    public static PdfWriter createPdfWriter(String pdfPath, Document document, String pdfPathName) throws Exception {
+//
+//        //判断文件夹是否存在
+//        File file = new File(pdfPath);
+//        if (!file.exists()) {
+//            file.mkdir();
+//        }
+//        file = new File(pdfPathName);
+//
+//        PdfWriter writer = PdfWriter.getInstance(document, new FileOutputStream(file));
+//        writer.setViewerPreferences(PdfWriter.PageModeUseThumbs);
+//
+//        return writer;
+//    }
+//
+//    /**
+//     * 设置第一标题内容
+//     *
+//     * @param title    第一标题
+//     * @param document 文档
+//     * @throws Exception 异常
+//     */
+//    public static void setPdfFirstTitle(String title, Document document) throws Exception {
+//        Paragraph paragraph = new Paragraph(title, getPdfChineseFont(0));
+//        paragraph.setAlignment(Element.ALIGN_CENTER);
+//        paragraph.setSpacingAfter(2);
+//        document.add(paragraph);
+//    }
+//
+//    /**
+//     * 设置第二标题内容
+//     *
+//     * @param title           第二标题
+//     * @param document        文档
+//     * @param alignment       对齐方式
+//     * @param firstLineIndent 第一行缩进
+//     * @param spacingAfter    之后间隔
+//     * @throws Exception
+//     */
+//    public static void setPdfSecondTitle(String title, Document document, int alignment, int firstLineIndent, int spacingAfter) throws Exception {
+//        Paragraph lsh = new Paragraph(title, getPdfChineseFont(1));
+//        lsh.setAlignment(alignment);
+//        lsh.setFirstLineIndent(firstLineIndent);
+//        lsh.setSpacingAfter(spacingAfter);
+//        document.add(lsh);
+//    }
+//
+//    /**
+//     * 设置表格内容 并将表格加入文档中
+//     *
+//     * @param dates    数据
+//     * @param document 文档
+//     * @param table    表格
+//     * @throws Exception 异常
+//     */
+//    public static void setPdfTableContent(Object[][] dates, Document document, PdfPTable table) throws Exception {
+//        for (int i = 0; i < dates.length; i++) {
+//            for (int j = 0; j < dates[i].length; j++) {
+//                //表格的单元格
+//                PdfPCell pdfCell = new PdfPCell();
+//                //设置表格行高
+//                if (i > 0 && i < 3) {
+//                    pdfCell.setMinimumHeight(50);
+//                } else {
+//                    pdfCell.setMinimumHeight(25);
+//                }
+//                Paragraph paragraph = new Paragraph(dates[i][j] + "", getPdfChineseFont(1));
+//                pdfCell.setPhrase(paragraph);
+//
+//                setCellStyle(pdfCell);
+//                table.addCell(pdfCell);
+//            }
+//        }
+//
+//        document.add(table);
+//    }
+//
+//    /**
+//     * 设置水印
+//     *
+//     * @param inputFile 要这设置水印的文件路径
+//     * @param imageFile 水印图片路径
+//     * @param tag       标记
+//     * @return 生成水印文件的路径
+//     */
+//    public static String imageWaterMark(String inputFile, String imageFile, String tag) throws Exception {
+//        String[] spe = separatePath(inputFile);
+//        String outputFile = spe[0] + tag + "." + spe[1];
+//
+//        PdfReader reader = new PdfReader(inputFile);
+//        PdfStamper stamper = new PdfStamper(reader, new FileOutputStream(outputFile));
+//
+//        int total = reader.getNumberOfPages() + 1;
+//
+//        Image image = Image.getInstance(imageFile);
+//        //坐标
+//        image.setAbsolutePosition(389, 730);
+//        //自定义大小
+//        image.scaleAbsolute(80, 80);
+//        //旋转 弧度
+//        image.setRotation(-55);
+//
+//        //旋转 角度
+//        image.setRotationDegrees(0);
+//        //依照比例缩放
+//        image.scalePercent(50);
+//
+//        PdfGState gs = new PdfGState();
+//        // 设置透明度为0.2
+//        gs.setFillOpacity(0.2f);
+//
+//
+//        PdfContentByte under;
+//        //给每一页加水印
+//        for (int i = 1; i < total; i++) {
+//            under = stamper.getUnderContent(i);
+//            under.beginText();
+//            // 添加水印图片
+//            under.addImage(image);
+//            under.setGState(gs);
+//        }
+//        stamper.close();
+//        reader.close();
+//        return outputFile;
+//    }
+//
+//    /**
+//     * 拆分原文件路径
+//     *
+//     * @param path 原文件路径
+//     * @return 拆分原路径的数组
+//     */
+//    public static String[] separatePath(String path) {
+//        if (StringUtils.isBlank(path)) {
+//            return null;
+//        }
+//        String[] sep = path.split("\\.");
+//        return new String[]{sep[0], sep[1]};
+//    }
+//
+//    /**
+//     * 设置表格单元格样式
+//     *
+//     * @param pdfCell 单元格对象
+//     */
+//    public static void setCellStyle(PdfPCell pdfCell) {
+//        pdfCell.setHorizontalAlignment(Element.ALIGN_CENTER);
+//        pdfCell.setVerticalAlignment(Element.ALIGN_MIDDLE);
+//        pdfCell.setBackgroundColor(new BaseColor(0xdd7e6b));
+//        pdfCell.setBorderWidthTop(0.1f);
+//        pdfCell.setBorderWidthBottom(0.1f);
+//        pdfCell.setBorderWidthLeft(0.1f);
+//        pdfCell.setBorderWidthRight(0.1f);
+//    }
+//
+//    /**
+//     * 设置pdf字体及大小
+//     *
+//     * @param type 标题或者内容 0-内容 1-标题
+//     * @return 字体
+//     * @throws Exception 异常
+//     */
+//    public static Font getPdfChineseFont(int type) throws Exception {
+//        // 使用系统字体
+//        BaseFont bfChinese = BaseFont.createFont("STSong-Light", "UniGB-UCS2-H", BaseFont.NOT_EMBEDDED);
+//        Font font;
+//        if (type == 1) {
+//            font = new Font(bfChinese);
+//        } else {
+//            font = new Font(bfChinese, 18, Font.BOLD);
+//        }
+//
+//        return font;
+//    }
+//
+//    /**
+//     * 删除文件夹
+//     *
+//     * @param folderPath 文件路基
+//     */
+//    public static void delFolder(String folderPath) {
+//        // 删除完里面所有内容
+//        delAllFile(folderPath);
+//        String filePath = folderPath;
+//        filePath = filePath.toString();
+//        java.io.File myFilePath = new java.io.File(filePath);
+//        // 删除空文件夹
+//        myFilePath.delete();
+//    }
+//
+//    /**
+//     * 删除指定文件夹下所有文件
+//     *
+//     * @param path 文件路基
+//     * @return 是否成功
+//     */
+//    public static boolean delAllFile(String path) {
+//        boolean flag = false;
+//        File file = new File(path);
+//        String[] tempList = file.list();
+//        File temp = null;
+//        for (int i = 0; i < tempList.length; i++) {
+//            if (path.endsWith(File.separator)) {
+//                temp = new File(path + tempList[i]);
+//            } else {
+//                temp = new File(path + File.separator + tempList[i]);
+//            }
+//            if (temp.isFile()) {
+//                temp.delete();
+//            }
+//            if (temp.isDirectory()) {
+//                // 先删除文件夹里面的文件
+//                delAllFile(path + "/" + tempList[i]);
+//                // 再删除空文件夹
+//                delFolder(path + "/" + tempList[i]);
+//                flag = true;
+//            }
+//        }
+//        return flag;
+//    }
+//    public static boolean delAllFile(String path) {
+//        boolean flag = false;
+//        File file = new File(path);
+//        File temp = null;
+//
+//            if (temp.isFile()) {
+//                temp.delete();
+//            }
+//        return flag;
+//    }
+}
+

+ 29 - 0
huimv.nongke.secure/huimv.nongke.secure/src/main/java/com/huimv/secure/common/utils/PercentUtil.java

@@ -0,0 +1,29 @@
+package com.huimv.secure.common.utils;
+
+import java.text.DecimalFormat;
+
+/**
+ * @Author : yuxuexuan
+ * @Create : 2021/11/29 0029 10:52
+ **/
+public class PercentUtil {
+
+    public static String getGrowth(Double lastMonth,Double lastTwoMonth){
+        if (lastMonth.equals( lastTwoMonth)){
+            return "0";
+        }
+        if (lastMonth == 0.0){
+            return "-100";
+        }
+
+        if (lastTwoMonth == 0.0){
+            return "100";
+        }
+        DecimalFormat df = new DecimalFormat("0.00");
+
+        return df.format((lastMonth - lastTwoMonth)/ lastTwoMonth *100);
+    }
+
+
+
+}

+ 25 - 0
huimv.nongke.secure/huimv.nongke.secure/src/main/java/com/huimv/secure/common/utils/PhoneNumberValidator.java

@@ -0,0 +1,25 @@
+package com.huimv.secure.common.utils;
+
+import java.util.regex.Pattern;
+
+public class PhoneNumberValidator {
+
+    public static boolean isValidPhoneNumber(String phoneNumber) {
+        // 正则表达式用于验证手机号
+        String pattern = "1[3456789]\\d{9}";
+
+        // 判断输入的手机号是否符合规则
+        return Pattern.matches(pattern, phoneNumber);
+    }
+
+    public static void main(String[] args) {
+        String phoneNumber = "手机号"; // 替换为要验证的手机号
+        boolean isValid = isValidPhoneNumber(phoneNumber);
+        if (isValid) {
+            System.out.println("手机号正确!");
+        } else {
+            System.out.println("手机号错误!");
+        }
+    }
+}
+

+ 38 - 0
huimv.nongke.secure/huimv.nongke.secure/src/main/java/com/huimv/secure/common/utils/PlatformException.java

@@ -0,0 +1,38 @@
+/**
+ * @Copyright (C), 2014-2020, 杭州慧牧科技有限公司
+ * @ClassName: RobotException
+ * @Author: yejijie
+ * @E-mail: yejijie@huimv.com
+ * @Date: 2020年4月23日
+ * @Version: V1.0
+ * @Description:
+ */
+package com.huimv.secure.common.utils;
+
+/**
+ * @author yejijie
+ *
+ */
+public class PlatformException extends RuntimeException {
+
+	/**
+	 * 
+	 */
+	private static final long serialVersionUID = 6529181147584750288L;
+	private String errCode;
+	private String errMsg;
+	public PlatformException() {
+		super();
+	}
+	public PlatformException(String code, String msg) {
+		super(msg);
+		this.errCode = code;
+		this.errMsg = msg;
+	}
+	public String getErrCode() {
+		return errCode;
+	}
+	public String getErrMsg() {
+		return errMsg;
+	}
+}

+ 331 - 0
huimv.nongke.secure/huimv.nongke.secure/src/main/java/com/huimv/secure/common/utils/Print.java

@@ -0,0 +1,331 @@
+//package com.huimv.secure.common.utils;
+//
+//
+//import com.huimv.secure.entity.*;
+//import com.huimv.secure.entity.dto.PrintAdmissionDto;
+//import com.huimv.secure.entity.dto.PrintLuggageDto;
+//import com.huimv.secure.entity.vo.AccountVo;
+//import com.huimv.secure.entity.vo.DeviceVo;
+//import com.huimv.secure.entity.vo.SysUserVo;
+//import org.jxls.common.Context;
+//import org.jxls.util.JxlsHelper;
+//
+//import java.io.FileInputStream;
+//import java.io.FileOutputStream;
+//import java.io.InputStream;
+//import java.io.OutputStream;
+//import java.text.SimpleDateFormat;
+//import java.time.LocalDateTime;
+//import java.time.format.DateTimeFormatter;
+//import java.util.ArrayList;
+//import java.util.Date;
+//import java.util.List;
+//
+//public class Print {
+//    /**
+//     * 打印方法  不插入图片
+//     *
+//     * @return
+//     * @throws Exception
+//     */
+//    public static void printAdmission(List<BillPersonnelAdmission> admissionList) throws Exception {
+//
+//        //准备数据
+//        String path = "/opt/huatong/admission.xls";
+//        //获取模板文件,你自己当前模板的位置  我这里为当前项目下
+//        InputStream is = new FileInputStream("/opt/huatong/admission.xlsx");
+//        //根据模板生成的文件保存路径  我这里保存在本地D盘
+//        OutputStream os = new FileOutputStream(path);
+//        //绑定数据
+//        Context context = new Context();
+//        List<PrintAdmissionDto> list = new ArrayList<>();
+//        for (BillPersonnelAdmission admission : admissionList) {
+//            PrintAdmissionDto dto = new PrintAdmissionDto();
+//            dto.setUserName(admission.getAdmissionUserName());
+//            dto.setCarNum(admission.getCarNum());
+//            dto.setPhone(admission.getPhone());
+//            dto.setDestName(admission.getDestName());
+//            LocalDateTime date = admission.getVistitDate();
+//            DateTimeFormatter dtf = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
+//            dto.setVistitDate(dtf.format(date));
+//            dto.setVistitReason(admission.getVistitReson());
+//            if (admission.getBillStatus() == 0) {
+//                dto.setBillStatus("待审核");
+//            } else if (admission.getBillStatus() == 1) {
+//                dto.setBillStatus("通过");
+//            } else if (admission.getBillStatus() == 2) {
+//                dto.setBillStatus("拒绝");
+//            }
+//
+//            if (admission.getVistitType() == 0) {
+//                dto.setVistitType("人员");
+//            } else if (admission.getVistitType() == 1) {
+//                dto.setVistitType("环保车");
+//            } else if (admission.getVistitType() == 2) {
+//                dto.setVistitType("拉猪车");
+//            } else if (admission.getVistitType() == 3) {
+//                dto.setVistitType("饲料车");
+//            } else if (admission.getVistitType() == 4) {
+//                dto.setVistitType("送猪车");
+//            } else if (admission.getVistitType() == 5) {
+//                dto.setVistitType("物资车");
+//            }
+//            list.add(dto);
+//        }
+//        context.putVar("list", list);
+//        //生成
+//        JxlsHelper.getInstance().processTemplate(is, os, context);
+//    }
+//
+////    public static void printIsolate(List<BillIsolate> isolateList) throws Exception {
+////
+////        //准备数据
+////        String path = "/opt/huatong/isolate.xls";
+////        //获取模板文件,你自己当前模板的位置  我这里为当前项目下
+////        InputStream is = new FileInputStream("/opt/huatong/isolate.xlsx");
+////        //根据模板生成的文件保存路径  我这里保存在本地D盘
+////        OutputStream os = new FileOutputStream(path);
+////        //绑定数据
+////        Context context = new Context();
+////        List<PrintIsolateDto> list = new ArrayList<>();
+////        for (BillIsolate billIsolate : isolateList) {
+////            PrintIsolateDto dto = new PrintIsolateDto();
+////            dto.setDestName(billIsolate.getDestName());
+////            dto.setPhone(billIsolate.getPhone());
+////            dto.setUserName(billIsolate.getAdmissionUserName());
+////            if (billIsolate.getBillStatus() == 0) {
+////                dto.setStatus("待隔离");
+////            } else if (billIsolate.getBillStatus() == 1) {
+////                dto.setStatus("隔离中");
+////            } else if (billIsolate.getBillStatus() == 2) {
+////                dto.setStatus("已完成");
+////            } else if (billIsolate.getBillStatus() == 3) {
+////                dto.setStatus("提前解除");
+////            }
+////            dto.setLocation(billIsolate.getIsolateLocation());
+////            dto.setNum(billIsolate.getIsolateDayNum());
+////            SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
+////            dto.setStartTime(sdf.format(billIsolate.getIsolateStartDate()));
+////            dto.setEndTime(sdf.format(billIsolate.getIsolateEndDate()));
+////            list.add(dto);
+////        }
+////        context.putVar("list", list);
+////        //生成
+////        JxlsHelper.getInstance().processTemplate(is, os, context);
+////    }
+//
+//    public static void printPcr(List<BillPcr> admissionList) throws Exception {
+//
+//        //准备数据
+//        String path = "/opt/huatong/pcr.xls";
+//        //获取模板文件,你自己当前模板的位置  我这里为当前项目下
+//        InputStream is = new FileInputStream("/opt/huatong/pcr.xlsx");
+//        //根据模板生成的文件保存路径  我这里保存在本地D盘
+//        OutputStream os = new FileOutputStream(path);
+//        //绑定数据
+//        Context context = new Context();
+//        List<PrintAdmissionDto> list = new ArrayList<>();
+//        for (BillPcr admission : admissionList) {
+//            PrintAdmissionDto dto = new PrintAdmissionDto();
+//            dto.setUserName(admission.getAdmissionUserName());
+//            dto.setCarNum(admission.getCarNum());
+//            dto.setPhone(admission.getPhone());
+//            dto.setDestName(admission.getDestName());
+//            Date date = admission.getCheckDate();
+//            SimpleDateFormat dtf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
+//            dto.setVistitDate(dtf.format(date));
+//            dto.setVistitReason(admission.getTestLocation());
+//            if (admission.getBillStatus() == 0) {
+//                dto.setBillStatus("待审核");
+//            } else if (admission.getBillStatus() == 1) {
+//                dto.setBillStatus("合格");
+//            } else if (admission.getBillStatus() == 2) {
+//                dto.setBillStatus("异常");
+//            } else if (admission.getBillStatus() == 3) {
+//                dto.setBillStatus("失效");
+//            }
+//
+//            if (admission.getVistitType() == 0) {
+//                dto.setVistitType("人员");
+//            } else if (admission.getVistitType() == 1) {
+//                dto.setVistitType("环保车");
+//            } else if (admission.getVistitType() == 2) {
+//                dto.setVistitType("拉猪车");
+//            } else if (admission.getVistitType() == 3) {
+//                dto.setVistitType("饲料车");
+//            } else if (admission.getVistitType() == 4) {
+//                dto.setVistitType("送猪车");
+//            } else if (admission.getVistitType() == 5) {
+//                dto.setVistitType("物资车");
+//            }
+//            list.add(dto);
+//        }
+//        context.putVar("list", list);
+//        //生成
+//        JxlsHelper.getInstance().processTemplate(is, os, context);
+//    }
+//
+//    public static void printClean(List<BillClean> admissionList) throws Exception {
+//
+//        //准备数据
+//        String path = "/opt/huatong/clean.xls";
+//        //获取模板文件,你自己当前模板的位置  我这里为当前项目下
+//        InputStream is = new FileInputStream("/opt/huatong/clean.xlsx");
+//        //根据模板生成的文件保存路径  我这里保存在本地D盘
+//        OutputStream os = new FileOutputStream(path);
+//        //绑定数据
+//        Context context = new Context();
+//        List<PrintAdmissionDto> list = new ArrayList<>();
+//        for (BillClean admission : admissionList) {
+//            PrintAdmissionDto dto = new PrintAdmissionDto();
+//            dto.setUserName(admission.getAdmissionUserName());
+//            dto.setCarNum(admission.getCarNum());
+//            dto.setPhone(admission.getPhone());
+//            dto.setDestName(admission.getDestName());
+//            Date date = admission.getCheckDate();
+//            SimpleDateFormat dtf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
+//            dto.setVistitDate(dtf.format(date));
+//            dto.setVistitReason(admission.getTestLocation());
+//            if (admission.getBillStatus() == 0) {
+//                dto.setBillStatus("待审核");
+//            } else if (admission.getBillStatus() == 1) {
+//                dto.setBillStatus("合格");
+//            } else if (admission.getBillStatus() == 2) {
+//                dto.setBillStatus("异常");
+//            } else if (admission.getBillStatus() == 3) {
+//                dto.setBillStatus("失效");
+//            }
+//
+//            if (admission.getVistitType() == 0) {
+//                dto.setVistitType("人员");
+//            } else if (admission.getVistitType() == 1) {
+//                dto.setVistitType("环保车");
+//            } else if (admission.getVistitType() == 2) {
+//                dto.setVistitType("拉猪车");
+//            } else if (admission.getVistitType() == 3) {
+//                dto.setVistitType("饲料车");
+//            } else if (admission.getVistitType() == 4) {
+//                dto.setVistitType("送猪车");
+//            } else if (admission.getVistitType() == 5) {
+//                dto.setVistitType("物资车");
+//            }
+//            list.add(dto);
+//        }
+//        context.putVar("list", list);
+//        //生成
+//        JxlsHelper.getInstance().processTemplate(is, os, context);
+//    }
+//
+//    public static void printLuggage(List<BillLuggage> admissionList) throws Exception {
+//
+//        //准备数据
+//        String path = "/opt/huatong/luggage.xls";
+//        //获取模板文件,你自己当前模板的位置  我这里为当前项目下
+//        InputStream is = new FileInputStream("/opt/huatong/luggage.xlsx");
+//        //根据模板生成的文件保存路径  我这里保存在本地D盘
+//        OutputStream os = new FileOutputStream(path);
+//        //绑定数据
+//        Context context = new Context();
+//        List<PrintLuggageDto> list = new ArrayList<>();
+//        for (BillLuggage admission : admissionList) {
+//            PrintLuggageDto dto = new PrintLuggageDto();
+//            dto.setUserName(admission.getUserName());
+//            dto.setPhone(admission.getPhone());
+//            LocalDateTime date = admission.getLuggageDate();
+//            DateTimeFormatter dtf = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
+//            dto.setVistitDate(dtf.format(date));
+//            dto.setVistitReason(admission.getLuggageLocation());
+//            dto.setBillStatus(admission.getLuggageNum().toString());
+//            list.add(dto);
+//        }
+//        context.putVar("list", list);
+//        //生成
+//        JxlsHelper.getInstance().processTemplate(is, os, context);
+//    }
+//
+//    public static void printUser(List<SysUser> users) throws Exception {
+//
+//        //准备数据
+//        String path = "/opt/huatong/user.xls";
+//        //获取模板文件,你自己当前模板的位置  我这里为当前项目下
+//        InputStream is = new FileInputStream("/opt/huatong/user.xlsx");
+//        //根据模板生成的文件保存路径  我这里保存在本地D盘
+//        OutputStream os = new FileOutputStream(path);
+//        //绑定数据
+//        Context context = new Context();
+//        List<SysUserVo> list = new ArrayList<>();
+//        for (SysUser user : users) {
+//            SysUserVo userVo = new SysUserVo();
+//            userVo.setPhone(user.getUserPhone());
+//            userVo.setUserName(user.getUserName());
+//            userVo.setUserNum(user.getUserId());
+//            if (user.getJob().equals("1")) {
+//                userVo.setWorkName("场长");
+//            } else if (user.getJob().equals("3")) {
+//                userVo.setWorkName("生物安全负责人");
+//            } else if (user.getJob().equals("4")) {
+//                userVo.setWorkName("pcr检测人员");
+//            } else if (user.getJob().equals("5")) {
+//                userVo.setWorkName("洗消点工作人员");
+//            }
+//            if (user.getGender() == 0) {
+//                userVo.setSex("男");
+//            } else {
+//                userVo.setSex("女");
+//            }
+//            userVo.setWorkLocation(user.getWorkLocation());
+//            list.add(userVo);
+//        }
+//
+//        context.putVar("list", list);
+//        //生成
+//        JxlsHelper.getInstance().processTemplate(is, os, context);
+//    }
+//
+//    public static void printAccount(List<AccountVo> accountVos) throws Exception {
+//
+//        //准备数据
+//        String path = "/opt/huatong/account.xls";
+//        //获取模板文件,你自己当前模板的位置  我这里为当前项目下
+//        InputStream is = new FileInputStream("/opt/huatong/account.xlsx");
+//        //根据模板生成的文件保存路径  我这里保存在本地D盘
+//        OutputStream os = new FileOutputStream(path);
+//        //绑定数据
+//        Context context = new Context();
+//
+//        context.putVar("list", accountVos);
+//        //生成
+//        JxlsHelper.getInstance().processTemplate(is, os, context);
+//    }
+//
+//    public static void printDevice(List<BaseDevice> devices) throws Exception {
+//
+//        //准备数据
+//        String path = "/opt/huatong/device.xls";
+//        //获取模板文件,你自己当前模板的位置  我这里为当前项目下
+//        InputStream is = new FileInputStream("/opt/huatong/device.xlsx");
+//        //根据模板生成的文件保存路径  我这里保存在本地D盘
+//        OutputStream os = new FileOutputStream(path);
+//        //绑定数据
+//        Context context = new Context();
+//        List<DeviceVo> deviceVos = new ArrayList<>();
+//
+//        for (BaseDevice device : devices) {
+//            DeviceVo deviceVo = new DeviceVo();
+//            deviceVo.setDeviceName(device.getDeviceName());
+//            deviceVo.setDeviceNum(device.getDeviceCode());
+//            deviceVo.setLocation(device.getWorkLocation());
+//            deviceVo.setUserName(device.getUserName());
+//            if (device.getDeviceStatus() == 0) {
+//                deviceVo.setStatus("离线");
+//            } else {
+//                deviceVo.setStatus("在线");
+//            }
+//            deviceVos.add(deviceVo);
+//        }
+//        context.putVar("list", deviceVos);
+//        //生成
+//        JxlsHelper.getInstance().processTemplate(is, os, context);
+//    }
+//
+//}

+ 97 - 0
huimv.nongke.secure/huimv.nongke.secure/src/main/java/com/huimv/secure/common/utils/Result.java

@@ -0,0 +1,97 @@
+package com.huimv.secure.common.utils;
+
+import java.io.Serializable;
+
+public class Result implements Serializable {
+
+    private boolean success;
+    private Integer code;
+    private String message;
+
+    public boolean isSuccess() {
+        return success;
+    }
+
+    public void setSuccess(boolean success) {
+        this.success = success;
+    }
+
+    public Integer getCode() {
+        return code;
+    }
+
+    public void setCode(Integer code) {
+        this.code = code;
+    }
+
+    public String getMessage() {
+        return message;
+    }
+
+    public void setMessage(String message) {
+        this.message = message;
+    }
+
+    public Object getData() {
+        return data;
+    }
+
+    public void setData(Object data) {
+        this.data = data;
+    }
+
+    private Object data;
+
+    public Object getData2() {
+        return data2;
+    }
+
+    public void setData2(Object data2) {
+        this.data2 = data2;
+    }
+
+    private Object data2;
+
+    //不需要返回数据时使用
+    public Result(ResultCode code) {
+        this.success = code.success;
+        this.code = code.code;
+        this.message = code.message;
+    }
+
+    public Result(ResultCode code, Object data) {
+        this.success = code.success;
+        this.code = code.code;
+        this.message = code.message;
+        this.data = data;
+    }
+    public Result(ResultCode code, Object data, Object data2) {
+        this.success = code.success;
+        this.code = code.code;
+        this.message = code.message;
+        this.data = data;
+        this.data2 = data2;
+
+    }
+
+    public Result(Integer code, String message, boolean success) {
+        this.code = code;
+        this.message = message;
+        this.success = success;
+    }
+
+    /*
+     * 调用ResultCode类封装常用的返回数据
+     */
+    public static Result SUCCESS(){
+        return new Result(ResultCode.SUCCESS);
+    }
+
+    public static Result ERROR(){
+        return new Result(ResultCode.SERVER_ERROR);
+    }
+
+    public static Result FAIL(){
+        return new Result(ResultCode.FAIL);
+    }
+}

+ 41 - 0
huimv.nongke.secure/huimv.nongke.secure/src/main/java/com/huimv/secure/common/utils/ResultCode.java

@@ -0,0 +1,41 @@
+package com.huimv.secure.common.utils;
+
+public enum ResultCode {
+    SUCCESS(true,10000,"操作成功!"),
+    //---系统错误返回码-----
+    FAIL(false,10001,"操作失败"),
+    UNAUTHENTICATED(false,10002,"您还未登录"),
+    UNAUTHORISE(false,10003,"权限不足"),
+    SERVER_ERROR(false,99999,"抱歉,系统繁忙,请稍后重试!"),
+    DATA_NULL(false,10004,"数据为空"),
+    //---用户操作返回码  2xxxx----
+    MOBILEORPASSWORDERROR(false,20001,"用户名或密码错误");
+    //---企业操作返回码  3xxxx----
+    //---权限操作返回码----
+    //---其他操作返回码----
+
+    //操作是否成功
+    boolean success;
+    //操作代码
+    int code;
+    //提示信息
+    String message;
+
+    ResultCode(boolean success,int code, String message){
+        this.success = success;
+        this.code = code;
+        this.message = message;
+    }
+
+    public boolean success() {
+        return success;
+    }
+
+    public int code() {
+        return code;
+    }
+
+    public String message() {
+        return message;
+    }
+}

+ 71 - 0
huimv.nongke.secure/huimv.nongke.secure/src/main/java/com/huimv/secure/common/utils/ResultUtil.java

@@ -0,0 +1,71 @@
+package com.huimv.secure.common.utils;
+
+import cn.hutool.core.util.ObjectUtil;
+import org.springframework.stereotype.Component;
+
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * @Project : huimv-breed
+ * @Package : IntelliJ IDEA
+ * @Description : TODO
+ * @Version : 1.0
+ * @Author : ZhuoNing
+ * @Create : 2022/9/27
+ **/
+@Component
+public class ResultUtil {
+
+    public static Result result(int rows){
+        if(rows == 0){
+            return new Result(ResultCode.FAIL,"处理失败.");
+        }else{
+            return new Result(ResultCode.SUCCESS,"处理成功.");
+        }
+    }
+
+    public static Result list(List o){
+        if(ObjectUtil.isNotEmpty(o) ){
+            return new Result(ResultCode.SUCCESS,o);
+        }else{
+            return new Result(ResultCode.FAIL,new ArrayList<>());
+        }
+    }
+    public static Result getResult(Integer rows){
+        if(rows > 0){
+            return new Result(ResultCode.SUCCESS);
+        }else{
+            return new Result(ResultCode.FAIL);
+        }
+    }
+
+    public static Result addResult(Integer rows){
+        if(rows > 0){
+            return new Result(10000, "添加成功",true);
+        }else{
+            return new Result(10001, "添加失败",false);
+        }
+    }
+    public static Result updateResult(Integer rows){
+        if(rows > 0){
+            return new Result(10000, "修改成功",true);
+        }else{
+            return new Result(10001, "修改失败",false);
+        }
+    }
+    public static Result deleteResult(Integer rows){
+        if(rows > 0){
+            return new Result(10000, "删除成功",true);
+        }else{
+            return new Result(10001, "删除失败",false);
+        }
+    }
+
+    public static Result exist(){
+       return new Result(10001, "该数据已存在",false);
+    }
+    public static Result isNull(){
+        return new Result(ResultCode.DATA_NULL);
+    }
+}

+ 116 - 0
huimv.nongke.secure/huimv.nongke.secure/src/main/java/com/huimv/secure/common/utils/SendSMS.java

@@ -0,0 +1,116 @@
+package com.huimv.secure.common.utils;
+
+
+import cn.hutool.crypto.SecureUtil;
+import cn.hutool.crypto.digest.MD5;
+import org.springframework.http.HttpEntity;
+import org.springframework.http.HttpHeaders;
+import org.springframework.http.MediaType;
+import org.springframework.http.ResponseEntity;
+import org.springframework.stereotype.Component;
+import org.springframework.web.client.RestTemplate;
+
+import java.io.BufferedReader;
+import java.io.InputStream;
+import java.io.InputStreamReader;
+import java.net.HttpURLConnection;
+import java.net.URL;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.Map;
+
+@Component
+public class SendSMS {
+
+
+    static String httpUrl = "http://121.41.41.182:8001/sms";
+    static String userNmae = "6085";
+    static String passWord = "huimu@6085";
+
+    //短信内容不能出现空格,换行,百分号等特殊字符.相同两条短信之间内容不能相同
+    public static void main(String[] args) {
+        /**
+         *发送给报警器
+         *//*
+		String content = "003C0043004C0045004100520030003000310039003E";
+		String mobile = "18767100452";//多个用英文逗号隔开 如18767100452,1388888888
+		content = UnicodeTool.decodeUnicode(UnicodeTool.addUnicodeU(content.toString()));*/
+
+        /**
+         * 发送给用户
+         */
+        ArrayList<String> phoneList = new ArrayList<>();
+        phoneList.add("13140429955");
+        String content ="保育2高温报警; 保育2高温报警已经恢复";
+        sendSMS(phoneList,content);
+//        MD5 md5 = SecureUtil.md5();
+//        String md5PassWord = md5.digestHex(passWord);
+//        System.out.println(md5PassWord);
+//        System.out.println(userNmae+"【慧牧科技】测试结果"+"1694157718734"+md5PassWord);
+//        String sign = md5.digestHex(userNmae+"【慧牧科技】测试结果"+"1694157718734"+md5PassWord);
+//        System.out.println(sign);
+
+    }
+
+    public static void sendSMS( ArrayList<String> mobiles, String content) {
+        RestTemplate restTemplate = new RestTemplate();
+
+        // 设置请求头
+        HttpHeaders headers = new HttpHeaders();
+        headers.setContentType(MediaType.APPLICATION_JSON_UTF8);
+
+        // 设置请求参数
+        Map params = new HashMap();
+        content =   "【慧牧科技】"+content;
+        long timestamp = System.currentTimeMillis();
+        params.put("userName", userNmae);
+        params.put("content", content);
+        params.put("phoneList", mobiles);
+        params.put("timestamp", timestamp);
+        MD5 md5 = SecureUtil.md5();
+        String md5PassWord = md5.digestHex(passWord);
+        System.out.println(md5PassWord);
+        String sign = md5.digestHex(userNmae+content+timestamp+md5PassWord);
+
+        params.put("sign", sign);
+
+        System.out.println(params.toString());
+        // 创建HttpEntity对象,封装请求头和请求参数
+        HttpEntity requestEntity = new HttpEntity<>(params, headers);
+        // 发送POST请求
+        ResponseEntity<String> responseEntity = restTemplate.postForEntity(httpUrl+"/api/sendMessage", requestEntity, String.class);
+
+        // 获取响应结果
+        String responseBody = responseEntity.getBody();
+        System.out.println(responseBody);
+
+    }
+
+
+    public static String request(String httpUrl, String httpArg) {
+        BufferedReader reader = null;
+        String result = null;
+        StringBuffer sbf = new StringBuffer();
+        httpUrl = httpUrl + "?" + httpArg;
+        try {
+            URL url = new URL(httpUrl);
+            HttpURLConnection connection = (HttpURLConnection) url
+                    .openConnection();
+            connection.setRequestMethod("GET");
+            connection.connect();
+            InputStream is = connection.getInputStream();
+            reader = new BufferedReader(new InputStreamReader(is, "UTF-8"));
+            String strRead = null;
+            while ((strRead = reader.readLine()) != null) {
+                sbf.append(strRead);
+                sbf.append("\r\n");
+            }
+            reader.close();
+            result = sbf.toString();
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+        return result;
+    }
+}
+

+ 191 - 0
huimv.nongke.secure/huimv.nongke.secure/src/main/java/com/huimv/secure/common/utils/SnowflakeSequence.java

@@ -0,0 +1,191 @@
+package com.huimv.secure.common.utils;
+
+import java.lang.management.ManagementFactory;
+import java.net.InetAddress;
+import java.net.NetworkInterface;
+
+/**
+ * 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左右。
+ */
+public class SnowflakeSequence {
+    // ==============================Fields===========================================
+    /** 开始时间截 (2017/11/29 18:25:29) */
+    private final long twepoch = 1511951129000L;
+
+    /** 机器id所占的位数 */
+    private final long workerIdBits = 5L;
+
+    /** 数据标识id所占的位数 */
+    private final long datacenterIdBits = 5L;
+
+    /** 支持的最大机器id,结果是31 (这个移位算法可以很快的计算出几位二进制数所能表示的最大十进制数) */
+    private final long maxWorkerId = -1L ^ (-1L << workerIdBits);
+
+    /** 支持的最大数据标识id,结果是31 */
+    private final long maxDatacenterId = -1L ^ (-1L << datacenterIdBits);
+
+    /** 序列在id中占的位数 */
+    private final long sequenceBits = 12L;
+
+    /** 机器ID向左移12位 */
+    private final long workerIdShift = sequenceBits;
+
+    /** 数据标识id向左移17位(12+5) */
+    private final long datacenterIdShift = sequenceBits + workerIdBits;
+
+    /** 时间截向左移22位(5+5+12) */
+    private final long timestampLeftShift = sequenceBits + workerIdBits + datacenterIdBits;
+
+    /** 生成序列的掩码,这里为4095 (0b111111111111=0xfff=4095) */
+    private final long sequenceMask = -1L ^ (-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;
+
+    //==============================构造函数=====================================
+    //根据mac地址产生datacenterid
+    public SnowflakeSequence() {
+        datacenterId = getDatacenterId(maxDatacenterId);
+        workerId = getMaxWorkerId(datacenterId, maxWorkerId);
+//        System.out.println("datacenterId:" + datacenterId + ",workerId:" + workerId);
+    }
+
+    /**
+     * 构造函数
+     * @param workerId 工作ID (0~31)
+     * @param datacenterId 数据中心ID (0~31)
+     */
+    public SnowflakeSequence(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;
+    }
+
+    // ==============================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 - twepoch) << 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();
+    }
+
+    /**
+     * <p>
+     * 数据标识id部分
+     * </p>
+     * @param maxDatacenterId
+     * @return
+     */
+    protected static long getDatacenterId(long maxDatacenterId) {
+        long id = 0L;
+        try {
+            InetAddress ip = InetAddress.getLocalHost();
+            NetworkInterface network = NetworkInterface.getByInetAddress(ip);
+            if (network == null) {
+                id = 1L;
+            } else {
+                byte[] mac = network.getHardwareAddress();
+                if (null != mac) {
+                    id = ((0x000000FF & (long) mac[mac.length - 1]) | (0x0000FF00 & (((long) mac[mac.length - 2]) << 8))) >> 6;
+                    id = id % (maxDatacenterId + 1);
+                }
+            }
+        } catch (Exception e) {
+            System.err.println(" getDatacenterId: " + e.getMessage());
+        }
+        return id;
+    }
+
+    /**
+     * 获取 maxWorkerId
+     * @param datacenterId   数据中心id
+     * @param maxWorkerId    机器id
+     * @return  maxWorkerId
+     */
+    protected static long getMaxWorkerId(long datacenterId, long maxWorkerId) {
+        StringBuilder mpid = new StringBuilder();
+        mpid.append(datacenterId);
+        String name = ManagementFactory.getRuntimeMXBean().getName();
+        if (name != null && "".equals(name)) {
+            // GET jvmPid
+            mpid.append(name.split("@")[0]);
+        }
+        //MAC + PID 的 hashcode 获取16个低位
+        return (mpid.toString().hashCode() & 0xffff) % (maxWorkerId + 1);
+    }
+
+}

+ 44 - 0
huimv.nongke.secure/huimv.nongke.secure/src/main/java/com/huimv/secure/common/utils/StringUtilsWork.java

@@ -0,0 +1,44 @@
+package com.huimv.secure.common.utils;
+
+/**
+ * @Author Anchor
+ * @Date 2021/7/30 13:17
+ * @Version 1.0.1
+ */
+public class StringUtilsWork {
+
+
+    public static boolean isEmpty(String str) {
+        return str == null || str.length() == 0;
+    }
+
+    public static boolean isNotEmpty(String str) {
+        return !isEmpty(str);
+    }
+
+    public static boolean isBlank(String str) {
+        int strLen;
+        if (str != null && (strLen = str.length()) != 0) {
+            for(int i = 0; i < strLen; ++i) {
+                if (!Character.isWhitespace(str.charAt(i))) {
+                    return false;
+                }
+            }
+
+            return true;
+        } else {
+            return true;
+        }
+    }
+
+    public static boolean isNotBlank(String str) {
+        return !isBlank(str);
+    }
+
+
+}
+
+
+
+
+

+ 184 - 0
huimv.nongke.secure/huimv.nongke.secure/src/main/java/com/huimv/secure/common/utils/UploadImage.java

@@ -0,0 +1,184 @@
+package com.huimv.secure.common.utils;
+
+import cn.hutool.core.date.DateUtil;
+import cn.hutool.core.lang.UUID;
+import com.jcraft.jsch.*;
+import org.springframework.beans.factory.annotation.Value;
+import org.springframework.stereotype.Component;
+import org.springframework.util.StringUtils;
+import org.springframework.web.multipart.MultipartFile;
+
+import javax.imageio.ImageIO;
+import java.awt.*;
+import java.awt.image.BufferedImage;
+import java.io.*;
+import java.util.Date;
+
+@Component
+public class UploadImage {
+
+    @Value("${img.basePath}")
+    private   String basePath;
+
+    @Value("${img.ip}")
+    private    String ip ;
+//    private   String ip = "36.134.209.211";
+//    private   String ip = "192.168.0.13";
+
+    @Value("${img.user}")
+    private  String user ;
+
+//    private   String password = "!Hm537e@1";
+
+    @Value("${img.password}")
+    private   String password ;
+
+    @Value("${img.port}")
+    public   Integer port ;
+
+    @Value("${img.url}")
+    public   String url ;
+
+
+
+    /**
+     * 利用JSch包实现SFTP上传文件
+     * @param bytes  文件字节流
+     * @param fileName  文件名
+     * @throws Exception
+     */
+    public   void sshSftp(byte[] bytes,String path,String fileName) throws Exception{
+
+        // 服务器保存路径
+        String filepath = basePath +path ;
+        Session session = null;
+        Channel channel = null;
+
+        JSch jSch = new JSch();
+
+        if(port <=0){
+            //连接服务器,采用默认端口
+            session = jSch.getSession(user, ip);
+        }else{
+            //采用指定的端口连接服务器
+            session = jSch.getSession(user, ip ,port);
+        }
+
+        //如果服务器连接不上,则抛出异常
+        if (session == null) {
+            throw new Exception("session is null");
+        }
+
+        //设置登陆主机的密码
+        session.setPassword(password);//设置密码
+        //设置第一次登陆的时候提示,可选值:(ask | yes | no)
+        session.setConfig("userauth.gssapi-with-mic","no");
+        session.setConfig("StrictHostKeyChecking", "no");
+        //设置登陆超时时间
+        session.connect(30000);
+
+        OutputStream outstream = null;
+        try {
+            //创建sftp通信通道
+            channel = (Channel) session.openChannel("sftp");
+            channel.connect(1000);
+            ChannelSftp sftp = (ChannelSftp) channel;
+
+            //进入服务器指定的文件夹
+            sftp.cd(basePath);
+
+            SftpATTRS attrs = null;
+            try {
+                attrs = sftp.stat(filepath);
+            } catch (Exception e) {
+                // TODO: handle exception
+            }
+            if (attrs == null) {
+                sftp.mkdir(filepath);
+                System.out.println(("创建子目录:" + filepath));
+            }
+            sftp.cd(filepath);
+
+            //以下代码实现从本地上传一个文件到服务器,如果要实现下载,对换一下流就可以了
+            outstream = sftp.put(fileName);
+            outstream.write(bytes);
+
+        } catch (Exception e) {
+            e.printStackTrace();
+        } finally {
+            //关流操作
+            if (outstream != null) {
+                outstream.flush();
+                outstream.close();
+            }
+            if (session != null) {
+                session.disconnect();
+            }
+            if (channel != null) {
+                channel.disconnect();
+            }
+            System.out.println("上传成功!");
+        }
+    }
+
+    //上传压缩的图片
+    public  String getImageCom(MultipartFile image) throws IOException {
+        //获取文件输入流
+        InputStream inputStream = image.getInputStream();
+        String originalFilename = image.getOriginalFilename();
+        String filenameExtension = StringUtils.getFilenameExtension(originalFilename);
+        String path = DateUtil.format(new Date(), "yyyy-MM");
+
+        try {
+            // 把图片读入到内存中
+            BufferedImage bufImg = ImageIO.read(inputStream);
+            // 压缩代码,存储图片文件byte数组
+            ByteArrayOutputStream bos = new ByteArrayOutputStream();
+            //防止图片变红,这一步非常重要
+            BufferedImage bufferedImage = new BufferedImage(bufImg.getWidth(), bufImg.getHeight(), BufferedImage.TYPE_INT_RGB);
+            bufferedImage.createGraphics().drawImage(bufImg,0,0, Color.WHITE,null);
+            //先转成jpg格式来压缩,然后在通过OSS来修改成源文件本来的后缀格式
+            ImageIO.write(bufferedImage,"jpg",bos);
+            byte[] bytes = bos.toByteArray();
+            String imgname = UUID.randomUUID() + "." + filenameExtension;
+            sshSftp(bytes, path, imgname);
+            return url+ path + "/" + imgname;
+        } catch (Exception e) {
+            e.printStackTrace();
+            return "上传失败";
+        } finally {
+            inputStream.close();
+        }
+    }
+
+
+    //上传原图
+    public  String uploadImg( MultipartFile image ) {
+        String originalFilename = image.getOriginalFilename();
+        String filenameExtension = StringUtils.getFilenameExtension(originalFilename);
+        String path = DateUtil.format(new Date(), "yyyy-MM");
+        try {
+            InputStream inputStream = image.getInputStream();
+            BufferedInputStream in = new BufferedInputStream(inputStream);
+            ByteArrayOutputStream out = new ByteArrayOutputStream(1024);
+
+            byte[] temp = new byte[1024];
+            int size = 0;
+            while ((size = in.read(temp)) != -1) {
+                out.write(temp, 0, size);
+            }
+            in.close();
+            byte[] content = out.toByteArray();
+            String imgname = UUID.randomUUID() + "." + filenameExtension;
+            sshSftp(content, path, imgname);
+            return url + path + "/" + imgname;
+        } catch (Exception e) {
+            e.printStackTrace();
+            return "上传失败";
+        }
+    }
+
+}
+
+
+

+ 122 - 0
huimv.nongke.secure/huimv.nongke.secure/src/main/java/com/huimv/secure/common/utils/VerifyUtil.java

@@ -0,0 +1,122 @@
+package com.huimv.secure.common.utils;
+
+
+
+
+import com.huimv.secure.common.exception.ExceptionEnum;
+import com.huimv.secure.common.exception.MiException;
+
+import javax.imageio.ImageIO;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import java.awt.*;
+import java.awt.image.BufferedImage;
+import java.util.Random;
+
+
+public class VerifyUtil {
+//    public static final String RANDOMCODEKEY = "RANDOMREDISKEY";//放到session中的key
+    private String randString = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ";//随机产生数字与字母组合的字符串
+    private int width = 95;// 图片宽
+    private int height = 50;// 图片高
+    private int lineSize = 40;// 干扰线数量
+    private int stringNum = 4;// 随机产生字符数量
+
+    private Random random = new Random();
+
+    /**
+     * 获得字体
+     */
+    private Font getFont() {
+        return new Font("Fixedsys", Font.CENTER_BASELINE, 25);
+    }
+
+    /**
+     * 获得颜色
+     */
+    private Color getRandColor(int fc, int bc) {
+        if (fc > 255) {
+            fc = 255;
+        }
+        if (bc > 255) {
+            bc = 255;
+        }
+        int r = fc + random.nextInt(bc - fc - 16);
+        int g = fc + random.nextInt(bc - fc - 14);
+        int b = fc + random.nextInt(bc - fc - 18);
+        return new Color(r, g, b);
+    }
+
+    /**
+     * 生成随机图片
+     */
+    public String getRandcode(HttpServletRequest request, HttpServletResponse response) {
+        // BufferedImage类是具有缓冲区的Image类,Image类是用于描述图像信息的类
+        BufferedImage image = new BufferedImage(width, height, BufferedImage.TYPE_INT_BGR);
+        // 产生Image对象的Graphics对象,改对象可以在图像上进行各种绘制操作
+        Graphics g = image.getGraphics();
+        //图片大小
+        g.fillRect(0, 0, width, height);
+        //字体大小
+        g.setFont(new Font("Times New Roman", Font.ROMAN_BASELINE, 50));
+        //字体颜色
+        g.setColor(getRandColor(110, 133));
+        // 绘制干扰线
+        for (int i = 0; i <= lineSize; i++) {
+            drowLine(g);
+        }
+        // 绘制随机字符
+        String randomString = "";
+        for (int i = 1; i <= stringNum; i++) {
+            randomString = drowString(g, randomString, i);
+        }
+        //将生成的随机字符串保存到session中
+//        session.removeAttribute(RANDOMCODEKEY);
+//        session.setAttribute(RANDOMCODEKEY, randomString);
+        //设置失效时间1分钟
+//        session.setMaxInactiveInterval(60);
+        g.dispose();
+        try {
+            // 将内存中的图片通过流动形式输出到客户端
+            ImageIO.write(image, "JPEG", response.getOutputStream());
+            return randomString;
+        } catch (Exception e) {
+            throw new MiException(ExceptionEnum.VERIFCATION_FAID);
+        }
+
+    }
+
+    /**
+     * 绘制字符串
+     */
+    private String drowString(Graphics g, String randomString, int i) {
+        g.setFont(getFont());
+        g.setColor(new Color(random.nextInt(101), random.nextInt(111), random
+                .nextInt(121)));
+        String rand = String.valueOf(getRandomString(random.nextInt(randString
+                .length())));
+        randomString += rand;
+        g.translate(random.nextInt(3), random.nextInt(3));
+        g.drawString(rand, 13 * i, 33);
+        return randomString;
+    }
+
+    /**
+     * 绘制干扰线
+     */
+    private void drowLine(Graphics g) {
+        int x = random.nextInt(width);
+        int y = random.nextInt(height);
+        int xl = random.nextInt(13);
+        int yl = random.nextInt(15);
+        g.drawLine(x, y, x + xl, y + yl);
+    }
+
+    /**
+     * 获取随机的字符
+     */
+    public String getRandomString(int num) {
+        return String.valueOf(randString.charAt(num));
+    }
+}
+ 

+ 16 - 0
huimv.nongke.secure/huimv.nongke.secure/src/main/java/com/huimv/secure/config/ApiPrefixAutoConfiguration.java

@@ -0,0 +1,16 @@
+package com.huimv.secure.config;
+
+import org.springframework.context.annotation.Configuration;
+import org.springframework.web.bind.annotation.RestController;
+import org.springframework.web.servlet.config.annotation.PathMatchConfigurer;
+import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
+
+@Configuration
+public class ApiPrefixAutoConfiguration implements WebMvcConfigurer {
+
+    @Override
+    public void configurePathMatch(PathMatchConfigurer configurer) {
+        configurer.addPathPrefix("/secureApi",  c -> c.isAnnotationPresent(RestController.class));
+    }
+
+}

+ 34 - 0
huimv.nongke.secure/huimv.nongke.secure/src/main/java/com/huimv/secure/config/DistributedLockManager.java

@@ -0,0 +1,34 @@
+package com.huimv.secure.config;//package com.huimv.receive.config;
+//
+//import org.springframework.beans.factory.annotation.Autowired;
+//import org.springframework.data.redis.core.RedisTemplate;
+//import org.springframework.stereotype.Component;
+//import java.util.concurrent.TimeUnit;
+//
+//@Component
+//public class DistributedLockManager {
+//
+//    @Autowired
+//    private RedisTemplate<String, String> redisTemplate;
+//
+//    public boolean acquireLock(String lockKey, String lockValue, long expireTimeInSeconds) {
+//        // 使用 SETNX 命令尝试获取锁
+//        Boolean isLockAcquired = redisTemplate.opsForValue().setIfAbsent(lockKey, lockValue);
+//
+//        if (isLockAcquired != null && isLockAcquired) {
+//            // 设置锁的过期时间,以防止锁被长时间占用
+//            redisTemplate.expire(lockKey, expireTimeInSeconds, TimeUnit.SECONDS);
+//            return true; // 获取锁成功
+//        } else {
+//            return false; // 获取锁失败
+//        }
+//    }
+//
+//    public void releaseLock(String lockKey, String lockValue) {
+//        String storedLockValue = redisTemplate.opsForValue().get(lockKey);
+//        if (lockValue.equals(storedLockValue)) {
+//            // 如果锁的值匹配,释放锁
+//            redisTemplate.delete(lockKey);
+//        }
+//    }
+//}

+ 76 - 0
huimv.nongke.secure/huimv.nongke.secure/src/main/java/com/huimv/secure/config/InterceptorConfig.java

@@ -0,0 +1,76 @@
+
+package com.huimv.secure.config;
+
+import org.springframework.context.annotation.Bean;
+import org.springframework.context.annotation.Configuration;
+import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
+import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
+
+/**
+ * @Description: 注册验证tocken的拦截器
+ * @Author
+ * @Date 2021/4/19 20:41
+ * @Version V1.0
+ */
+@Configuration
+public class InterceptorConfig implements WebMvcConfigurer {
+    @Bean
+    public JWTInterceptor jwtInterceptor(){
+        return new JWTInterceptor();
+    }
+
+    @Override
+    public void addInterceptors(InterceptorRegistry registry) {
+        registry.addInterceptor(jwtInterceptor()).
+                excludePathPatterns("/secureApi/admin/my/*","/secureApi/bill-access-door/getDoorData","/secureApi/bill-gate/getGateData")
+                .excludePathPatterns("/secureApi/receive/feed","/secureApi/bill-personnel-admission/printAdmission"
+                        ,"/secureApi/bill-personnel-admission/printAdmission"
+                        ,"/secureApi/bill-pcr/printPcr"
+                        ,"/secureApi/bill-clean/printClean"
+                        ,"/secureApi/bill-isolate/printIsolate"
+                        ,"/secureApi/bill-luggage/printLuggage"
+                        ,"/secureApi/admin/user/printUser"
+                        ,"/secureApi/admin/accountMultilevel/printAccount"
+                        ,"/secureApi/base-device/printDevice"
+                        ,"/secureApi/bill-personnel-admission/listDoor"
+
+                        //后台统计接口开放
+                        ,"/secureApi/bill-personnel-admission/countAdmission"
+                        ,"/secureApi/bill-personnel-admission/listTop"
+                        ,"/secureApi/bill-personnel-admission/admissionTail"
+                        ,"/secureApi/bill-personnel-admission/selectList"
+                        ,"/secureApi/bill-personnel-admission/uploadImgAndAdmissin"
+                        ,"/secureApi/bill-personnel-admission/delete"
+
+                        ,"/secureApi/bill-pcr/pcrWhole"
+                        ,"/secureApi/bill-pcr/listType"
+                        ,"/secureApi/bill-pcr/listLocation"
+                        ,"/secureApi/bill-pcr/listAll"
+                        ,"/secureApi/bill-pcr/selectList"
+                        ,"/secureApi/bill-pcr/delete"
+
+
+                        ,"/secureApi/bill-clean/listCount"
+                        ,"/secureApi/bill-clean/allList"
+                        ,"/secureApi/bill-clean/CleanSelect"
+                        ,"/secureApi/bill-clean/delete"
+                        ,"/secureApi/bill-clean/listScreen"
+
+
+                        ,"/secureApi/bill-isolate/isolateList"
+                        ,"/secureApi/bill-isolate/isolateSelect"
+                        ,"/secureApi/bill-isolate/delete"
+
+                        ,"/secureApi/bill-luggage/listLuggage"
+                        ,"/secureApi/bill-luggage/selectLuggage"
+                        ,"/secureApi/bill-luggage/delete"
+
+
+
+
+                        ,"/secureApi/bill-personnel-admission/jingJiAdmission"
+                        ,"/secureApi/bill-personnel-admission/allCount"
+                        ,"/secureApi/bill-pcr/pcrList"
+                        ,"/secureApi/bill-goods-inventory/listAll");
+    }
+}

+ 82 - 0
huimv.nongke.secure/huimv.nongke.secure/src/main/java/com/huimv/secure/config/JWTInterceptor.java

@@ -0,0 +1,82 @@
+package com.huimv.secure.config;
+
+import com.alibaba.fastjson.JSONObject;
+import com.huimv.secure.common.token.TokenConstant;
+import com.huimv.secure.common.token.TokenSign;
+import io.jsonwebtoken.Claims;
+import org.springframework.web.method.HandlerMethod;
+import org.springframework.web.servlet.HandlerInterceptor;
+import org.springframework.web.servlet.ModelAndView;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import java.util.HashMap;
+import java.util.Map;
+
+/**
+ * <p>
+ * jwt拦截器
+ * </p>
+ *
+ * @since 2021/4/19
+ */
+public class JWTInterceptor implements HandlerInterceptor {
+
+
+    @Override
+    public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception {
+        // 如果不是映射到方法,则直接通过
+        if (!(handler instanceof HandlerMethod)) {
+            return true;
+        }
+
+        response.setContentType("application/json;charset=utf-8");
+        // 获取token
+        String token = request.getHeader("accessToken");
+
+
+        if (null == token) {
+            Map<String, Object> map = new HashMap<>();
+            map.put("data", "token is null");
+            map.put("code", "401");
+            response.setStatus(401);
+            response.getWriter().write(JSONObject.toJSONString(map));
+            return false;
+        } else {
+            Claims claims = TokenSign.getClaims(token);
+            if (claims == null) {
+                Map<String, Object> map = new HashMap<>();
+                map.put("data", "token is overdue");
+                map.put("code", "403");
+                response.setStatus(403);
+                response.getWriter().write(JSONObject.toJSONString(map));
+                return false;
+            }
+
+            boolean result = TokenSign.verify(token);
+            if (result) {
+                //更新存储的token信息
+                TokenConstant.updateTokenMap(token);
+                return true;
+            }
+            Map<String, Object> map = new HashMap<>();
+            map.put("data", "token is null");
+            map.put("code", "401");
+            response.setStatus(401);
+            response.getWriter().write(JSONObject.toJSONString(map));
+            return false;
+
+        }
+    }
+
+
+    @Override
+    public void postHandle(HttpServletRequest request, HttpServletResponse response, Object handler, ModelAndView modelAndView) throws Exception {
+
+    }
+
+    @Override
+    public void afterCompletion(HttpServletRequest request, HttpServletResponse response, Object handler, Exception ex) throws Exception {
+
+    }
+}

+ 26 - 0
huimv.nongke.secure/huimv.nongke.secure/src/main/java/com/huimv/secure/config/MybatisPlusConfig.java

@@ -0,0 +1,26 @@
+package com.huimv.secure.config;
+
+import com.baomidou.mybatisplus.annotation.DbType;
+import com.baomidou.mybatisplus.extension.plugins.MybatisPlusInterceptor;
+import com.baomidou.mybatisplus.extension.plugins.inner.PaginationInnerInterceptor;
+import org.springframework.context.annotation.Bean;
+import org.springframework.context.annotation.Configuration;
+
+@Configuration
+public class MybatisPlusConfig {
+
+    /**
+     * 分页插件
+     */
+//    @Bean
+//    public PaginationInterceptor paginationInterceptor() {
+//        return new PaginationInterceptor();
+//    }
+
+    @Bean
+    public MybatisPlusInterceptor mybatisPlusInterceptor() {
+        MybatisPlusInterceptor interceptor = new MybatisPlusInterceptor();
+        interceptor.addInnerInterceptor(new PaginationInnerInterceptor(DbType.MYSQL));
+        return interceptor;
+    }
+}

+ 20 - 0
huimv.nongke.secure/huimv.nongke.secure/src/main/java/com/huimv/secure/controller/AgeRangesController.java

@@ -0,0 +1,20 @@
+package com.huimv.secure.controller;
+
+
+import org.springframework.web.bind.annotation.RequestMapping;
+
+import org.springframework.web.bind.annotation.RestController;
+
+/**
+ * <p>
+ *  前端控制器
+ * </p>
+ *
+ * @author author
+ * @since 2024-01-03
+ */
+@RestController
+@RequestMapping("/age-ranges")
+public class AgeRangesController {
+
+}

+ 20 - 0
huimv.nongke.secure/huimv.nongke.secure/src/main/java/com/huimv/secure/controller/BaseDeviceController.java

@@ -0,0 +1,20 @@
+package com.huimv.secure.controller;
+
+
+import org.springframework.web.bind.annotation.RequestMapping;
+
+import org.springframework.web.bind.annotation.RestController;
+
+/**
+ * <p>
+ *  前端控制器
+ * </p>
+ *
+ * @author author
+ * @since 2024-01-03
+ */
+@RestController
+@RequestMapping("/base-device")
+public class BaseDeviceController {
+
+}

+ 20 - 0
huimv.nongke.secure/huimv.nongke.secure/src/main/java/com/huimv/secure/controller/BaseFarmController.java

@@ -0,0 +1,20 @@
+package com.huimv.secure.controller;
+
+
+import org.springframework.web.bind.annotation.RequestMapping;
+
+import org.springframework.web.bind.annotation.RestController;
+
+/**
+ * <p>
+ *  前端控制器
+ * </p>
+ *
+ * @author author
+ * @since 2024-01-03
+ */
+@RestController
+@RequestMapping("/base-farm")
+public class BaseFarmController {
+
+}

+ 20 - 0
huimv.nongke.secure/huimv.nongke.secure/src/main/java/com/huimv/secure/controller/BaseLocationController.java

@@ -0,0 +1,20 @@
+package com.huimv.secure.controller;
+
+
+import org.springframework.web.bind.annotation.RequestMapping;
+
+import org.springframework.web.bind.annotation.RestController;
+
+/**
+ * <p>
+ *  前端控制器
+ * </p>
+ *
+ * @author author
+ * @since 2024-01-03
+ */
+@RestController
+@RequestMapping("/base-location")
+public class BaseLocationController {
+
+}

+ 20 - 0
huimv.nongke.secure/huimv.nongke.secure/src/main/java/com/huimv/secure/controller/BaseProcessController.java

@@ -0,0 +1,20 @@
+package com.huimv.secure.controller;
+
+
+import org.springframework.web.bind.annotation.RequestMapping;
+
+import org.springframework.web.bind.annotation.RestController;
+
+/**
+ * <p>
+ * 流程表 前端控制器
+ * </p>
+ *
+ * @author author
+ * @since 2024-01-03
+ */
+@RestController
+@RequestMapping("/base-process")
+public class BaseProcessController {
+
+}

+ 20 - 0
huimv.nongke.secure/huimv.nongke.secure/src/main/java/com/huimv/secure/controller/BillAccessDoorController.java

@@ -0,0 +1,20 @@
+package com.huimv.secure.controller;
+
+
+import org.springframework.web.bind.annotation.RequestMapping;
+
+import org.springframework.web.bind.annotation.RestController;
+
+/**
+ * <p>
+ * 车辆闸机信息记录 前端控制器
+ * </p>
+ *
+ * @author author
+ * @since 2024-01-03
+ */
+@RestController
+@RequestMapping("/bill-access-door")
+public class BillAccessDoorController {
+
+}

+ 20 - 0
huimv.nongke.secure/huimv.nongke.secure/src/main/java/com/huimv/secure/controller/BillCleanController.java

@@ -0,0 +1,20 @@
+package com.huimv.secure.controller;
+
+
+import org.springframework.web.bind.annotation.RequestMapping;
+
+import org.springframework.web.bind.annotation.RestController;
+
+/**
+ * <p>
+ * 洗消表 前端控制器
+ * </p>
+ *
+ * @author author
+ * @since 2024-01-03
+ */
+@RestController
+@RequestMapping("/bill-clean")
+public class BillCleanController {
+
+}

+ 20 - 0
huimv.nongke.secure/huimv.nongke.secure/src/main/java/com/huimv/secure/controller/BillGateController.java

@@ -0,0 +1,20 @@
+package com.huimv.secure.controller;
+
+
+import org.springframework.web.bind.annotation.RequestMapping;
+
+import org.springframework.web.bind.annotation.RestController;
+
+/**
+ * <p>
+ * 车辆闸机信息记录 前端控制器
+ * </p>
+ *
+ * @author author
+ * @since 2024-01-03
+ */
+@RestController
+@RequestMapping("/bill-gate")
+public class BillGateController {
+
+}

+ 20 - 0
huimv.nongke.secure/huimv.nongke.secure/src/main/java/com/huimv/secure/controller/BillGoodsInventoryController.java

@@ -0,0 +1,20 @@
+package com.huimv.secure.controller;
+
+
+import org.springframework.web.bind.annotation.RequestMapping;
+
+import org.springframework.web.bind.annotation.RestController;
+
+/**
+ * <p>
+ *  前端控制器
+ * </p>
+ *
+ * @author author
+ * @since 2024-01-03
+ */
+@RestController
+@RequestMapping("/bill-goods-inventory")
+public class BillGoodsInventoryController {
+
+}

+ 20 - 0
huimv.nongke.secure/huimv.nongke.secure/src/main/java/com/huimv/secure/controller/BillLuggageController.java

@@ -0,0 +1,20 @@
+package com.huimv.secure.controller;
+
+
+import org.springframework.web.bind.annotation.RequestMapping;
+
+import org.springframework.web.bind.annotation.RestController;
+
+/**
+ * <p>
+ *  前端控制器
+ * </p>
+ *
+ * @author author
+ * @since 2024-01-03
+ */
+@RestController
+@RequestMapping("/bill-luggage")
+public class BillLuggageController {
+
+}

+ 20 - 0
huimv.nongke.secure/huimv.nongke.secure/src/main/java/com/huimv/secure/controller/BillPcrController.java

@@ -0,0 +1,20 @@
+package com.huimv.secure.controller;
+
+
+import org.springframework.web.bind.annotation.RequestMapping;
+
+import org.springframework.web.bind.annotation.RestController;
+
+/**
+ * <p>
+ * pcr 表 前端控制器
+ * </p>
+ *
+ * @author author
+ * @since 2024-01-03
+ */
+@RestController
+@RequestMapping("/bill-pcr")
+public class BillPcrController {
+
+}

+ 20 - 0
huimv.nongke.secure/huimv.nongke.secure/src/main/java/com/huimv/secure/controller/BillPersonnelAdmissionController.java

@@ -0,0 +1,20 @@
+package com.huimv.secure.controller;
+
+
+import org.springframework.web.bind.annotation.RequestMapping;
+
+import org.springframework.web.bind.annotation.RestController;
+
+/**
+ * <p>
+ * 入场申请 前端控制器
+ * </p>
+ *
+ * @author author
+ * @since 2024-01-03
+ */
+@RestController
+@RequestMapping("/bill-personnel-admission")
+public class BillPersonnelAdmissionController {
+
+}

+ 20 - 0
huimv.nongke.secure/huimv.nongke.secure/src/main/java/com/huimv/secure/controller/ConfigurationController.java

@@ -0,0 +1,20 @@
+package com.huimv.secure.controller;
+
+
+import org.springframework.web.bind.annotation.RequestMapping;
+
+import org.springframework.web.bind.annotation.RestController;
+
+/**
+ * <p>
+ *  前端控制器
+ * </p>
+ *
+ * @author author
+ * @since 2024-01-03
+ */
+@RestController
+@RequestMapping("/configuration")
+public class ConfigurationController {
+
+}

+ 20 - 0
huimv.nongke.secure/huimv.nongke.secure/src/main/java/com/huimv/secure/controller/DeviceListController.java

@@ -0,0 +1,20 @@
+package com.huimv.secure.controller;
+
+
+import org.springframework.web.bind.annotation.RequestMapping;
+
+import org.springframework.web.bind.annotation.RestController;
+
+/**
+ * <p>
+ * 车辆闸机和人脸门禁设备列表 前端控制器
+ * </p>
+ *
+ * @author author
+ * @since 2024-01-03
+ */
+@RestController
+@RequestMapping("/device-list")
+public class DeviceListController {
+
+}

+ 20 - 0
huimv.nongke.secure/huimv.nongke.secure/src/main/java/com/huimv/secure/controller/ExistController.java

@@ -0,0 +1,20 @@
+package com.huimv.secure.controller;
+
+
+import org.springframework.web.bind.annotation.RequestMapping;
+
+import org.springframework.web.bind.annotation.RestController;
+
+/**
+ * <p>
+ *  前端控制器
+ * </p>
+ *
+ * @author author
+ * @since 2024-01-03
+ */
+@RestController
+@RequestMapping("/exist")
+public class ExistController {
+
+}

+ 20 - 0
huimv.nongke.secure/huimv.nongke.secure/src/main/java/com/huimv/secure/controller/PeopleListController.java

@@ -0,0 +1,20 @@
+package com.huimv.secure.controller;
+
+
+import org.springframework.web.bind.annotation.RequestMapping;
+
+import org.springframework.web.bind.annotation.RestController;
+
+/**
+ * <p>
+ * 人脸门禁车辆闸机白名单 前端控制器
+ * </p>
+ *
+ * @author author
+ * @since 2024-01-03
+ */
+@RestController
+@RequestMapping("/people-list")
+public class PeopleListController {
+
+}

+ 20 - 0
huimv.nongke.secure/huimv.nongke.secure/src/main/java/com/huimv/secure/controller/SysAccountGroupController.java

@@ -0,0 +1,20 @@
+package com.huimv.secure.controller;
+
+
+import org.springframework.web.bind.annotation.RequestMapping;
+
+import org.springframework.web.bind.annotation.RestController;
+
+/**
+ * <p>
+ *  前端控制器
+ * </p>
+ *
+ * @author author
+ * @since 2024-01-03
+ */
+@RestController
+@RequestMapping("/sys-account-group")
+public class SysAccountGroupController {
+
+}

+ 20 - 0
huimv.nongke.secure/huimv.nongke.secure/src/main/java/com/huimv/secure/controller/SysAccountMultilevelController.java

@@ -0,0 +1,20 @@
+package com.huimv.secure.controller;
+
+
+import org.springframework.web.bind.annotation.RequestMapping;
+
+import org.springframework.web.bind.annotation.RestController;
+
+/**
+ * <p>
+ *  前端控制器
+ * </p>
+ *
+ * @author author
+ * @since 2024-01-03
+ */
+@RestController
+@RequestMapping("/sys-account-multilevel")
+public class SysAccountMultilevelController {
+
+}

+ 20 - 0
huimv.nongke.secure/huimv.nongke.secure/src/main/java/com/huimv/secure/controller/SysGroupController.java

@@ -0,0 +1,20 @@
+package com.huimv.secure.controller;
+
+
+import org.springframework.web.bind.annotation.RequestMapping;
+
+import org.springframework.web.bind.annotation.RestController;
+
+/**
+ * <p>
+ *  前端控制器
+ * </p>
+ *
+ * @author author
+ * @since 2024-01-03
+ */
+@RestController
+@RequestMapping("/sys-group")
+public class SysGroupController {
+
+}

+ 20 - 0
huimv.nongke.secure/huimv.nongke.secure/src/main/java/com/huimv/secure/controller/SysGroupMenuController.java

@@ -0,0 +1,20 @@
+package com.huimv.secure.controller;
+
+
+import org.springframework.web.bind.annotation.RequestMapping;
+
+import org.springframework.web.bind.annotation.RestController;
+
+/**
+ * <p>
+ *  前端控制器
+ * </p>
+ *
+ * @author author
+ * @since 2024-01-03
+ */
+@RestController
+@RequestMapping("/sys-group-menu")
+public class SysGroupMenuController {
+
+}

+ 20 - 0
huimv.nongke.secure/huimv.nongke.secure/src/main/java/com/huimv/secure/controller/SysMenuController.java

@@ -0,0 +1,20 @@
+package com.huimv.secure.controller;
+
+
+import org.springframework.web.bind.annotation.RequestMapping;
+
+import org.springframework.web.bind.annotation.RestController;
+
+/**
+ * <p>
+ *  前端控制器
+ * </p>
+ *
+ * @author author
+ * @since 2024-01-03
+ */
+@RestController
+@RequestMapping("/sys-menu")
+public class SysMenuController {
+
+}

+ 20 - 0
huimv.nongke.secure/huimv.nongke.secure/src/main/java/com/huimv/secure/controller/SysUserController.java

@@ -0,0 +1,20 @@
+package com.huimv.secure.controller;
+
+
+import org.springframework.web.bind.annotation.RequestMapping;
+
+import org.springframework.web.bind.annotation.RestController;
+
+/**
+ * <p>
+ *  前端控制器
+ * </p>
+ *
+ * @author author
+ * @since 2024-01-03
+ */
+@RestController
+@RequestMapping("/sys-user")
+public class SysUserController {
+
+}

+ 30 - 0
huimv.nongke.secure/huimv.nongke.secure/src/main/java/com/huimv/secure/entity/AgeRanges.java

@@ -0,0 +1,30 @@
+package com.huimv.secure.entity;
+
+import com.baomidou.mybatisplus.annotation.TableName;
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableId;
+import java.io.Serializable;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.experimental.Accessors;
+
+/**
+ * <p>
+ * 
+ * </p>
+ *
+ * @author author
+ * @since 2024-01-03
+ */
+@Data
+@EqualsAndHashCode(callSuper = false)
+@Accessors(chain = true)
+@TableName("age_ranges")
+public class AgeRanges implements Serializable {
+
+    private static final long serialVersionUID = 1L;
+
+    private String ageRange;
+
+
+}

+ 74 - 0
huimv.nongke.secure/huimv.nongke.secure/src/main/java/com/huimv/secure/entity/BaseDevice.java

@@ -0,0 +1,74 @@
+package com.huimv.secure.entity;
+
+import com.baomidou.mybatisplus.annotation.TableName;
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableId;
+import java.time.LocalDateTime;
+import java.io.Serializable;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.experimental.Accessors;
+
+/**
+ * <p>
+ * 
+ * </p>
+ *
+ * @author author
+ * @since 2024-01-03
+ */
+@Data
+@EqualsAndHashCode(callSuper = false)
+@Accessors(chain = true)
+@TableName("base_device")
+public class BaseDevice implements Serializable {
+
+    private static final long serialVersionUID = 1L;
+
+    @TableId(value = "id", type = IdType.AUTO)
+    private Integer id;
+
+    /**
+     * 设备名字
+     */
+    private String deviceName;
+
+    /**
+     * 设备编号
+     */
+    private String deviceCode;
+
+    /**
+     * 0在线 1离线
+     */
+    private Integer deviceStatus;
+
+    /**
+     * 位置名称
+     */
+    private String workLocation;
+
+    /**
+     * 位置类型
+     */
+    private Integer workLocationType;
+
+    /**
+     * 用户姓名
+     */
+    private String userName;
+
+    /**
+     * 用户id
+     */
+    private Integer sysUserId;
+
+    /**
+     * 创建时间
+     */
+    private LocalDateTime createTime;
+
+    private Integer farmId;
+
+
+}

+ 45 - 0
huimv.nongke.secure/huimv.nongke.secure/src/main/java/com/huimv/secure/entity/BaseFarm.java

@@ -0,0 +1,45 @@
+package com.huimv.secure.entity;
+
+import com.baomidou.mybatisplus.annotation.TableName;
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableId;
+import java.io.Serializable;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.experimental.Accessors;
+
+/**
+ * <p>
+ * 
+ * </p>
+ *
+ * @author author
+ * @since 2024-01-03
+ */
+@Data
+@EqualsAndHashCode(callSuper = false)
+@Accessors(chain = true)
+@TableName("base_farm")
+public class BaseFarm implements Serializable {
+
+    private static final long serialVersionUID = 1L;
+
+    @TableId(value = "id", type = IdType.AUTO)
+    private Integer id;
+
+    private String farmName;
+
+    private String location;
+
+    private String frontLocation;
+
+    private Boolean rowStatus;
+
+    private String farmMenu;
+
+    private String farmTopMenu;
+
+    private String function;
+
+
+}

+ 67 - 0
huimv.nongke.secure/huimv.nongke.secure/src/main/java/com/huimv/secure/entity/BaseLocation.java

@@ -0,0 +1,67 @@
+package com.huimv.secure.entity;
+
+import com.baomidou.mybatisplus.annotation.TableName;
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableId;
+import java.io.Serializable;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.experimental.Accessors;
+
+/**
+ * <p>
+ * 
+ * </p>
+ *
+ * @author author
+ * @since 2024-01-03
+ */
+@Data
+@EqualsAndHashCode(callSuper = false)
+@Accessors(chain = true)
+@TableName("base_location")
+public class BaseLocation implements Serializable {
+
+    private static final long serialVersionUID = 1L;
+
+    @TableId(value = "id", type = IdType.AUTO)
+    private Integer id;
+
+    /**
+     * 名字
+     */
+    private String locationName;
+
+    private Integer farmId;
+
+    /**
+     * 1人员初级洗消站 2净区 3人员二级洗消站 4场内 5生产区 6车辆初级洗消站 7车辆二级洗消站 8中转料塔外围 9车辆三级洗消站 10销售中转站 11环保区洗消中心 12环保区净区 13洗消中心净区
+     */
+    private Integer locationType;
+
+    private Integer parentId;
+
+    private String parentIds;
+
+    /**
+     * 来访类型 0人员  1环保车 2拉猪车 3饲料车  4送猪车 5物资车  6送餐
+     */
+    private Integer vistitType;
+
+    /**
+     * 下一站
+     */
+    private Integer nextId;
+
+    /**
+     * 位置序号
+     */
+    private Integer serialNumber;
+
+    /**
+     * 下一站位置名称
+     */
+    private String nextLocation;
+
+
+}

+ 96 - 0
huimv.nongke.secure/huimv.nongke.secure/src/main/java/com/huimv/secure/entity/BaseProcess.java

@@ -0,0 +1,96 @@
+package com.huimv.secure.entity;
+
+import com.baomidou.mybatisplus.annotation.TableName;
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableId;
+import java.time.LocalDateTime;
+import java.io.Serializable;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.experimental.Accessors;
+
+/**
+ * <p>
+ * 流程表
+ * </p>
+ *
+ * @author author
+ * @since 2024-01-03
+ */
+@Data
+@EqualsAndHashCode(callSuper = false)
+@Accessors(chain = true)
+@TableName("base_process")
+public class BaseProcess implements Serializable {
+
+    private static final long serialVersionUID = 1L;
+
+    @TableId(value = "id", type = IdType.AUTO)
+    private Integer id;
+
+    /**
+     * 目的地
+     */
+    private String destName;
+
+    /**
+     * 目的地 id
+     */
+    private Integer destId;
+
+    /**
+     * 申请人
+     */
+    private String admissionUserName;
+
+    /**
+     * 申请人id
+     */
+    private Integer admissionUserId;
+
+    /**
+     * 提交时间
+     */
+    private LocalDateTime subDate;
+
+    /**
+     * 用,分割  修改时间
+     */
+    private String updateDate;
+
+    /**
+     * 用,分割  0进行中 1通过 2异常
+     */
+    private String currentStatus;
+
+    /**
+     * 用,分割  当前位置
+     */
+    private String currentLocation;
+
+    /**
+     * 用,分割  当前位置id
+     */
+    private String currentLocationId;
+
+    private Integer farmId;
+
+    /**
+     * 0 进行中,1已完成,2拒绝(提前结束)
+     */
+    private Integer processType;
+
+    /**
+     * 流程所有地点
+     */
+    private String allLocation;
+
+    private String allLocationId;
+
+    /**
+     * 0 未进行 1进行中 2已完成 3已拒绝
+     */
+    private String allLocationStatus;
+
+
+}

+ 66 - 0
huimv.nongke.secure/huimv.nongke.secure/src/main/java/com/huimv/secure/entity/BillAccessDoor.java

@@ -0,0 +1,66 @@
+package com.huimv.secure.entity;
+
+import com.baomidou.mybatisplus.annotation.TableName;
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableId;
+import java.time.LocalDateTime;
+import java.io.Serializable;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.experimental.Accessors;
+
+/**
+ * <p>
+ * 车辆闸机信息记录
+ * </p>
+ *
+ * @author author
+ * @since 2024-01-03
+ */
+@Data
+@EqualsAndHashCode(callSuper = false)
+@Accessors(chain = true)
+@TableName("bill_access_door")
+public class BillAccessDoor implements Serializable {
+
+    private static final long serialVersionUID = 1L;
+
+    @TableId(value = "id", type = IdType.AUTO)
+    private Integer id;
+
+    /**
+     * 0未通过 1通过
+     */
+    private Integer billStatus;
+
+    /**
+     * 检测时间
+     */
+    private LocalDateTime checkDate;
+
+    /**
+     * 检测地点
+     */
+    private String checkLocation;
+
+    private Integer locationId;
+
+    /**
+     * 照片
+     */
+    private String urlImg;
+
+    /**
+     * 用户id
+     */
+    private String userId;
+
+    /**
+     * 用户名称
+     */
+    private String userName;
+
+    private Integer farmId;
+
+
+}

+ 131 - 0
huimv.nongke.secure/huimv.nongke.secure/src/main/java/com/huimv/secure/entity/BillClean.java

@@ -0,0 +1,131 @@
+package com.huimv.secure.entity;
+
+import com.baomidou.mybatisplus.annotation.TableName;
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableId;
+import java.time.LocalDateTime;
+import java.io.Serializable;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.experimental.Accessors;
+
+/**
+ * <p>
+ * 洗消表
+ * </p>
+ *
+ * @author author
+ * @since 2024-01-03
+ */
+@Data
+@EqualsAndHashCode(callSuper = false)
+@Accessors(chain = true)
+@TableName("bill_clean")
+public class BillClean implements Serializable {
+
+    private static final long serialVersionUID = 1L;
+
+    @TableId(value = "id", type = IdType.AUTO)
+    private Integer id;
+
+    /**
+     * 来访类型 0人员  1环保车 2拉猪车 3饲料车  4送猪车 5物资车  6送餐
+     */
+    private Integer vistitType;
+
+    /**
+     * 目的地
+     */
+    private String destName;
+
+    /**
+     * 目的地 id
+     */
+    private Integer destId;
+
+    /**
+     * 申请人
+     */
+    private String admissionUserName;
+
+    /**
+     * 申请人id
+     */
+    private Integer admissionUserId;
+
+    /**
+     * 来访时间
+     */
+    private LocalDateTime vistitDate;
+
+    /**
+     * 提交时间
+     */
+    private LocalDateTime subDate;
+
+    private Integer farmId;
+
+    /**
+     * 当前状态 0待审批 1合格  2异常
+     */
+    private Integer billStatus;
+
+    /**
+     * 处理时间
+     */
+    private LocalDateTime passDate;
+
+    /**
+     * 处理人
+     */
+    private String passUserName;
+
+    /**
+     * 处理人id
+     */
+    private Integer passUserId;
+
+    /**
+     * 进程id
+     */
+    private Integer processId;
+
+    /**
+     * 检测时间
+     */
+    private LocalDateTime checkDate;
+
+    /**
+     * 检测地点
+     */
+    private String testLocation;
+
+    private Integer testLocationId;
+
+    /**
+     * 手机号
+     */
+    private String phone;
+
+    /**
+     * 车牌号
+     */
+    private String carNum;
+
+    /**
+     * 清洗照片
+     */
+    private String imgUrl;
+
+    /**
+     * 0 待上传 1已上传 
+     */
+    private Integer imgStatus;
+
+    /**
+     * 洗消时长
+     */
+    private String cleanTime;
+
+
+}

+ 71 - 0
huimv.nongke.secure/huimv.nongke.secure/src/main/java/com/huimv/secure/entity/BillGate.java

@@ -0,0 +1,71 @@
+package com.huimv.secure.entity;
+
+import com.baomidou.mybatisplus.annotation.TableName;
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableId;
+import java.time.LocalDateTime;
+import java.io.Serializable;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.experimental.Accessors;
+
+/**
+ * <p>
+ * 车辆闸机信息记录
+ * </p>
+ *
+ * @author author
+ * @since 2024-01-03
+ */
+@Data
+@EqualsAndHashCode(callSuper = false)
+@Accessors(chain = true)
+@TableName("bill_gate")
+public class BillGate implements Serializable {
+
+    private static final long serialVersionUID = 1L;
+
+    @TableId(value = "id", type = IdType.AUTO)
+    private Integer id;
+
+    /**
+     * 0未通过 1通过
+     */
+    private Integer billStatus;
+
+    /**
+     * 检测时间
+     */
+    private LocalDateTime checkDate;
+
+    /**
+     * 检测地点
+     */
+    private String checkLocation;
+
+    private Integer locationId;
+
+    /**
+     * 车牌
+     */
+    private String carNum;
+
+    /**
+     * 用户id
+     */
+    private String userId;
+
+    /**
+     * 用户名称
+     */
+    private String userName;
+
+    private Integer farmId;
+
+    /**
+     * 车牌照片
+     */
+    private String carUrl;
+
+
+}

+ 76 - 0
huimv.nongke.secure/huimv.nongke.secure/src/main/java/com/huimv/secure/entity/BillGoodsInventory.java

@@ -0,0 +1,76 @@
+package com.huimv.secure.entity;
+
+import com.baomidou.mybatisplus.annotation.TableName;
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableId;
+import java.time.LocalDateTime;
+import java.io.Serializable;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.experimental.Accessors;
+
+/**
+ * <p>
+ * 
+ * </p>
+ *
+ * @author author
+ * @since 2024-01-03
+ */
+@Data
+@EqualsAndHashCode(callSuper = false)
+@Accessors(chain = true)
+@TableName("bill_goods_inventory")
+public class BillGoodsInventory implements Serializable {
+
+    private static final long serialVersionUID = 1L;
+
+    @TableId(value = "id", type = IdType.AUTO)
+    private Integer id;
+
+    /**
+     * 物资类型 0蔬菜食材 1药品疫苗  2生产维修工具  3生活物资 4其它
+     */
+    private Integer goodsType;
+
+    /**
+     * 类型名
+     */
+    private String goodsTypeName;
+
+    /**
+     * 物资数量
+     */
+    private String goodsNums;
+
+    /**
+     * 物资名称
+     */
+    private String goodsName;
+
+    /**
+     * 申请单id
+     */
+    private Integer billAdmission;
+
+    /**
+     * 当前位置
+     */
+    private String currentLocation;
+
+    /**
+     * 当前位置 id
+     */
+    private Integer currentLocationId;
+
+    /**
+     * 物资单元
+     */
+    private String goodsUnit;
+
+    private LocalDateTime createDate;
+
+    private String farmId;
+
+
+}

+ 65 - 0
huimv.nongke.secure/huimv.nongke.secure/src/main/java/com/huimv/secure/entity/BillLuggage.java

@@ -0,0 +1,65 @@
+package com.huimv.secure.entity;
+
+import com.baomidou.mybatisplus.annotation.TableName;
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableId;
+import java.time.LocalDateTime;
+import java.io.Serializable;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.experimental.Accessors;
+
+/**
+ * <p>
+ * 
+ * </p>
+ *
+ * @author author
+ * @since 2024-01-03
+ */
+@Data
+@EqualsAndHashCode(callSuper = false)
+@Accessors(chain = true)
+@TableName("bill_luggage")
+public class BillLuggage implements Serializable {
+
+    private static final long serialVersionUID = 1L;
+
+    @TableId(value = "id", type = IdType.AUTO)
+    private Integer id;
+
+    /**
+     * 人员姓名
+     */
+    private String userName;
+
+    private Integer userId;
+
+    private String phone;
+
+    /**
+     * 寄存日期
+     */
+    private LocalDateTime luggageDate;
+
+    /**
+     * 寄存位置
+     */
+    private String luggageLocation;
+
+    /**
+     * 寄存件数
+     */
+    private Integer luggageNum;
+
+    private Integer luggageLocationId;
+
+    /**
+     * 照片地址
+     */
+    private String articlePicUrl;
+
+    private Integer farmId;
+
+
+}

+ 134 - 0
huimv.nongke.secure/huimv.nongke.secure/src/main/java/com/huimv/secure/entity/BillPcr.java

@@ -0,0 +1,134 @@
+package com.huimv.secure.entity;
+
+import com.baomidou.mybatisplus.annotation.TableName;
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableId;
+import java.time.LocalDateTime;
+import java.io.Serializable;
+import java.util.Date;
+
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.experimental.Accessors;
+
+/**
+ * <p>
+ * pcr 表
+ * </p>
+ *
+ * @author author
+ * @since 2024-01-03
+ */
+@Data
+@EqualsAndHashCode(callSuper = false)
+@Accessors(chain = true)
+@TableName("bill_pcr")
+public class BillPcr implements Serializable {
+
+    private static final long serialVersionUID = 1L;
+
+    @TableId(value = "id", type = IdType.AUTO)
+    private Integer id;
+
+    /**
+     * 0正常  1待复审 2 通过 3拒绝
+     */
+    private Integer pcrType;
+
+    /**
+     * 来访类型 0人员  1环保车 2拉猪车 3饲料车  4送猪车 5物资车  6送餐
+     */
+    private Integer vistitType;
+
+    /**
+     * 目的地
+     */
+    private String destName;
+
+    /**
+     * 目的地 id
+     */
+    private Integer destId;
+
+    /**
+     * 申请人
+     */
+    private String admissionUserName;
+
+    /**
+     * 申请人id
+     */
+    private Integer admissionUserId;
+
+    /**
+     * 来访时间
+     */
+    private LocalDateTime vistitDate;
+
+    /**
+     * 提交时间
+     */
+    private LocalDateTime subDate;
+
+    /**
+     * 检测时间
+     */
+    private Date checkDate;
+
+    /**
+     * 当前状态 0待审批 1合格  2异常 3已失效
+     */
+    private Integer billStatus;
+
+    /**
+     * 处理时间
+     */
+    private LocalDateTime passDate;
+
+    /**
+     * 处理人
+     */
+    private String passUserName;
+
+    /**
+     * 处理人id
+     */
+    private Integer passUserId;
+
+    /**
+     * 进程id
+     */
+    private Integer processId;
+
+    private Integer farmId;
+
+    private String testLocation;
+
+    private Integer testLocationId;
+
+    private Integer admissionId;
+
+    /**
+     * 手机号
+     */
+    private String phone;
+
+    /**
+     * 车牌号
+     */
+    private byte[] carNum;
+
+    /**
+     * pcr有效期
+     */
+    private String qualifiedDate;
+
+    /**
+     * pcr凭证
+     */
+    private String imgUrl;
+
+    private Integer imgStatus;
+
+
+}

+ 144 - 0
huimv.nongke.secure/huimv.nongke.secure/src/main/java/com/huimv/secure/entity/BillPersonnelAdmission.java

@@ -0,0 +1,144 @@
+package com.huimv.secure.entity;
+
+import com.baomidou.mybatisplus.annotation.TableName;
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableId;
+import java.time.LocalDateTime;
+import java.io.Serializable;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.experimental.Accessors;
+
+/**
+ * <p>
+ * 入场申请
+ * </p>
+ *
+ * @author author
+ * @since 2024-01-03
+ */
+@Data
+@EqualsAndHashCode(callSuper = false)
+@Accessors(chain = true)
+@TableName("bill_personnel_admission")
+public class BillPersonnelAdmission implements Serializable {
+
+    private static final long serialVersionUID = 1L;
+
+    @TableId(value = "id", type = IdType.AUTO)
+    private Integer id;
+
+    /**
+     * 0正常入场  1紧急入场
+     */
+    private Integer admissionType;
+
+    /**
+     * 来访类型 0人员  1环保车 2拉猪车 3饲料车  4送猪车 5物资车  6送餐
+     */
+    private Integer vistitType;
+
+    /**
+     * 目的地
+     */
+    private String destName;
+
+    /**
+     * 目的地 id
+     */
+    private Integer destId;
+
+    /**
+     * 申请人
+     */
+    private String admissionUserName;
+
+    /**
+     * 申请人id
+     */
+    private Integer admissionUserId;
+
+    /**
+     * 来访时间
+     */
+    private LocalDateTime vistitDate;
+
+    /**
+     * 提交时间
+     */
+    private LocalDateTime subDate;
+
+    /**
+     * 手机号
+     */
+    private String phone;
+
+    /**
+     * 单位名称
+     */
+    private String workName;
+
+    /**
+     * 证件类型
+     */
+    private Integer papersType;
+
+    /**
+     * 证件号码
+     */
+    private String papersCode;
+
+    /**
+     * 照片地址
+     */
+    private String imgUrl;
+
+    /**
+     * 来访理由
+     */
+    private String vistitReson;
+
+    private Integer farmId;
+
+    /**
+     * 当前状态 0待审批 1通过  2拒绝  3待上传物资信息
+     */
+    private Integer billStatus;
+
+    /**
+     * 处理时间
+     */
+    private LocalDateTime passDate;
+
+    /**
+     * 处理人
+     */
+    private String passUserName;
+
+    /**
+     * 处理人id
+     */
+    private Integer passUserId;
+
+    /**
+     * 进程id
+     */
+    private Integer processId;
+
+    /**
+     * 车牌号
+     */
+    private String carNum;
+
+    /**
+     * 拉猪车来源
+     */
+    private String source;
+
+    /**
+     * 人员照片
+     */
+    private String userImgUrl;
+
+
+}

+ 48 - 0
huimv.nongke.secure/huimv.nongke.secure/src/main/java/com/huimv/secure/entity/Configuration.java

@@ -0,0 +1,48 @@
+package com.huimv.secure.entity;
+
+import com.baomidou.mybatisplus.annotation.TableName;
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableId;
+import java.io.Serializable;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.experimental.Accessors;
+
+/**
+ * <p>
+ * 
+ * </p>
+ *
+ * @author author
+ * @since 2024-01-03
+ */
+@Data
+@EqualsAndHashCode(callSuper = false)
+@Accessors(chain = true)
+@TableName("configuration")
+public class Configuration implements Serializable {
+
+    private static final long serialVersionUID = 1L;
+
+    @TableId(value = "id", type = IdType.AUTO)
+    private Integer id;
+
+    /**
+     * pcr有效时长 单位小时
+     */
+    private Integer pcr;
+
+    /**
+     * 人员洗澡时长 单位分钟
+     */
+    private Integer clean;
+
+    /**
+     * 烘干温蒂 单位为摄氏度
+     */
+    private Integer dry;
+
+    private String farmId;
+
+
+}

+ 62 - 0
huimv.nongke.secure/huimv.nongke.secure/src/main/java/com/huimv/secure/entity/DeviceList.java

@@ -0,0 +1,62 @@
+package com.huimv.secure.entity;
+
+import com.baomidou.mybatisplus.annotation.TableName;
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableId;
+import java.time.LocalDateTime;
+import java.io.Serializable;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.experimental.Accessors;
+
+/**
+ * <p>
+ * 车辆闸机和人脸门禁设备列表
+ * </p>
+ *
+ * @author author
+ * @since 2024-01-03
+ */
+@Data
+@EqualsAndHashCode(callSuper = false)
+@Accessors(chain = true)
+@TableName("device_list")
+public class DeviceList implements Serializable {
+
+    private static final long serialVersionUID = 1L;
+
+    @TableId(value = "id", type = IdType.AUTO)
+    private Integer id;
+
+    /**
+     * 设备编码
+     */
+    private String deviceCode;
+
+    /**
+     * 安装位置
+     */
+    private Integer locationId;
+
+    /**
+     * 添加设备时间
+     */
+    private LocalDateTime createTime;
+
+    /**
+     * 牧场编码
+     */
+    private String farmId;
+
+    /**
+     * 设备类型 0为人脸门禁 1为车辆闸机
+     */
+    private Integer deviceType;
+
+    /**
+     * 安装位置名称
+     */
+    private String locationName;
+
+
+}

+ 38 - 0
huimv.nongke.secure/huimv.nongke.secure/src/main/java/com/huimv/secure/entity/Exist.java

@@ -0,0 +1,38 @@
+package com.huimv.secure.entity;
+
+import com.baomidou.mybatisplus.annotation.TableName;
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableId;
+import java.io.Serializable;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.experimental.Accessors;
+
+/**
+ * <p>
+ * 
+ * </p>
+ *
+ * @author author
+ * @since 2024-01-03
+ */
+@Data
+@EqualsAndHashCode(callSuper = false)
+@Accessors(chain = true)
+@TableName("exist")
+public class Exist implements Serializable {
+
+    private static final long serialVersionUID = 1L;
+
+    @TableId(value = "id", type = IdType.AUTO)
+    private Integer id;
+
+    /**
+     * 是否存在二级洗消站 0存在 1不存在
+     */
+    private Integer exist;
+
+    private String farmId;
+
+
+}

+ 69 - 0
huimv.nongke.secure/huimv.nongke.secure/src/main/java/com/huimv/secure/entity/PeopleList.java

@@ -0,0 +1,69 @@
+package com.huimv.secure.entity;
+
+import com.baomidou.mybatisplus.annotation.TableName;
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableId;
+import java.time.LocalDateTime;
+import java.io.Serializable;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.experimental.Accessors;
+
+/**
+ * <p>
+ * 人脸门禁车辆闸机白名单
+ * </p>
+ *
+ * @author author
+ * @since 2024-01-03
+ */
+@Data
+@EqualsAndHashCode(callSuper = false)
+@Accessors(chain = true)
+@TableName("people_list")
+public class PeopleList implements Serializable {
+
+    private static final long serialVersionUID = 1L;
+
+    @TableId(value = "id", type = IdType.AUTO)
+    private Integer id;
+
+    private String farmId;
+
+    /**
+     * 设备编码
+     */
+    private String deviceCode;
+
+    /**
+     * 用户id
+     */
+    private Integer userId;
+
+    /**
+     * 用户名称
+     */
+    private String userName;
+
+    /**
+     * 用户密码,默认123456
+     */
+    private String password;
+
+    /**
+     * 创建时间
+     */
+    private LocalDateTime createTime;
+
+    /**
+     * 过期时间
+     */
+    private LocalDateTime outTime;
+
+    /**
+     * 白名单类型 0为人员 1为车辆
+     */
+    private Integer type;
+
+
+}

+ 35 - 0
huimv.nongke.secure/huimv.nongke.secure/src/main/java/com/huimv/secure/entity/SysAccountGroup.java

@@ -0,0 +1,35 @@
+package com.huimv.secure.entity;
+
+import com.baomidou.mybatisplus.annotation.TableName;
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableId;
+import java.io.Serializable;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.experimental.Accessors;
+
+/**
+ * <p>
+ * 
+ * </p>
+ *
+ * @author author
+ * @since 2024-01-03
+ */
+@Data
+@EqualsAndHashCode(callSuper = false)
+@Accessors(chain = true)
+@TableName("sys_account_group")
+public class SysAccountGroup implements Serializable {
+
+    private static final long serialVersionUID = 1L;
+
+    @TableId(value = "id", type = IdType.AUTO)
+    private Integer id;
+
+    private Integer accountId;
+
+    private Integer groupId;
+
+
+}

+ 135 - 0
huimv.nongke.secure/huimv.nongke.secure/src/main/java/com/huimv/secure/entity/SysAccountMultilevel.java

@@ -0,0 +1,135 @@
+package com.huimv.secure.entity;
+
+import com.baomidou.mybatisplus.annotation.TableName;
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableId;
+import java.io.Serializable;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.experimental.Accessors;
+
+/**
+ * <p>
+ * 
+ * </p>
+ *
+ * @author author
+ * @since 2024-01-03
+ */
+@Data
+@EqualsAndHashCode(callSuper = false)
+@Accessors(chain = true)
+@TableName("sys_account_multilevel")
+public class SysAccountMultilevel implements Serializable {
+
+    private static final long serialVersionUID = 1L;
+
+    @TableId(value = "id", type = IdType.AUTO)
+    private Integer id;
+
+    /**
+     * 账号
+     */
+    private String account;
+
+    /**
+     * 父级
+     */
+    private Integer pid;
+
+    /**
+     * 多级父级
+     */
+    private String pids;
+
+    /**
+     * 状态 1启用,0未启用
+     */
+    private Integer accountStatus;
+
+    /**
+     * 所属牧场
+     */
+    private String farmIds;
+
+    private String color;
+
+    private Boolean mode;
+
+    private Integer lastFarmId;
+
+    private String userName;
+
+    private String farmNames;
+
+    /**
+     * 0管理员,1 场长 2 紧急进程审核员  ,3生物安全负责人 ,4 pcr 检测人员,5洗消站点工作人员 , 6员工,7访客
+     */
+    private Integer type;
+
+    /**
+     * 工作地点
+     */
+    private String workLocation;
+
+    /**
+     * 1人员初级洗消站 2净区 3人员二级洗消站 4场内 5生产区 6车辆初级洗消站 7车辆二级洗消站 8中转料塔外围 9车辆三级洗消站 10销售中转站 11环保区洗消中心 12环保区净区 13洗消中心净区
+     */
+    private Integer workLocationType;
+
+    /**
+     * 工作岗位 1 场长 2 紧急进程审核员  ,3生物安全负责人 ,4 pcr 检测人员,5洗消站点工作人员 , 6员工
+     */
+    private Integer workPost;
+
+    /**
+     * 手机号
+     */
+    private String phone;
+
+    /**
+     * 头像图片
+     */
+    private String imgUrl;
+
+    /**
+     * 单位名称
+     */
+    private String workName;
+
+    /**
+     * 证件类型 0身份证 ,1护照
+     */
+    private String papersType;
+
+    /**
+     * 密码
+     */
+    private String password;
+
+    /**
+     * 证件号码
+     */
+    private String papersCode;
+
+    /**
+     * 微信标识
+     */
+    private String wechatId;
+
+    /**
+     * 车牌号
+     */
+    private String carNum;
+
+    /**
+     * 绑定用户id
+     */
+    private Integer userId;
+
+    private Integer farmId;
+
+    private String jobs;
+
+
+}

+ 37 - 0
huimv.nongke.secure/huimv.nongke.secure/src/main/java/com/huimv/secure/entity/SysGroup.java

@@ -0,0 +1,37 @@
+package com.huimv.secure.entity;
+
+import com.baomidou.mybatisplus.annotation.TableName;
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableId;
+import java.io.Serializable;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.experimental.Accessors;
+
+/**
+ * <p>
+ * 
+ * </p>
+ *
+ * @author author
+ * @since 2024-01-03
+ */
+@Data
+@EqualsAndHashCode(callSuper = false)
+@Accessors(chain = true)
+@TableName("sys_group")
+public class SysGroup implements Serializable {
+
+    private static final long serialVersionUID = 1L;
+
+    @TableId(value = "id", type = IdType.AUTO)
+    private Integer id;
+
+    private String groupName;
+
+    private String remark;
+
+    private Integer accountId;
+
+
+}

+ 37 - 0
huimv.nongke.secure/huimv.nongke.secure/src/main/java/com/huimv/secure/entity/SysGroupMenu.java

@@ -0,0 +1,37 @@
+package com.huimv.secure.entity;
+
+import com.baomidou.mybatisplus.annotation.TableName;
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableId;
+import java.io.Serializable;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.experimental.Accessors;
+
+/**
+ * <p>
+ * 
+ * </p>
+ *
+ * @author author
+ * @since 2024-01-03
+ */
+@Data
+@EqualsAndHashCode(callSuper = false)
+@Accessors(chain = true)
+@TableName("sys_group_menu")
+public class SysGroupMenu implements Serializable {
+
+    private static final long serialVersionUID = 1L;
+
+    @TableId(value = "id", type = IdType.AUTO)
+    private Integer id;
+
+    private Integer groupId;
+
+    private Integer menuId;
+
+    private Integer isAll;
+
+
+}

+ 47 - 0
huimv.nongke.secure/huimv.nongke.secure/src/main/java/com/huimv/secure/entity/SysMenu.java

@@ -0,0 +1,47 @@
+package com.huimv.secure.entity;
+
+import com.baomidou.mybatisplus.annotation.TableName;
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableId;
+import java.io.Serializable;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.experimental.Accessors;
+
+/**
+ * <p>
+ * 
+ * </p>
+ *
+ * @author author
+ * @since 2024-01-03
+ */
+@Data
+@EqualsAndHashCode(callSuper = false)
+@Accessors(chain = true)
+@TableName("sys_menu")
+public class SysMenu implements Serializable {
+
+    private static final long serialVersionUID = 1L;
+
+    @TableId(value = "id", type = IdType.AUTO)
+    private Integer id;
+
+    private String title;
+
+    private String url;
+
+    private String remark;
+
+    private Integer parentId;
+
+    private Integer sort;
+
+    private Integer weight;
+
+    private String permission;
+
+    private Boolean ifShow;
+
+
+}

+ 178 - 0
huimv.nongke.secure/huimv.nongke.secure/src/main/java/com/huimv/secure/entity/SysUser.java

@@ -0,0 +1,178 @@
+package com.huimv.secure.entity;
+
+import com.baomidou.mybatisplus.annotation.TableName;
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableId;
+import java.time.LocalDateTime;
+import java.io.Serializable;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.experimental.Accessors;
+
+/**
+ * <p>
+ * 
+ * </p>
+ *
+ * @author author
+ * @since 2024-01-03
+ */
+@Data
+@EqualsAndHashCode(callSuper = false)
+@Accessors(chain = true)
+@TableName("sys_user")
+public class SysUser implements Serializable {
+
+    private static final long serialVersionUID = 1L;
+
+    @TableId(value = "id", type = IdType.AUTO)
+    private Long id;
+
+    /**
+     * 员工工号
+     */
+    private String userId;
+
+    /**
+     * 员工姓名
+     */
+    private String userName;
+
+    /**
+     * 0 男  1女
+     */
+    private Integer gender;
+
+    /**
+     * 民族
+     */
+    private String nation;
+
+    /**
+     * 籍贯
+     */
+    private String nativePlace;
+
+    /**
+     * 出生日期
+     */
+    private LocalDateTime birthday;
+
+    /**
+     * 政治面貌
+     */
+    private String politicsPace;
+
+    /**
+     * 户口类型
+     */
+    private String peopleType;
+
+    /**
+     * 教育水平
+     */
+    private String educationalLevel;
+
+    /**
+     * 证件类型
+     */
+    private String cardType;
+
+    /**
+     * 年龄
+     */
+    private Integer age;
+
+    /**
+     * 证件号码
+     */
+    private String cardNum;
+
+    /**
+     * 个人电话
+     */
+    private String userPhone;
+
+    /**
+     * 办公电话
+     */
+    private String publicPhone;
+
+    /**
+     * 个人邮箱
+     */
+    private String userMali;
+
+    /**
+     * 办公邮箱
+     */
+    private String publicMali;
+
+    /**
+     * 入职时间
+     */
+    private LocalDateTime entryTime;
+
+    /**
+     * 试用期
+     */
+    private String probation;
+
+    /**
+     * 部门
+     */
+    private String department;
+
+    /**
+     * 工作岗位 1 场长,3生物安全负责人 ,4 pcr 检测人员,5洗消站点工作人员
+     */
+    private String job;
+
+    /**
+     * 工作性质
+     */
+    private String jobType;
+
+    /**
+     * 工作地点
+     */
+    private String workLocation;
+
+    /**
+     * 1人员初级洗消站 2净区 3人员二级洗消站 4场内 5生产区 6车辆初级洗消站 7车辆二级洗消站 8中转料塔外围 9车辆三级洗消站 10销售中转站 11环保区洗消中心 12环保区净区 13洗消中心净区
+     */
+    private Integer workLocationType;
+
+    private Integer farmId;
+
+    private String emergentUser;
+
+    private String emergentUserPhone;
+
+    /**
+     * 省
+     */
+    private String sheng;
+
+    /**
+     * 市
+     */
+    private String shi;
+
+    /**
+     * 详细地址
+     */
+    private String xxdz;
+
+    /**
+     * 邮政编码
+     */
+    private String yzbm;
+
+    /**
+     * 图片
+     */
+    private String imgUrl;
+
+
+}

+ 11 - 0
huimv.nongke.secure/huimv.nongke.secure/src/main/java/com/huimv/secure/entity/dto/PcrDto.java

@@ -0,0 +1,11 @@
+package com.huimv.secure.entity.dto;
+
+import lombok.Data;
+
+@Data
+public class PcrDto {
+    private Integer wholeCount;
+    private Integer passCount;
+    private Integer refuseCount;
+    private Integer loseCount;
+}

+ 22 - 0
huimv.nongke.secure/huimv.nongke.secure/src/main/java/com/huimv/secure/entity/dto/PrintAdmissionDto.java

@@ -0,0 +1,22 @@
+package com.huimv.secure.entity.dto;
+
+import lombok.Data;
+
+@Data
+public class PrintAdmissionDto {
+    private String userName;
+
+    private String vistitType;
+
+    private String phone;
+
+    private String carNum;
+
+    private String destName;
+
+    private String vistitDate;
+
+    private String vistitReason;
+
+    private String billStatus;
+}

+ 22 - 0
huimv.nongke.secure/huimv.nongke.secure/src/main/java/com/huimv/secure/entity/dto/PrintIsolateDto.java

@@ -0,0 +1,22 @@
+package com.huimv.secure.entity.dto;
+
+import lombok.Data;
+
+@Data
+public class PrintIsolateDto {
+    private String userName;
+
+    private String phone;
+
+    private String destName;
+
+    private String location;
+
+    private String startTime;
+
+    private String endTime;
+
+    private String num;
+
+    private String status;
+}

+ 16 - 0
huimv.nongke.secure/huimv.nongke.secure/src/main/java/com/huimv/secure/entity/dto/PrintLuggageDto.java

@@ -0,0 +1,16 @@
+package com.huimv.secure.entity.dto;
+
+import lombok.Data;
+
+@Data
+public class PrintLuggageDto {
+    private String userName;
+
+    private String phone;
+
+    private String vistitDate;
+
+    private String vistitReason;
+
+    private String billStatus;
+}

+ 29 - 0
huimv.nongke.secure/huimv.nongke.secure/src/main/java/com/huimv/secure/entity/dto/UserAccountDto.java

@@ -0,0 +1,29 @@
+package com.huimv.secure.entity.dto;
+
+import lombok.Data;
+
+@Data
+public class UserAccountDto {
+
+     private Integer id;
+
+     private String userName;
+
+     private Integer male;
+
+     private String birthday;
+
+     private String mobile;
+
+     private String address;
+
+     private String job;
+
+     private String remark;
+
+     private String userId;
+
+     private String accountName;
+
+     private Integer accountStatus;
+}

+ 28 - 0
huimv.nongke.secure/huimv.nongke.secure/src/main/java/com/huimv/secure/entity/dto/UserAndAccountGroup.java

@@ -0,0 +1,28 @@
+package com.huimv.secure.entity.dto;
+
+import lombok.Data;
+
+@Data
+public class UserAndAccountGroup {
+    private String accountName;
+
+    private Integer accountStatus;
+
+    private Integer id;
+
+    private String userName;
+
+    private Integer male;
+
+    private String birthday;
+
+    private String mobile;
+
+    private String address;
+
+    private String job;
+
+    private String remark;
+
+    private Long userId;
+}

+ 10 - 0
huimv.nongke.secure/huimv.nongke.secure/src/main/java/com/huimv/secure/entity/dto/WeCahtVo.java

@@ -0,0 +1,10 @@
+package com.huimv.secure.entity.dto;
+
+import lombok.Data;
+
+@Data
+public class WeCahtVo {
+
+    private String openId;
+    private String sessionKey;
+}

+ 16 - 0
huimv.nongke.secure/huimv.nongke.secure/src/main/java/com/huimv/secure/entity/pojo/UserPagePojo.java

@@ -0,0 +1,16 @@
+package com.huimv.secure.entity.pojo;
+
+import lombok.Data;
+
+@Data
+public class UserPagePojo {
+
+    private Integer pageNum;
+    private Integer pageSize;
+    private Integer gender;
+    private String searchStr;
+    private Integer job;
+    private String workLocation;
+    private Integer workLocationType;
+    private String farmId;
+}

+ 43 - 0
huimv.nongke.secure/huimv.nongke.secure/src/main/java/com/huimv/secure/entity/vo/AccountVo.java

@@ -0,0 +1,43 @@
+package com.huimv.secure.entity.vo;
+
+import lombok.Data;
+
+/**
+ * <p>
+ * 
+ * </p>
+ *
+ * @author author
+ * @since 2023-09-04
+ */
+@Data
+public class AccountVo {
+
+    /**
+     * 员工工号
+     */
+    private String userNum;
+
+    /**
+     * 员工姓名
+     */
+    private String userName;
+
+
+
+    /**
+     * 工作岗位 1 场长,3生物安全负责人 ,4 pcr 检测人员,5洗消站点工作人员
+     */
+    private String workName;
+
+
+    /**
+     * 工作地点
+     */
+    private String workLocation;
+
+    private String account;
+
+    private String password;
+
+}

+ 48 - 0
huimv.nongke.secure/huimv.nongke.secure/src/main/java/com/huimv/secure/entity/vo/BaseProcessByLocationVo.java

@@ -0,0 +1,48 @@
+package com.huimv.secure.entity.vo;
+
+import com.fasterxml.jackson.annotation.JsonFormat;
+import lombok.Data;
+
+import java.util.Date;
+import java.util.List;
+
+@Data
+public class BaseProcessByLocationVo {
+    private Integer id;
+
+    private String farmId;
+    private Integer pcrType;
+    private String passUserName;
+    private String qualifiedDate;
+
+    private Integer admissionUserId;
+
+    private String testLocation;
+
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm" ,timezone = "GMT+8")
+    private Date checkDate;
+
+    private Integer testLocationId;
+
+    private Integer billStatus;
+
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm" ,timezone = "GMT+8")
+    private Date isolateEndDate;
+
+    private Integer type;
+
+    private String isolateDayNum;
+
+    private String isolateRealDayNum;
+
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm" ,timezone = "GMT+8")
+    private Date isolateRealEndDate;
+    private String  imgUrl;
+    private String imgStatus;
+    private String cleanTime;
+    private String dryTime;
+    private String dryTem;
+    private List<String> imgUrls;
+
+
+}

+ 12 - 0
huimv.nongke.secure/huimv.nongke.secure/src/main/java/com/huimv/secure/entity/vo/BaseProcessVo.java

@@ -0,0 +1,12 @@
+package com.huimv.secure.entity.vo;
+
+import lombok.Data;
+
+@Data
+public class BaseProcessVo {
+    private String allLocation;
+    private String allLocationId;
+    private String allLocationSatus;
+
+
+}

+ 13 - 0
huimv.nongke.secure/huimv.nongke.secure/src/main/java/com/huimv/secure/entity/vo/BillAdmissionAndGoods.java

@@ -0,0 +1,13 @@
+package com.huimv.secure.entity.vo;
+
+
+import com.huimv.secure.entity.BillGoodsInventory;
+import com.huimv.secure.entity.BillPersonnelAdmission;
+import lombok.Data;
+
+import java.util.List;
+
+@Data
+public class BillAdmissionAndGoods extends BillPersonnelAdmission {
+    private List<BillGoodsInventory> goods;
+}

+ 18 - 0
huimv.nongke.secure/huimv.nongke.secure/src/main/java/com/huimv/secure/entity/vo/BillAdmissionVo.java

@@ -0,0 +1,18 @@
+package com.huimv.secure.entity.vo;
+
+import com.fasterxml.jackson.annotation.JsonFormat;
+import lombok.Data;
+
+import java.util.Date;
+
+@Data
+public class BillAdmissionVo {
+    private Integer commitCount;
+
+    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
+    private Date dateTime;
+
+    private Integer passCount;
+
+    private Integer refuseCount;
+}

+ 25 - 0
huimv.nongke.secure/huimv.nongke.secure/src/main/java/com/huimv/secure/entity/vo/BillGoodsInventoryVo.java

@@ -0,0 +1,25 @@
+package com.huimv.secure.entity.vo;
+
+import com.fasterxml.jackson.annotation.JsonFormat;
+import lombok.Data;
+
+import java.util.Date;
+
+/**
+ * <p>
+ * 
+ * </p>
+ *
+ * @author author
+ * @since 2023-08-22
+ */
+@Data
+public class BillGoodsInventoryVo {
+
+    private Integer count;
+
+    @JsonFormat(pattern = "yyyy-MM-dd",timezone = "GMT+8")
+    private Date dateTime;
+
+
+}

+ 30 - 0
huimv.nongke.secure/huimv.nongke.secure/src/main/java/com/huimv/secure/entity/vo/CleanAndDryVo.java

@@ -0,0 +1,30 @@
+package com.huimv.secure.entity.vo;
+
+import com.fasterxml.jackson.annotation.JsonFormat;
+import lombok.Data;
+
+import java.time.LocalDateTime;
+
+@Data
+public class CleanAndDryVo {
+    private String id;
+
+    private Integer billStatus;
+
+    private String testLocation;
+
+    private String carNum;
+
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm" ,timezone = "GMT+8")
+    private LocalDateTime checkDate;
+
+    private Integer vistitType;
+
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm" ,timezone = "GMT+8")
+    private LocalDateTime subDate;
+
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm" ,timezone = "GMT+8")
+    private LocalDateTime passDate;
+
+    private Integer type;
+}

+ 99 - 0
huimv.nongke.secure/huimv.nongke.secure/src/main/java/com/huimv/secure/entity/vo/CleanAndDryVo2.java

@@ -0,0 +1,99 @@
+package com.huimv.secure.entity.vo;
+
+import com.fasterxml.jackson.annotation.JsonFormat;
+import lombok.Data;
+
+import java.time.LocalDateTime;
+import java.util.Date;
+
+@Data
+public class CleanAndDryVo2 {
+    private Integer id;
+
+    /**
+     * 来访类型 0人员  1环保车 2拉猪车 3饲料车  4送猪车 5物资车  6送餐
+     */
+    private Integer vistitType;
+
+    /**
+     * 目的地
+     */
+    private String destName;
+
+    /**
+     * 目的地 id
+     */
+    private Integer destId;
+
+    /**
+     * 申请人
+     */
+    private String admissionUserName;
+
+    /**
+     * 申请人id
+     */
+    private Integer admissionUserId;
+
+    /**
+     * 来访时间
+     */
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm" ,timezone = "GMT+8")
+    private LocalDateTime vistitDate;
+
+    /**
+     * 提交时间
+     */
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm" ,timezone = "GMT+8")
+    private LocalDateTime subDate;
+
+    private Integer farmId;
+
+    /**
+     * 当前状态 0待审批 1合格  2异常
+     */
+    private Integer billStatus;
+
+    /**
+     * 处理时间
+     */
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm" ,timezone = "GMT+8")
+    private Date passDate;
+
+    /**
+     * 处理人
+     */
+    private String passUserName;
+
+    /**
+     * 处理人id
+     */
+    private Integer passUserId;
+
+    /**
+     * 进程id
+     */
+    private Integer processId;
+
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm" ,timezone = "GMT+8")
+    private Date checkDate;
+    /**
+     * 检测地点
+     */
+    private String testLocation;
+
+
+    private Integer testLocationId;
+
+    private String phone;
+
+    private String carNum;
+
+    private String imgUrl;
+
+    private Integer imgStatus;
+    private Integer type;
+    private String cleanTime;
+    private String dryTime;
+    private String dryTem;
+}

+ 15 - 0
huimv.nongke.secure/huimv.nongke.secure/src/main/java/com/huimv/secure/entity/vo/CleanVo.java

@@ -0,0 +1,15 @@
+package com.huimv.secure.entity.vo;
+
+import com.fasterxml.jackson.annotation.JsonFormat;
+import lombok.Data;
+
+import java.util.Date;
+
+@Data
+public class CleanVo {
+    private Integer allCount;
+    private Integer passCount;
+    private Integer refuseCount;
+    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
+    private Date dateTime;
+}

+ 12 - 0
huimv.nongke.secure/huimv.nongke.secure/src/main/java/com/huimv/secure/entity/vo/DeviceVo.java

@@ -0,0 +1,12 @@
+package com.huimv.secure.entity.vo;
+
+import lombok.Data;
+
+@Data
+public class DeviceVo {
+    private String deviceNum;
+    private String deviceName;
+    private String location;
+    private String status;
+    private String userName;
+}

+ 0 - 0
huimv.nongke.secure/huimv.nongke.secure/src/main/java/com/huimv/secure/entity/vo/DoorVo.java


Einige Dateien werden nicht angezeigt, da zu viele Dateien in diesem Diff geändert wurden.