Browse Source

增加代码

夏文涛 2 years ago
parent
commit
ea256f8f40
100 changed files with 6922 additions and 548 deletions
  1. 2 0
      .idea/compiler.xml
  2. 249 386
      .idea/workspace.xml
  3. 51 0
      pom.xml
  4. 2 0
      src/main/java/com/template/MybatisPlusApplication.java
  5. 17 0
      src/main/java/com/template/annotation/DESRespondSecret.java
  6. 18 0
      src/main/java/com/template/annotation/ExcelExport.java
  7. 20 0
      src/main/java/com/template/annotation/ExcelImport.java
  8. 95 0
      src/main/java/com/template/aop/DESResponseSecretAspect.java
  9. 0 10
      src/main/java/com/template/api/SendControllerAPI.java
  10. 16 0
      src/main/java/com/template/common/constanst/Constanst.java
  11. 1 2
      src/main/java/com/template/common/exception/EmsExceptionHandler.java
  12. 43 0
      src/main/java/com/template/common/jh/ReqRespResearchProductQuestionnaireItem.java
  13. 243 0
      src/main/java/com/template/common/jh/SectionUtil.java
  14. 1 0
      src/main/java/com/template/common/result/ResponseStatusEnum.java
  15. 23 0
      src/main/java/com/template/common/utils/AccessToken.java
  16. 84 0
      src/main/java/com/template/common/utils/AesTestOne.java
  17. 165 0
      src/main/java/com/template/common/utils/AesUtil.java
  18. 47 0
      src/main/java/com/template/common/utils/Base64Util.java
  19. 44 6
      src/main/java/com/template/common/utils/CommonUtil.java
  20. 9 0
      src/main/java/com/template/common/utils/DataBliu.java
  21. 241 0
      src/main/java/com/template/common/utils/DateUtils.java
  22. 82 0
      src/main/java/com/template/common/utils/EncryptUtil.java
  23. 75 0
      src/main/java/com/template/common/utils/ExcelClassField.java
  24. 22 0
      src/main/java/com/template/common/utils/ExcelUtil3.java
  25. 64 0
      src/main/java/com/template/common/utils/ExcelUtils.java
  26. 1008 0
      src/main/java/com/template/common/utils/ExcelUtils2.java
  27. 76 0
      src/main/java/com/template/common/utils/FileUtils.java
  28. 18 0
      src/main/java/com/template/common/utils/GetVertifyCode.java
  29. 241 0
      src/main/java/com/template/common/utils/HttpClientUtils.java
  30. 112 0
      src/main/java/com/template/common/utils/HttpUtils.java
  31. 530 0
      src/main/java/com/template/common/utils/HttpsClient.java
  32. 54 0
      src/main/java/com/template/common/utils/Md5Utils.java
  33. 548 0
      src/main/java/com/template/common/utils/Message.java
  34. 113 0
      src/main/java/com/template/common/utils/Message2.java
  35. 23 0
      src/main/java/com/template/common/utils/MyX509TrustManager.java
  36. 99 0
      src/main/java/com/template/common/utils/PropertiesUtil.java
  37. 32 0
      src/main/java/com/template/common/utils/RandomTrackAlgorithm.java
  38. 126 0
      src/main/java/com/template/common/utils/RequestUtils.java
  39. 42 0
      src/main/java/com/template/common/utils/SHA1.java
  40. 54 19
      src/main/java/com/template/common/utils/SendSms.java
  41. 748 0
      src/main/java/com/template/common/utils/TimeExchange.java
  42. 628 0
      src/main/java/com/template/common/utils/TimeExchange2.java
  43. 25 0
      src/main/java/com/template/common/utils/UUIDUtil.java
  44. 52 0
      src/main/java/com/template/common/utils/WxConfig.java
  45. 53 0
      src/main/java/com/template/common/utils/WxConstants.java
  46. 385 0
      src/main/java/com/template/common/utils/WxUtil.java
  47. 47 0
      src/main/java/com/template/common/utils/imageUtils.java
  48. 53 0
      src/main/java/com/template/config/CosConfig.java
  49. 12 12
      src/main/java/com/template/config/MyBatisPlusConfig.java
  50. 6 6
      src/main/java/com/template/config/smsConfig.java
  51. 1 1
      src/main/java/com/template/controller/LogInfoController.java
  52. 0 29
      src/main/java/com/template/controller/SendController.java
  53. 24 13
      src/main/java/com/template/handler/MyMetaObjectHandler.java
  54. 67 0
      src/main/java/com/template/model/enumModel/eWeekStatu.java
  55. 30 0
      src/main/java/com/template/model/result/UnitTimeHelpModel.java
  56. 28 0
      src/main/java/com/template/model/vo/ClassSettingDateVo.java
  57. 0 1
      src/main/java/com/template/services/SystemUserService.java
  58. 0 63
      src/main/java/com/template/services/impl/SystemUserServiceImpl.java
  59. 11 0
      src/main/resources/application-dev.yml
  60. 4 0
      src/main/resources/application-prod.yml
  61. 4 0
      src/main/resources/application.yml
  62. 35 0
      target/classes/META-INF/spring-configuration-metadata.json
  63. 11 0
      target/classes/application-dev.yml
  64. 4 0
      target/classes/application-prod.yml
  65. 4 0
      target/classes/application.yml
  66. BIN
      target/classes/com/template/MybatisPlusApplication.class
  67. BIN
      target/classes/com/template/annotation/DESRespondSecret.class
  68. BIN
      target/classes/com/template/annotation/ExcelExport.class
  69. BIN
      target/classes/com/template/annotation/ExcelImport.class
  70. BIN
      target/classes/com/template/aop/DESResponseSecretAspect.class
  71. BIN
      target/classes/com/template/api/SendControllerAPI.class
  72. BIN
      target/classes/com/template/common/constanst/Constanst.class
  73. BIN
      target/classes/com/template/common/exception/EmsExceptionHandler.class
  74. BIN
      target/classes/com/template/common/jh/ReqRespResearchProductQuestionnaireItem.class
  75. BIN
      target/classes/com/template/common/jh/SectionUtil.class
  76. BIN
      target/classes/com/template/common/result/ResponseStatusEnum.class
  77. BIN
      target/classes/com/template/common/utils/AccessToken.class
  78. BIN
      target/classes/com/template/common/utils/AesTestOne.class
  79. BIN
      target/classes/com/template/common/utils/AesUtil.class
  80. BIN
      target/classes/com/template/common/utils/Base64Util.class
  81. BIN
      target/classes/com/template/common/utils/CommonUtil.class
  82. BIN
      target/classes/com/template/common/utils/DataBliu.class
  83. BIN
      target/classes/com/template/common/utils/DateUtils.class
  84. BIN
      target/classes/com/template/common/utils/EncryptUtil.class
  85. BIN
      target/classes/com/template/common/utils/ExcelClassField.class
  86. BIN
      target/classes/com/template/common/utils/ExcelUtil3.class
  87. BIN
      target/classes/com/template/common/utils/ExcelUtils.class
  88. BIN
      target/classes/com/template/common/utils/ExcelUtils2.class
  89. BIN
      target/classes/com/template/common/utils/FileUtils.class
  90. BIN
      target/classes/com/template/common/utils/GetVertifyCode.class
  91. BIN
      target/classes/com/template/common/utils/HttpClientUtils$1.class
  92. BIN
      target/classes/com/template/common/utils/HttpClientUtils$LazyHolder.class
  93. BIN
      target/classes/com/template/common/utils/HttpClientUtils.class
  94. BIN
      target/classes/com/template/common/utils/HttpUtils.class
  95. BIN
      target/classes/com/template/common/utils/HttpsClient.class
  96. BIN
      target/classes/com/template/common/utils/Md5Utils.class
  97. BIN
      target/classes/com/template/common/utils/Message$1.class
  98. BIN
      target/classes/com/template/common/utils/Message.class
  99. BIN
      target/classes/com/template/common/utils/Message2.class
  100. 0 0
      target/classes/com/template/common/utils/MyX509TrustManager.class

+ 2 - 0
.idea/compiler.xml

@@ -7,6 +7,7 @@
         <sourceOutputDir name="target/generated-sources/annotations" />
         <sourceTestOutputDir name="target/generated-test-sources/test-annotations" />
         <outputRelativeToContentRoot value="true" />
+        <module name="mybatis_plus" />
         <module name="template_code" />
         <module name="Back-endDevelopmentFramework" />
       </profile>
@@ -15,6 +16,7 @@
   <component name="JavacSettings">
     <option name="ADDITIONAL_OPTIONS_OVERRIDE">
       <module name="Back-endDevelopmentFramework" options="-parameters" />
+      <module name="mybatis_plus" options="-parameters" />
       <module name="template_code" options="-parameters" />
     </option>
   </component>

File diff suppressed because it is too large
+ 249 - 386
.idea/workspace.xml


+ 51 - 0
pom.xml

@@ -90,6 +90,10 @@
             <artifactId>gson</artifactId>
             <version>2.8.7</version>
         </dependency>
+        <dependency>
+            <groupId>org.springframework.boot</groupId>
+            <artifactId>spring-boot-starter-quartz</artifactId>
+        </dependency>
         <!-- 数据库驱动 -->
         <dependency>
             <groupId>mysql</groupId>
@@ -181,7 +185,54 @@
             <version>2.0.2</version>
         </dependency>
 
+        <dependency>
+            <groupId>com.qcloud</groupId>
+            <artifactId>cos_api</artifactId>
+            <version>5.6.155</version>
+        </dependency>
+
 
+        <!--hutools-->
+        <dependency>
+            <groupId>cn.hutool</groupId>
+            <artifactId>hutool-all</artifactId>
+            <version>5.4.3</version>
+        </dependency>
+
+        <dependency>
+            <groupId>com.github.pagehelper</groupId>
+            <artifactId>pagehelper-spring-boot-starter</artifactId>
+            <version>1.4.2</version>
+        </dependency>
+        <dependency>
+            <groupId>org.springframework</groupId>
+            <artifactId>spring-test</artifactId>
+            <version>6.0.9</version>
+            <scope>compile</scope>
+        </dependency>
+
+        <!-- 上传文件的依赖 -->
+        <dependency>
+            <!--common-fileupload的依赖组件-->
+            <groupId>commons-io</groupId>
+            <artifactId>commons-io</artifactId>
+            <version>2.6</version>
+        </dependency>
+        <dependency>
+            <groupId>commons-fileupload</groupId>
+            <artifactId>commons-fileupload</artifactId>
+            <version>1.4</version>
+        </dependency>
+        <dependency>
+            <groupId>com.alibaba</groupId>
+            <artifactId>druid</artifactId>
+            <version>1.2.16</version>
+        </dependency>
+        <dependency>
+            <groupId>com.alibaba</groupId>
+            <artifactId>easyexcel</artifactId>
+            <version>2.2.11</version>
+        </dependency>
     </dependencies>
 
     <build>

+ 2 - 0
src/main/java/com/template/MybatisPlusApplication.java

@@ -3,11 +3,13 @@ package com.template;
 import org.springframework.boot.SpringApplication;
 import org.springframework.boot.autoconfigure.SpringBootApplication;
 import org.springframework.cache.annotation.EnableCaching;
+import org.springframework.scheduling.annotation.EnableScheduling;
 import org.springframework.transaction.annotation.EnableTransactionManagement;
 
 @EnableCaching//开启缓存
 @SpringBootApplication
 @EnableTransactionManagement //开启事务回滚
+@EnableScheduling // 开启定时任务
 public class MybatisPlusApplication {
 
     public static void main(String[] args) {

+ 17 - 0
src/main/java/com/template/annotation/DESRespondSecret.java

@@ -0,0 +1,17 @@
+package com.template.annotation;
+
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+
+/**
+ * 返回参数加密注解
+ */
+
+//可以作用在类上和方法上
+@Target(value = {ElementType.METHOD, ElementType.TYPE})
+@Retention(RetentionPolicy.RUNTIME)
+public @interface DESRespondSecret {
+    boolean validated() default true;
+}

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

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

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

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

+ 95 - 0
src/main/java/com/template/aop/DESResponseSecretAspect.java

@@ -0,0 +1,95 @@
+package com.template.aop;
+
+import com.alibaba.fastjson.JSON;
+import com.template.annotation.DESRespondSecret;
+import com.template.common.utils.EncryptUtil;
+import com.template.model.result.CommonResult;
+import org.aspectj.lang.JoinPoint;
+import org.aspectj.lang.ProceedingJoinPoint;
+import org.aspectj.lang.annotation.AfterReturning;
+import org.aspectj.lang.annotation.Around;
+import org.aspectj.lang.annotation.Aspect;
+import org.aspectj.lang.annotation.Pointcut;
+import org.aspectj.lang.reflect.MethodSignature;
+import org.springframework.stereotype.Component;
+
+import java.lang.reflect.Method;
+
+/**
+ * @Author: binguo
+ * @Date: 2024/2/26 星期一 10:02
+ * @Description: com.template.aop
+ * @Version: 1.0
+ */
+@Component
+@Aspect
+//规定AOP的执行顺序
+//Order(1) 多个aop时可通过该注解来确定执行顺序
+public class DESResponseSecretAspect {
+
+    // 定义切点,使用了@DESRespondSecret注解的类 或 使用了@DESRespondSecret注解的方法
+
+    /**
+     * 切点,方法上有注解或类上有注解
+     * 拦截类或者是方法上标注注解的方法
+     */
+    @Pointcut("@within(com.template.annotation.DESRespondSecret) || @annotation(com.template.annotation.DESRespondSecret)")
+    public void pointCut() {
+    }
+
+    @Around("pointCut()")
+    public Object after(ProceedingJoinPoint joinPoint) throws Throwable {
+        Object rvt = joinPoint.proceed(joinPoint.getArgs());
+        return rvt;
+    }
+
+    /**
+     * 与After的区别在于AfterReturning只有在方法执行成功之后才会被植入,如果After和
+     * AfterReturning同时存在于一个文件中,谁写在前面谁先运行
+     *
+     * @param joinpoint
+     * @param rvt
+     * @return
+     */
+    @AfterReturning(pointcut = "execution(public * com.template.controller.*.*(..))", returning = "rvt")
+    public Object log(JoinPoint joinpoint, Object rvt) {
+        //获取被代理对象
+        Object target = joinpoint.getTarget();
+        //获取通知签名 获取方法上的DESRespondSecret注解
+        MethodSignature signature = (MethodSignature) joinpoint.getSignature();
+        try {
+            // 获取被代理方法
+            Method pointMethod = target.getClass().getMethod(signature.getName(), signature.getParameterTypes());
+            // 获取被代理方法上面的注解@DESRespondSecret
+            DESRespondSecret secret = pointMethod.getAnnotation(DESRespondSecret.class);
+            // 被代理方法上没有,则说明@DESRespondSecret注解在被代理类上
+            if (secret == null) {
+                secret = target.getClass().getAnnotation(DESRespondSecret.class);
+            }
+            //类上也没有 直接返回
+            if (secret == null) {
+                return rvt;
+            }
+            // 如果有,并且值为false,则不进行加密
+            if (secret != null && !secret.validated()) {
+                return rvt;
+            } else {
+                CommonResult baseVo1 = (CommonResult) rvt;
+                // 获取返回值json字符串
+                Object data = baseVo1.getData();
+                if (null != data) {
+                    String jsonString = JSON.toJSONString(data);
+                    // 加密
+                    String s = EncryptUtil.encrypt(jsonString);
+                    baseVo1.setData(s);
+                }
+                return baseVo1;
+
+            }
+        } catch (Throwable throwable) {
+            throwable.printStackTrace();
+        }
+        return rvt;
+    }
+
+}

+ 0 - 10
src/main/java/com/template/api/SendControllerAPI.java

@@ -1,10 +0,0 @@
-package com.template.api;
-
-import com.tencentcloudapi.sms.v20210111.models.SendStatus;
-
-
-public interface SendControllerAPI {
-
-     SendStatus[] sendCodeAgain(String phone);
-
-}

+ 16 - 0
src/main/java/com/template/common/constanst/Constanst.java

@@ -0,0 +1,16 @@
+package com.template.common.constanst;
+
+/**
+ * <p>Title: Constanst</p>
+ * <p>Description: 系统所用到的常量 </p>
+ * @author fengyong
+ * @date 2018年9月7日
+ */
+public class Constanst {
+	
+	/**
+	 * 自定义加密措施
+	 */
+	public static final String PWD_MD5 = "FeNG#@YOnG";
+
+}

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

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

+ 43 - 0
src/main/java/com/template/common/jh/ReqRespResearchProductQuestionnaireItem.java

@@ -0,0 +1,43 @@
+package com.template.common.jh;
+
+import java.io.Serializable;
+
+public class ReqRespResearchProductQuestionnaireItem implements Serializable {
+    private static final long serialVersionUID = -2850886454687095222L;
+    private String minValue;
+    private String maxValue;
+    //"范围符号:1-大于/2-小于/3-等于/4-不等于/5-大于等于/6-小于等于/7-全闭区间/8-左闭右开区间/9-左开右闭区间/10-全开区间"
+    private Byte symbol;
+
+    public ReqRespResearchProductQuestionnaireItem( String minValue, String maxValue, Byte symbol) {
+        this.minValue = minValue;
+        this.maxValue = maxValue;
+        this.symbol = symbol;
+    }
+
+    public String getMinValue() {
+        return minValue;
+    }
+
+    public void setMinValue(String minValue) {
+        this.minValue = minValue;
+    }
+
+    public String getMaxValue() {
+        return maxValue;
+    }
+
+    public void setMaxValue(String maxValue) {
+        this.maxValue = maxValue;
+    }
+
+    public Byte getSymbol() {
+        return symbol;
+    }
+
+    public void setSymbol(Byte symbol) {
+        this.symbol = symbol;
+    }
+}
+
+

+ 243 - 0
src/main/java/com/template/common/jh/SectionUtil.java

@@ -0,0 +1,243 @@
+package com.template.common.jh;
+
+import java.math.BigDecimal;
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * @description: 区间工具类
+ * @author: wyj
+ * @time: 2020/3/1 15:05
+ */
+public class SectionUtil {
+    //最小值
+    private String min_entity;
+    //最大值
+    private String max_entity;
+    //左侧括号状态:false -开区间  true-- 闭区间
+    private boolean left_sate = false;
+    //右侧括号状态:false -开区间  true-- 闭区间
+    private boolean right_sate = false;
+    private SectionUtil() {
+
+    }
+
+    public SectionUtil(String min_entity, String max_entity, boolean left_sate, boolean right_sate) {
+        this.min_entity = min_entity;
+        this.max_entity = max_entity;
+        this.left_sate = left_sate;
+        this.right_sate = right_sate;
+    }
+
+    public String getMin_entity() {
+        return min_entity;
+    }
+
+    public String getMax_entity() {
+        return max_entity;
+    }
+
+    public boolean isLeft_sate() {
+        return left_sate;
+    }
+
+    public boolean isRight_sate() {
+        return right_sate;
+    }
+
+    /**
+     * @description: 创建负区间((负无穷,X])
+     * @param value 区间最大值
+     * @param right_sate 区间开闭状态
+     * @Date: 2020/3/2 14:37
+     */
+    public static SectionUtil creatFu(String value, boolean right_sate) {
+
+        return new SectionUtil("", value, false, right_sate);
+    }
+    /**
+     * @description: 创建正区间[X,正无穷))
+     * @param value 区间最小值
+     * @param left_sate 区间开闭状态
+     * @Date: 2020/3/2 14:37
+     */
+    public static SectionUtil creatZheng(String value, boolean left_sate) {
+
+        return new SectionUtil(value, "", left_sate, false);
+    }
+    /**
+     * @description: 创建闭合区间([X,Y])
+     * @param min   区间最小值
+     * @param max   区间最大值
+     * @param left_sate 区间左侧开闭状态
+     * @param right_sate 区间右侧开闭状态
+     * @return
+     * @Date: 2020/3/2 14:41
+     */
+    public static SectionUtil creat(String min, boolean left_sate, String max, boolean right_sate) {
+
+        return new SectionUtil(min, max, left_sate, right_sate);
+    }
+    /**
+     * @description:  将实体类转换成区间集合
+     * @param record  待转换的实体类
+     * @return 转换后的区间集合类(不等于时转换后为2个区间,所以采用集合)
+     * @Date: 2020/3/2 14:19
+     */
+    public static List<SectionUtil> getSections(ReqRespResearchProductQuestionnaireItem record) {
+        List<SectionUtil> list = new ArrayList<>();
+        String record_max = record.getMaxValue();
+        String record_min = record.getMinValue();
+        switch (record.getSymbol()) {
+            case 1:
+                list.add(creatZheng(record_max, false));
+                break;
+            case 2:
+                list.add(creatFu(record_max, false));
+                break;
+            case 3:
+                list.add(creat(record_max, true, record_max, true));
+                break;
+            case 4:
+                list.add(creatFu(record_max, false));
+                list.add(creatZheng(record_max, false));
+                break;
+            case 5:
+                list.add(creatZheng(record_max, true));
+                break;
+            case 6:
+                list.add(creatFu(record_max, true));
+                break;
+            case 7:
+                list.add(creat(record_min, true, record_max, true));
+                break;
+            case 8:
+                list.add(creat(record_min, true, record_max, false));
+                break;
+            case 9:
+                list.add(creat(record_min, false, record_max, true));
+                break;
+            case 10:
+                list.add(creat(record_min, false, record_max, false));
+                break;
+        }
+        return list;
+    }
+
+
+
+    public int compareTo(String first_value, String second_value) {
+        //first_value为空表示为正无穷,second_value为空表示为负无穷
+        if (isBlank(first_value) || isBlank(second_value)) {
+            return 1;
+        }
+        return compareToValue(first_value,second_value);
+    }
+    //判断字符串是否为空
+    public static boolean isBlank(String str) {
+        int strLen;
+        if (str == null || (strLen = str.length()) == 0) {
+            return true;
+        }
+        for (int i = 0; i < strLen; i++) {
+            if ((Character.isWhitespace(str.charAt(i)) == false)) {
+                return false;
+            }
+        }
+        return true;
+    }
+
+    /**
+     * @param record 判断区间是否有重合
+     * @return true-有重合  false -无重合
+     * @description: 判断当前区间是否和指定区间重合
+     * @Date: 2020/3/2 10:20
+     */
+    public boolean isChonghe(SectionUtil record) {
+        String min_entity = record.getMin_entity();
+        String max_entity = record.getMax_entity();
+        boolean left_sate = record.isLeft_sate();
+        boolean right_sate = record.isRight_sate();
+        boolean left_isok = false;
+        boolean right_isok = false;
+        //重合条件,第一个区间最大值大于第二个区间最小值并且第一个区间的最小值小于第二个区间的最大值
+        //注意传值顺序,第一个值为第一个区间的最大值(此处不能反)
+        int first_result = compareTo(this.max_entity, min_entity);
+        if ((first_result == 0 && this.right_sate && left_sate) || (first_result > 0)) {
+            left_isok = true;
+        }
+        //注意传值顺序,第一个值为第二个区间的最大值(此处不能反)
+        int second_result = compareTo(max_entity, this.min_entity);
+        //此处本应该是second_result<0,但由于上一步参数传递时时反正传递,故此此处为second_result>0
+        if ((second_result == 0 && this.left_sate && right_sate) || second_result > 0) {
+            right_isok = true;
+        }
+        return left_isok && right_isok;
+    }
+    /**
+     * @description:   比较集合中区间是否有重叠
+     * @param list1 待比较集合1
+     * @param list2 待比较集合2
+     * @return
+     * @Date: 2020/3/2 11:49
+     */
+    public static boolean isChonghe(List<SectionUtil> list1, List<SectionUtil> list2) {
+        boolean chonghed = false;
+        for (SectionUtil item1 : list1) {
+            for (SectionUtil item2 : list2) {
+                chonghed = item1.isChonghe(item2);
+                if (chonghed) {
+                    return true;
+                }
+            }
+        }
+        return chonghed;
+    }
+
+    //比较大小
+    public static int compareToValue(String value1, String value2) {
+        BigDecimal b1 = new BigDecimal(value1);
+        BigDecimal b2 = new BigDecimal(value2);
+        return b1.compareTo(b2);
+    }
+
+    /**
+     * @description:   判断集合中区间是否重叠
+     * @param list  待判断集合
+     * @return  fasle-无重叠 true-有重叠
+     * @Date: 2020/3/3 14:51
+     */
+    public static boolean compareSection(List<ReqRespResearchProductQuestionnaireItem> list) {
+        for (int i = 0; i < list.size(); i++) {
+            ReqRespResearchProductQuestionnaireItem record = list.get(i);
+            for (int j = i + 1; j < list.size(); j++) {
+                ReqRespResearchProductQuestionnaireItem item = list.get(j);
+                //判断区间是否有交叉
+                List<SectionUtil> records = SectionUtil.getSections(record);
+                List<SectionUtil> items = SectionUtil.getSections(item);
+                boolean chonghe = SectionUtil.isChonghe(records, items);
+                if (chonghe) {
+                    return true;
+                }
+            }
+        }
+        return false;
+    }
+
+    public static void main(String[] args) {
+        List<ReqRespResearchProductQuestionnaireItem> all = new ArrayList<>();
+        ReqRespResearchProductQuestionnaireItem re1 = new ReqRespResearchProductQuestionnaireItem("110","120", (byte) 7);
+        ReqRespResearchProductQuestionnaireItem re2 = new ReqRespResearchProductQuestionnaireItem("90","112", (byte) 7);
+        ReqRespResearchProductQuestionnaireItem re3 = new ReqRespResearchProductQuestionnaireItem("80","89", (byte) 7);
+        ReqRespResearchProductQuestionnaireItem re4 = new ReqRespResearchProductQuestionnaireItem("60","79", (byte) 7);
+        ReqRespResearchProductQuestionnaireItem re5 = new ReqRespResearchProductQuestionnaireItem("0","59", (byte) 7);
+        all.add(re1);
+        all.add(re2);
+        all.add(re3);
+        all.add(re4);
+        all.add(re5);
+        System.out.println(compareSection(all));
+    }
+}
+
+

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

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

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

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

+ 84 - 0
src/main/java/com/template/common/utils/AesTestOne.java

@@ -0,0 +1,84 @@
+package com.template.common.utils;
+
+import org.apache.commons.codec.binary.Base64;
+
+import javax.annotation.Resource;
+import javax.crypto.Cipher;
+import javax.crypto.spec.IvParameterSpec;
+import javax.crypto.spec.SecretKeySpec;
+import java.io.UnsupportedEncodingException;
+import java.net.URLDecoder;
+import java.nio.charset.Charset;
+import java.nio.charset.StandardCharsets;
+
+/**
+ * @Author: binguo
+ * @Date: 2024/1/5 星期五 14:26
+ * @Description: com.template.common.utils
+ * @Version: 1.0
+ */
+public class AesTestOne {
+
+    /**
+     * AES 对称加密(RSA非对称加密)
+     * CBC 有向量 (ECB 无向量)
+     * PKCS5Padding 填充模式(NoPadding 无填充)
+     */
+    private static final String ALG_AES_CBC_PKCS5 = "AES/CBC/PKCS5Padding";
+
+    private static final String ALGORITHM = "AES";
+
+    private static final Charset UTF8 = StandardCharsets.UTF_8;
+
+    //private static String aesKey = "61afd794ed3244e995c5e894e5788193";  // 指定好的秘钥,非Base64和16进制
+
+    private static String aesIv = "activevector4api";   // 偏移量
+
+    private static SecretKeySpec skeySpec;
+
+    private static IvParameterSpec iv;
+
+    /**
+     * 解密方法
+     * @param cipherStr Base64编码的加密字符串
+     * @return 解密后的字符串(UTF8编码)
+     * @throws Exception 异常
+     */
+    public static String decrypt(String cipherStr, String appSecret) throws Exception{
+        // step 1 获得一个密码器
+        Cipher cipher = Cipher.getInstance(ALG_AES_CBC_PKCS5);
+        // step 2 初始化密码器,指定是加密还是解密(Cipher.DECRYPT_MODE 解密; Cipher.ENCRYPT_MODE 加密)
+        // 加密时使用的盐来够造秘钥对象
+        skeySpec = new SecretKeySpec(appSecret.getBytes(),ALGORITHM);
+        // 加密时使用的向量,16位字符串
+        iv = new IvParameterSpec(aesIv.getBytes());
+        cipher.init(Cipher.DECRYPT_MODE, skeySpec, iv);
+        // 对加密报文进行base64解码
+        byte[] encrypted1 = Base64.decodeBase64(cipherStr);
+        // 解密后的报文数组
+        byte[] original = cipher.doFinal(encrypted1);
+        // 输出utf8编码的字符串,输出字符串需要指定编码格式
+        return new String(original, UTF8);
+    }
+
+    /**
+     * 加密
+     * @param plainText 明文
+     * @return Base64编码的密文
+     * @throws Exception  加密异常
+     */
+    public static String encrypt(String plainText, String appSecret) throws Exception{
+        Cipher cipher = Cipher.getInstance(ALG_AES_CBC_PKCS5);
+        skeySpec = new SecretKeySpec(appSecret.getBytes(),ALGORITHM);
+        iv = new IvParameterSpec(aesIv.getBytes());
+        cipher.init(Cipher.ENCRYPT_MODE, skeySpec,iv);
+        // 这里的编码格式需要与解密编码一致
+        byte [] encryptText = cipher.doFinal(plainText.getBytes(UTF8));
+        return Base64.encodeBase64String(encryptText);
+    }
+
+    public static void main(String[] args) throws Exception {
+        // URL解码
+        System.out.println("");
+    }
+}

+ 165 - 0
src/main/java/com/template/common/utils/AesUtil.java

@@ -0,0 +1,165 @@
+package com.template.common.utils;
+
+import javax.crypto.BadPaddingException;
+import javax.crypto.Cipher;
+import javax.crypto.IllegalBlockSizeException;
+import javax.crypto.NoSuchPaddingException;
+import javax.crypto.spec.IvParameterSpec;
+import javax.crypto.spec.SecretKeySpec;
+import java.security.InvalidAlgorithmParameterException;
+import java.security.InvalidKeyException;
+import java.security.NoSuchAlgorithmException;
+import java.util.UUID;
+
+/**
+ * <p>Title: AesUtil</p>
+ * <p>Description: AES加密解密</p>
+ * @author fengyong
+ * @date 2018年9月7日
+ */
+public class AesUtil {
+
+	/**
+	 * 秘钥
+	 */
+	public static final String PASSWORD_SECRET_KEY = "EasyRailEveryday";
+	
+	/**
+	 * 初始向量
+	 */
+	public static final String INITIAL_VECTOR = "EasyRailEasyRail";
+	
+    /**
+     * 加密
+     * @param content 需要加密的内容
+     * @param password  加密密码
+     * @param keySize 密钥长度16,24,32(密码长度为24和32时需要将local_policy.jar/US_export_policy.jar两个jar包放到JRE目录%jre%/lib/security下)
+     * @return
+     */
+    public static byte[] encrypt(String content, String password, int keySize){
+    	try {                              
+        	//密钥长度不够用0补齐。
+    		SecretKeySpec key = new SecretKeySpec(ZeroPadding(password.getBytes(Base64Util.DEFAULT_CHARSET), keySize), "AES");
+    		//定义加密算法AES、算法模式ECB、补码方式PKCS5Padding
+            //Cipher cipher = Cipher.getInstance("AES/ECB/PKCS5Padding");
+    		//定义加密算法AES 算法模式CBC、补码方式PKCS5Padding
+            Cipher cipher = Cipher.getInstance("AES/CBC/PKCS5Padding");
+            //CBC模式模式下初始向量 不足16位用0补齐
+            IvParameterSpec iv = new IvParameterSpec(ZeroPadding(INITIAL_VECTOR.getBytes(Base64Util.DEFAULT_CHARSET),16));
+            byte[] byteContent = content.getBytes();  
+            //初始化加密
+            //ECB
+            //cipher.init(Cipher.ENCRYPT_MODE, key);
+            //CBC 
+			cipher.init(Cipher.ENCRYPT_MODE, key,iv);
+            byte[] result = cipher.doFinal(byteContent);
+            return result; 
+        } catch (NoSuchAlgorithmException e) {
+            e.printStackTrace();
+        } catch (NoSuchPaddingException e) {
+            e.printStackTrace();
+        } catch (InvalidKeyException e) {
+            e.printStackTrace();
+        } catch (IllegalBlockSizeException e) {
+            e.printStackTrace();
+        } catch (BadPaddingException e) {
+            e.printStackTrace();
+        } catch (InvalidAlgorithmParameterException e) {
+        	e.printStackTrace();
+        } catch (Exception e) {
+        	e.printStackTrace();
+        }
+        return null;
+    }
+    
+    /**解密
+     * @param content  待解密内容
+     * @param password 解密密钥
+     * @param keySize 密钥长度16,24,32(密码长度为24和32时需要将local_policy.jar/US_export_policy.jar两个jar包放到JRE目录%jre%/lib/security下)
+     * @return
+     */
+    public static String decrypt(byte[] content, String password, int keySize) {
+        try { 
+        	//密钥长度不够用0补齐。
+    		SecretKeySpec key = new SecretKeySpec(ZeroPadding(password.getBytes(), keySize), "AES");
+    		//定义加密算法AES、算法模式ECB、补码方式PKCS5Padding
+            //Cipher cipher = Cipher.getInstance("AES/ECB/PKCS5Padding");
+    		//定义加密算法AES 算法模式CBC、补码方式PKCS5Padding
+            Cipher cipher = Cipher.getInstance("AES/CBC/PKCS5Padding");
+            //CBC模式模式下初始向量 不足16位用0补齐
+            IvParameterSpec iv = new IvParameterSpec(ZeroPadding(INITIAL_VECTOR.getBytes(Base64Util.DEFAULT_CHARSET),16));
+            // 初始化解密
+            //ECB
+            //cipher.init(Cipher.DECRYPT_MODE, key);
+            //CBC
+            cipher.init(Cipher.DECRYPT_MODE, key,iv);
+            byte[] result = cipher.doFinal(content);
+            return new String(result,Base64Util.DEFAULT_CHARSET); 
+        } catch (NoSuchAlgorithmException e) {
+        	e.printStackTrace();
+        } catch (NoSuchPaddingException e) {
+        	e.printStackTrace();
+        } catch (InvalidKeyException e) {
+        	e.printStackTrace();
+        } catch (IllegalBlockSizeException e) {
+        	e.printStackTrace();
+        } catch (BadPaddingException e) {
+        	e.printStackTrace();
+        } catch (InvalidAlgorithmParameterException e){
+        	e.printStackTrace();
+        } catch (Exception e){
+        	e.printStackTrace();
+        }
+        return null;
+    }
+    
+    /**将二进制转换成16进制
+     * @param buf
+     * @return
+     */
+    public static String parseByte2HexStr(byte buf[]) {
+        StringBuilder sb = new StringBuilder();
+        for (int i = 0; i < buf.length; i++) {
+            String hex = Integer.toHexString(buf[i] & 0xFF);
+            if (hex.length() == 1) {
+                    hex = '0' + hex;
+            }
+            sb.append(hex.toUpperCase());
+        }
+        return sb.toString();
+    }
+    
+    /**将16进制转换为二进制
+     * @param hexStr
+     * @return
+     */
+    public static byte[] parseHexStr2Byte(String hexStr) {
+        if (hexStr.length() < 1){
+        	return null;
+        }
+        byte[] result = new byte[hexStr.length()/2];
+        for (int i = 0;i< hexStr.length()/2; i++) {
+            int high = Integer.parseInt(hexStr.substring(i*2, i*2+1), 16);
+            int low = Integer.parseInt(hexStr.substring(i*2+1, i*2+2), 16);
+            result[i] = (byte) (high * 16 + low);
+        }
+        return result;
+    }
+    
+    /**
+     * 字符达不到指定长度补0
+     * @param in 字符数组
+     * @param blockSize 长度
+     * @return
+     */
+    public static byte[] ZeroPadding(byte[] in,Integer blockSize){
+    	Integer copyLen = in.length;
+    	if (copyLen > blockSize) {
+			copyLen = blockSize;
+		}
+    	byte[] out = new byte[blockSize];
+    	System.arraycopy(in, 0, out, 0, copyLen);
+    	return out;
+    }
+
+}

+ 47 - 0
src/main/java/com/template/common/utils/Base64Util.java

@@ -0,0 +1,47 @@
+package com.template.common.utils;
+
+import org.apache.tomcat.util.codec.binary.Base64;
+
+import java.nio.charset.Charset;
+
+/**
+ * <p>Title: Base64Util</p>
+ * <p>Description: Base64Util工具类 --- 加密和解密</p>
+ * @author fengyong
+ * @date 2018年9月7日
+ */
+public class Base64Util {
+	
+	public static final Charset DEFAULT_CHARSET = Charset.forName("UTF-8");
+	/**
+     * 解密
+     * @param str
+     * @return
+     */
+    public static String decodeStr(String str){
+        if (str == null) {
+			return null;
+		}
+		if (str.length() == 0) {
+			return "";
+		}
+		return new String(Base64.decodeBase64(new String(str).getBytes(DEFAULT_CHARSET)),DEFAULT_CHARSET).trim();
+    }
+
+    /**
+     * 加密
+     * 
+     * @param str
+     * @return
+     */
+    public static String encodeStr(String str){
+        if (str == null) {
+			return null;
+		}
+		if (str.length() == 0) {
+			return "";
+		}
+        return new String(Base64.encodeBase64Chunked(str.getBytes(DEFAULT_CHARSET)),DEFAULT_CHARSET).trim();
+    }
+
+}

+ 44 - 6
src/main/java/com/template/common/utils/CommonUtil.java

@@ -10,6 +10,8 @@ import java.time.LocalDate;
 import java.time.LocalDateTime;
 import java.time.LocalTime;
 import java.util.*;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
 
 /**
  * 公共工具类
@@ -17,6 +19,41 @@ import java.util.*;
 @Slf4j
 public class CommonUtil {
     /**
+     * 检查字符串是否符合正则表达式
+     */
+    public static boolean checkStrByRegx(String regex, String str) {
+        //使用Pattern类的compile()方法编译正则表达式
+        Pattern pattern = Pattern.compile(regex);
+        //使用Matcher类的matcher()方法将正则表达式和字符串进行匹配
+        Matcher matcher = pattern.matcher(str);
+        //返回匹配结果
+        return matcher.matches();
+    }
+
+    /**
+     * 检测客户端参数
+     *
+     * @param code   状态码
+     * @param object 对象
+     * @return 返回类型
+     */
+    public static Map<String, Object> getReturnMap(String code, Object object) {
+        Map<String, Object> returnMap = new HashMap<>();
+        returnMap.put("code", code);
+        returnMap.put("msg", object);
+        return returnMap;
+    }
+
+    public static String getNumberFromString(String string) {
+        Pattern pattern = Pattern.compile("\\d+");
+        Matcher matcher = pattern.matcher(string);
+        if (matcher.find()) {
+            return matcher.group();
+        }
+        return null;
+    }
+
+    /**
      * 获取ip
      *
      * @param request
@@ -26,18 +63,18 @@ public class CommonUtil {
         String ipAddress = null;
         try {
             ipAddress = request.getHeader("x-forwarded-for");
-            System.out.println("x-forwarded-for="+ipAddress);
+            System.out.println("x-forwarded-for=" + ipAddress);
             if (ipAddress == null || ipAddress.length() == 0 || "unknown".equalsIgnoreCase(ipAddress)) {
                 ipAddress = request.getHeader("Proxy-Client-IP");
-                System.out.println("Proxy-Client-IP="+ipAddress);
+                System.out.println("Proxy-Client-IP=" + ipAddress);
             }
             if (ipAddress == null || ipAddress.length() == 0 || "unknown".equalsIgnoreCase(ipAddress)) {
                 ipAddress = request.getHeader("WL-Proxy-Client-IP");
-                System.out.println("WL-Proxy-Client-IP="+ipAddress);
+                System.out.println("WL-Proxy-Client-IP=" + ipAddress);
             }
             if (ipAddress == null || ipAddress.length() == 0 || "unknown".equalsIgnoreCase(ipAddress)) {
                 ipAddress = request.getRemoteAddr();
-                System.out.println("getRemoteAddr="+ipAddress);
+                System.out.println("getRemoteAddr=" + ipAddress);
                 if (ipAddress.equals("127.0.0.1")) {
                     // 根据网卡取本机配置的IP
                     InetAddress inet = null;
@@ -47,7 +84,7 @@ public class CommonUtil {
                         e.printStackTrace();
                     }
                     ipAddress = inet.getHostAddress();
-                    System.out.println("getHostAddress="+ipAddress);
+                    System.out.println("getHostAddress=" + ipAddress);
                 }
             }
             // 对于通过多个代理的情况,第一个IP为客户端真实IP,多个IP按照','分割
@@ -161,8 +198,9 @@ public class CommonUtil {
 
     /**
      * LocalDate 拼接时间转成 LocalDateTime
+     *
      * @param localDate
-     * @param timeStr HH:mm:ss
+     * @param timeStr   HH:mm:ss
      * @return
      */
     public static LocalDateTime localDateToTime(LocalDate localDate, String timeStr) {

+ 9 - 0
src/main/java/com/template/common/utils/DataBliu.java

@@ -0,0 +1,9 @@
+package com.template.common.utils;
+
+public class DataBliu {
+
+    public static double getTwo(double d1){
+        return (double) Math.round(d1 * 100) / 100;
+    }
+
+}

+ 241 - 0
src/main/java/com/template/common/utils/DateUtils.java

@@ -0,0 +1,241 @@
+package com.template.common.utils;
+
+import org.springframework.stereotype.Component;
+
+import java.sql.Timestamp;
+import java.text.ParseException;
+import java.text.SimpleDateFormat;
+import java.util.Calendar;
+import java.util.Date;
+import java.util.GregorianCalendar;
+
+/**
+ * <p>Title: DateUtils</p>
+ * <p>Description:日期工具类 </p>
+ * 
+ * @author fengyong
+ * @date 2018年9月7日
+ */
+@Component // 加此注解是把此类实例化spring容器中
+public class DateUtils {
+
+	/**
+	 * 默认日期格式
+	 */
+	public static final String DEFAULT_FORMAT = "yyyy-MM-dd HH:mm:ss";
+
+	/**
+	 * 如2018 0901 232211(年月日时分秒)
+	 * 
+	 * @return
+	 */
+	public String yyyyMMddHHmmss() {
+		SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMddHHmmss");
+		return sdf.format(Calendar.getInstance().getTime());
+	}
+
+	/**
+	 * 如20180901
+	 * 
+	 * @return
+	 */
+	public static String getYYYYMMdd() {
+		SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMdd");
+		return sdf.format(Calendar.getInstance().getTime());
+	}
+
+	/**
+	 * 如180901
+	 * @return
+	 */
+	public String getYYMMdd() {
+		SimpleDateFormat sdf = new SimpleDateFormat("yyMMdd");
+		return sdf.format(Calendar.getInstance().getTime());
+	}
+
+	/**
+	 * 如201809
+	 * @return
+	 */
+	public String getYYYYMM() {
+		SimpleDateFormat sdf = new SimpleDateFormat("yyyyMM");
+		return sdf.format(Calendar.getInstance().getTime());
+	}
+
+	/**
+	 * 如 2018/02/11
+	 * @return
+	 */
+	public String getQueryEndDate() {
+		SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
+		return sdf.format(Calendar.getInstance().getTime());
+	}
+
+	/**
+	 * 如 2018/02/11
+	 * @return
+	 */
+	public String getQueryStartDate() {
+		SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
+		Calendar cal = Calendar.getInstance();
+		cal.add(Calendar.DAY_OF_YEAR, -30);
+		return sdf.format(cal.getTime());
+	}
+
+	/**
+	 * 如 2018/02/11 12:30:00
+	 * @return
+	 */
+	public static String getQueryEndTime() {
+		SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
+		return sdf.format(Calendar.getInstance().getTime());
+	}
+
+	/**
+	 * 如 2018/02/11
+	 * @return
+	 */
+	public String getQueryStartTime() {
+		SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
+		Calendar cal = Calendar.getInstance();
+		cal.add(Calendar.DAY_OF_YEAR, -30);
+		return sdf.format(cal.getTime());
+	}
+
+	public String getQueryTwoAgoDate() {
+		SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
+		Calendar cal = Calendar.getInstance();
+		cal.add(Calendar.DAY_OF_YEAR, -2);
+		return sdf.format(cal.getTime());
+	}
+
+	/**
+	 * 字符串转换成日期
+	 * 
+	 * @param str 字符串
+	 * @param format 日期格式
+	 * @return 日期
+	 */
+	public static Date str2Date(String str, String format) {
+		if (null == str || "".equals(str)) {
+			return null;
+		}
+		// 如果没有指定字符串转换的格式,则用默认格式进行转换
+		if (null == format || "".equals(format)) {
+			format = DEFAULT_FORMAT;
+		}
+		SimpleDateFormat sdf = new SimpleDateFormat(format);
+		Date date = null;
+		try {
+			date = sdf.parse(str);
+			return date;
+		} catch (ParseException e) {
+		}
+		return null;
+	}
+
+	/**
+	 * @param date 日期
+	 * @param format 日期格式
+	 * @return 字符串
+	 */
+	public static String date2Str(Date date, String format) {
+		if (null == date) {
+			return null;
+		}
+		SimpleDateFormat sdf = new SimpleDateFormat(format);
+		return sdf.format(date);
+	}
+
+	/**
+	 * 时间戳转换为字符串
+	 * @param time
+	 * @return
+	 */
+	public static String timestamp2Str(Timestamp time) {
+		Date date = new Date(time.getTime());
+		return date2Str(date, DEFAULT_FORMAT);
+	}
+
+	/**
+	 * 字符串转换为时间
+	 * @param str
+	 * @return
+	 */
+	public static Timestamp str2Timestamp(String str) {
+		Date date = str2Date(str, DEFAULT_FORMAT);
+		return new Timestamp(date.getTime());
+	}
+
+	/**
+	 * 字符串转换为时间
+	 * @param str
+	 * @return
+	 */
+	public static Timestamp str2Timestamp(String str, String formatStr) {
+		if (null == str) {
+			return null;
+		}
+		Date date = str2Date(str, formatStr);
+		return new Timestamp(date.getTime());
+	}
+
+	/**
+	 * 获取某年第一天日期
+	 * @param year 年份
+	 * @return Date
+	 */
+	public static Date getYearFirst(int year) {
+		Calendar calendar = Calendar.getInstance();
+		calendar.clear();
+		calendar.set(Calendar.YEAR, year);
+		Date currYearFirst = calendar.getTime();
+		return currYearFirst;
+	}
+
+	/**
+	 * 获取某年最后一天日期
+	 * @param year  年份
+	 * @return Date
+	 */
+	public static Date getYearLast(int year) {
+		Calendar calendar = Calendar.getInstance();
+		calendar.clear();
+		calendar.set(Calendar.YEAR, year);
+		calendar.roll(Calendar.DAY_OF_YEAR, -1);
+		Date currYearLast = calendar.getTime();
+
+		return currYearLast;
+	}
+
+	@SuppressWarnings("static-access")
+	public static Date getnextLast(String datetime, int year) {
+		Calendar calendar = new GregorianCalendar();
+		Date date = null;
+		if (datetime.length() > 7) {
+			date = str2Date(datetime, "yyyy-MM-dd");
+		} else {
+			date = str2Date(datetime, "yyyy-MM");
+		}
+		calendar.setTime(date);
+		calendar.add(calendar.YEAR, year);// 把日期往后增加一年.整数往后推,负数往前移动
+		date = calendar.getTime();
+		return date;
+
+	}
+
+	public static String getrightDate(String datetime, int year) {
+		String date = "";
+		String years = datetime.substring(0, 4);
+		String dates = datetime.substring(4, datetime.length());
+		Integer s = new Integer(years) + year;
+		date = s + dates;
+		return date;
+	}
+
+	public static void main(String[] args) {
+		System.out.println(getrightDate("2018-09", 4));
+		System.out.println(date2Str(getnextLast("2018-09", 4), "yyyy-MM"));
+	}
+
+}

+ 82 - 0
src/main/java/com/template/common/utils/EncryptUtil.java

@@ -0,0 +1,82 @@
+package com.template.common.utils;
+
+import javax.crypto.Cipher;
+import javax.crypto.SecretKey;
+import javax.crypto.SecretKeyFactory;
+import javax.crypto.spec.DESKeySpec;
+import java.security.SecureRandom;
+import java.util.Base64;
+
+/**
+ * 对称加密算法
+ *
+ * @Date: 2024/2/26 星期一 10:31
+ * @Description: com.template.common.utils
+ * @Version: 1.0
+ */
+public class EncryptUtil {
+    public static String secretKeyB = "com.template.common.utils";
+    private final static String DES = "DES";
+
+    //加密
+    public static String encrypt(String data) {
+        byte[] bt;
+        try {
+            bt = encrypt(data.getBytes(), secretKeyB.getBytes());
+            //加密
+            String strs = Base64.getEncoder().encodeToString(bt);
+            return strs;
+        } catch (Exception e) {
+            e.printStackTrace();
+            return null;
+        }
+    }
+
+    //解密
+    public static String decrypt(String data) {
+        if (data == null) {
+            return null;
+        }
+        byte[] buf;
+        byte[] bt;
+        try {
+            //解密
+            buf = Base64.getDecoder().decode(data);
+            bt = decrypt(buf, secretKeyB.getBytes());
+            return new String(bt);
+        } catch (Exception e) {
+            e.printStackTrace();
+            return null;
+        }
+    }
+
+    private static byte[] encrypt(byte[] data, byte[] key) throws Exception {
+        // 生成可信任的随机数源
+        SecureRandom sr = new SecureRandom();
+        // 从原始密钥数据创建DESKeySpec对象
+        DESKeySpec dks = new DESKeySpec(key);
+        // 创建密钥工厂,然后用它把DESKeySpec转换成SecretKey对象
+        SecretKeyFactory keyFactory = SecretKeyFactory.getInstance(DES);
+        SecretKey securekey = keyFactory.generateSecret(dks);
+        // Cipher对象实际完成加密操作
+        Cipher cipher = Cipher.getInstance(DES);
+        // 用密钥初始化Cipher对象
+        cipher.init(Cipher.ENCRYPT_MODE, securekey, sr);
+        return cipher.doFinal(data);
+    }
+
+    private static byte[] decrypt(byte[] data, byte[] key) throws Exception {
+        // 生成可信任的随机数源
+        SecureRandom sr = new SecureRandom();
+        // 从原始密钥数据创建DESKeySpec对象
+        DESKeySpec dks = new DESKeySpec(key);
+        // 创建密钥工厂,然后用它把DESKeySpec转换成SecretKey对象
+        SecretKeyFactory keyFactory = SecretKeyFactory.getInstance(DES);
+        SecretKey securekey = keyFactory.generateSecret(dks);
+        // Cipher对象实际完成解密操作
+        Cipher cipher = Cipher.getInstance(DES);
+        // 用密钥初始化Cipher对象
+        cipher.init(Cipher.DECRYPT_MODE, securekey, sr);
+        return cipher.doFinal(data);
+    }
+}

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

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

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

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

+ 64 - 0
src/main/java/com/template/common/utils/ExcelUtils.java

@@ -0,0 +1,64 @@
+package com.template.common.utils;
+
+import lombok.extern.slf4j.Slf4j;
+import org.apache.poi.ss.usermodel.Workbook;
+import org.springframework.boot.system.ApplicationHome;
+
+import javax.servlet.http.HttpServletResponse;
+import java.io.*;
+import java.net.URLDecoder;
+import java.net.URLEncoder;
+
+/**
+ * @Author: binguo
+ * @Date: 2023/7/10 星期一 14:21
+ * @Description: com.repair.common.utils
+ * @Version: 1.0
+ */
+@Slf4j
+public class ExcelUtils {
+    public static void fileDownload(String fileName, HttpServletResponse response) {
+        try {
+            ApplicationHome applicationHome = new ApplicationHome(ExcelUtils.class);
+            String pathResouce = applicationHome.getDir().getParentFile().getParentFile().getAbsolutePath();
+            String decode = URLDecoder.decode(pathResouce, "utf-8");
+            File readPath = new File(decode + "/project/repair" + File.separator);
+            File file = new File(readPath.getAbsolutePath() + fileName);
+            // 获取文件名
+            String filename = file.getName();
+            // 获取文件后缀名
+            String ext = filename.substring(filename.lastIndexOf(".") + 1).toLowerCase();
+            InputStream inputStream = new FileInputStream(file);//根据路径获取要下载的文件输入流
+            response.setContentType("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet");
+            response.setCharacterEncoding("utf-8");
+            response.setHeader("Content-disposition", "attachment;fileName=" + URLEncoder.encode(filename, "UTF-8"));
+            OutputStream out = response.getOutputStream();
+            byte[] b = new byte[1024];  //创建数据缓冲区
+            int length;
+            while ((length = inputStream.read(b)) > 0) {  //把文件流写到缓冲区里
+                out.write(b, 0, length);
+            }
+            out.flush();
+            out.close();
+            inputStream.close();
+        } catch (IOException ex) {
+            System.out.println("模板导出失败:" + ex.getMessage());
+            ex.printStackTrace();
+        }
+    }
+
+    public static void excelDownload(Workbook workbook, String fileName, HttpServletResponse response) {
+        try {
+            response.setContentType("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet");
+            response.setCharacterEncoding("utf-8");
+            response.setHeader("Content-disposition", "attachment;fileName=" + URLEncoder.encode(fileName, "UTF-8"));
+            OutputStream out = response.getOutputStream();
+            workbook.write(out);
+            out.flush();
+            out.close();
+        } catch (IOException ex) {
+            System.out.println("模板导出失败:" + ex.getMessage());
+            ex.printStackTrace();
+        }
+    }
+}

File diff suppressed because it is too large
+ 1008 - 0
src/main/java/com/template/common/utils/ExcelUtils2.java


+ 76 - 0
src/main/java/com/template/common/utils/FileUtils.java

@@ -0,0 +1,76 @@
+package com.template.common.utils;
+
+
+import org.apache.commons.fileupload.FileItem;
+import org.apache.commons.fileupload.FileItemFactory;
+import org.apache.commons.fileupload.disk.DiskFileItemFactory;
+import org.springframework.http.MediaType;
+import org.springframework.web.multipart.MultipartFile;
+import org.springframework.web.multipart.commons.CommonsMultipartFile;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.OutputStream;
+
+/**
+ * @Author: binguo
+ * @Date: 2023/12/27 星期三 11:08
+ * @Description: com.template.common.utils
+ * @Version: 1.0
+ */
+public class FileUtils {
+
+
+    /**
+     * 获取封装得MultipartFile
+     *
+     * @param inputStream inputStream
+     * @return MultipartFile
+     */
+    public static MultipartFile getMultipartFile(InputStream inputStream, String fileName) {
+        FileItem fileItem = createFileItem(inputStream, fileName);
+        //CommonsMultipartFile是feign对multipartFile的封装,但是要FileItem类对象
+        return new CommonsMultipartFile(fileItem);
+    }
+    /**
+     * FileItem类对象创建
+     *
+     * @param inputStream inputStream
+     * @param fileName    fileName
+     * @return FileItem
+     */
+    public static FileItem createFileItem(InputStream inputStream, String fileName) {
+        FileItemFactory factory = new DiskFileItemFactory(16, null);
+        String textFieldName = "file";
+        FileItem item = factory.createItem(textFieldName, MediaType.MULTIPART_FORM_DATA_VALUE, true, fileName);
+        int bytesRead = 0;
+        byte[] buffer = new byte[10 * 1024 * 1024];
+        OutputStream os = null;
+        //使用输出流输出输入流的字节
+        try {
+            os = item.getOutputStream();
+            while ((bytesRead = inputStream.read(buffer, 0, 8192)) != -1) {
+                os.write(buffer, 0, bytesRead);
+            }
+            inputStream.close();
+        } catch (IOException e) {
+            throw new IllegalArgumentException("文件上传失败");
+        } finally {
+            if (os != null) {
+                try {
+                    os.close();
+                } catch (IOException e) {
+
+                }
+            }
+            if (inputStream != null) {
+                try {
+                    inputStream.close();
+                } catch (IOException e) {
+                }
+            }
+        }
+
+        return item;
+    }
+}

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

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

+ 241 - 0
src/main/java/com/template/common/utils/HttpClientUtils.java

@@ -0,0 +1,241 @@
+package com.template.common.utils;
+
+import org.apache.http.HttpEntity;
+import org.apache.http.NameValuePair;
+import org.apache.http.client.config.RequestConfig;
+import org.apache.http.client.entity.UrlEncodedFormEntity;
+import org.apache.http.client.methods.CloseableHttpResponse;
+import org.apache.http.client.methods.HttpGet;
+import org.apache.http.client.methods.HttpPost;
+import org.apache.http.conn.ssl.DefaultHostnameVerifier;
+import org.apache.http.conn.util.PublicSuffixMatcher;
+import org.apache.http.conn.util.PublicSuffixMatcherLoader;
+import org.apache.http.entity.StringEntity;
+import org.apache.http.impl.client.CloseableHttpClient;
+import org.apache.http.impl.client.HttpClients;
+import org.apache.http.message.BasicNameValuePair;
+import org.apache.http.util.EntityUtils;
+
+import java.io.IOException;
+import java.net.URL;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * <p>Title: HttpClientUtils</p>
+ * <p>Description: httpClient 工具类</p>
+ * @author fengyong
+ * @date 2018年9月7日
+ */
+public class HttpClientUtils {
+	
+	/**
+	 * 默认参数设置
+	 * setConnectTimeout:设置连接超时时间,单位毫秒。
+	 * setConnectionRequestTimeout:设置从connect Manager获取Connection 超时时间,单位毫秒。
+	 * setSocketTimeout:请求获取数据的超时时间,单位毫秒。访问一个接口,多少时间内无法返回数据,就直接放弃此次调用。 暂时定义15分钟
+	 */
+	private RequestConfig requestConfig = RequestConfig.custom().setSocketTimeout(600000).setConnectTimeout(600000).setConnectionRequestTimeout(600000).build();
+	
+	/**
+	 * 静态内部类---作用:单例产生类的实例
+	 * @author Administrator
+	 *
+	 */
+	private static class LazyHolder {    
+       private static final HttpClientUtils INSTANCE = new HttpClientUtils();    
+       
+    }  
+	private HttpClientUtils(){}
+	public static HttpClientUtils getInstance(){
+		return LazyHolder.INSTANCE;    
+	}
+	
+	/**
+	 * 发送 post请求
+	 * @param httpUrl 地址
+	 */
+	public String sendHttpPost(String httpUrl) {
+		HttpPost httpPost = new HttpPost(httpUrl);// 创建httpPost  
+		return sendHttpPost(httpPost);
+	}
+	
+	/**
+	 * 发送 post请求
+	 * @param httpUrl 地址
+	 * @param params 参数(格式:key1=value1&key2=value2)
+	 */
+	public String sendHttpPost(String httpUrl, String params) {
+		HttpPost httpPost = new HttpPost(httpUrl);// 创建httpPost  
+		try {
+			//设置参数
+			StringEntity stringEntity = new StringEntity(params, "UTF-8");
+			stringEntity.setContentType("application/x-www-form-urlencoded");
+			httpPost.setEntity(stringEntity);
+		} catch (Exception e) {
+			e.printStackTrace();
+		}
+		return sendHttpPost(httpPost);
+	}
+	
+	/**
+	 * 发送 post请求
+	 * @param httpUrl 地址
+	 * @param maps 参数
+	 */
+	public String sendHttpPost(String httpUrl, Map<String, String> maps) {
+		HttpPost httpPost = new HttpPost(httpUrl);// 创建httpPost  
+		// 创建参数队列  
+		List<NameValuePair> nameValuePairs = new ArrayList<NameValuePair>();
+		for (String key : maps.keySet()) {
+			nameValuePairs.add(new BasicNameValuePair(key, maps.get(key)));
+		}
+		try {
+			httpPost.setEntity(new UrlEncodedFormEntity(nameValuePairs, "UTF-8"));
+		} catch (Exception e) {
+			e.printStackTrace();
+		}
+		return sendHttpPost(httpPost);
+	}
+	
+	/**
+	 * 发送Post请求
+	 * @param httpPost
+	 * @return
+	 */
+	private String sendHttpPost(HttpPost httpPost) {
+		CloseableHttpClient httpClient = null;
+		CloseableHttpResponse response = null;
+		HttpEntity entity = null;
+		String responseContent = null;
+		try {
+			// 创建默认的httpClient实例
+			httpClient = HttpClients.createDefault();
+			httpPost.setConfig(requestConfig);
+			// 执行请求
+			long execStart = System.currentTimeMillis();
+			response = httpClient.execute(httpPost);
+			long execEnd = System.currentTimeMillis();
+			System.out.println("=================执行post请求耗时:"+(execEnd-execStart)+"ms");
+			long getStart = System.currentTimeMillis();
+			entity = response.getEntity();
+			responseContent = EntityUtils.toString(entity, "UTF-8");
+			long getEnd = System.currentTimeMillis();
+			System.out.println("=================获取响应结果耗时:"+(getEnd-getStart)+"ms");
+		} catch (Exception e) {
+			e.printStackTrace();
+		} finally {
+			try {
+				// 关闭连接,释放资源
+				if (response != null) {
+					response.close();
+				}
+				if (httpClient != null) {
+					httpClient.close();
+				}
+			} catch (IOException e) {
+				e.printStackTrace();
+			}
+		}
+		return responseContent;
+	}
+
+	/**
+	 * 发送 get请求
+	 * @param httpUrl
+	 */
+	public String sendHttpGet(String httpUrl) {
+		HttpGet httpGet = new HttpGet(httpUrl);// 创建get请求
+		return sendHttpGet(httpGet);
+	}
+	
+	/**
+	 * 发送 get请求Https
+	 * @param httpUrl
+	 */
+	public String sendHttpsGet(String httpUrl) {
+		HttpGet httpGet = new HttpGet(httpUrl);// 创建get请求
+		return sendHttpsGet(httpGet);
+	}
+	
+	/**
+	 * 发送Get请求
+	 * @param httpPost
+	 * @return
+	 */
+	private String sendHttpGet(HttpGet httpGet) {
+		CloseableHttpClient httpClient = null;
+		CloseableHttpResponse response = null;
+		HttpEntity entity = null;
+		String responseContent = null;
+		try {
+			// 创建默认的httpClient实例.
+
+			
+			httpClient = HttpClients.createDefault();
+
+			httpGet.setConfig(requestConfig);
+			// 执行请求
+			response = httpClient.execute(httpGet);
+			entity = response.getEntity();
+			responseContent = EntityUtils.toString(entity, "UTF-8");
+		} catch (Exception e) {
+			e.printStackTrace();
+		} finally {
+			try {
+				// 关闭连接,释放资源
+				if (response != null) {
+					response.close();
+				}
+				if (httpClient != null) {
+					httpClient.close();
+				}
+			} catch (IOException e) {
+				e.printStackTrace();
+			}
+		}
+		return responseContent;
+	}
+	
+	/**
+	 * 发送Get请求Https
+	 * @param httpPost
+	 * @return
+	 */
+	private String sendHttpsGet(HttpGet httpGet) {
+		CloseableHttpClient httpClient = null;
+		CloseableHttpResponse response = null;
+		HttpEntity entity = null;
+		String responseContent = null;
+		try {
+			// 创建默认的httpClient实例.
+			PublicSuffixMatcher publicSuffixMatcher = PublicSuffixMatcherLoader.load(new URL(httpGet.getURI().toString()));
+			DefaultHostnameVerifier hostnameVerifier = new DefaultHostnameVerifier(publicSuffixMatcher);
+			httpClient = HttpClients.custom().setSSLHostnameVerifier(hostnameVerifier).build();
+			httpGet.setConfig(requestConfig);
+			// 执行请求
+			response = httpClient.execute(httpGet);
+			entity = response.getEntity();
+			responseContent = EntityUtils.toString(entity, "UTF-8");
+		} catch (Exception e) {
+			e.printStackTrace();
+		} finally {
+			try {
+				// 关闭连接,释放资源
+				if (response != null) {
+					response.close();
+				}
+				if (httpClient != null) {
+					httpClient.close();
+				}
+			} catch (IOException e) {
+				e.printStackTrace();
+			}
+		}
+		return responseContent;
+	}
+	
+	
+	
+}

+ 112 - 0
src/main/java/com/template/common/utils/HttpUtils.java

@@ -0,0 +1,112 @@
+package com.template.common.utils;
+
+import org.apache.http.HttpEntity;
+import org.apache.http.NameValuePair;
+import org.apache.http.client.ClientProtocolException;
+import org.apache.http.client.config.RequestConfig;
+import org.apache.http.client.entity.UrlEncodedFormEntity;
+import org.apache.http.client.methods.CloseableHttpResponse;
+import org.apache.http.client.methods.HttpPost;
+import org.apache.http.entity.StringEntity;
+import org.apache.http.impl.client.CloseableHttpClient;
+import org.apache.http.impl.client.HttpClients;
+import org.apache.http.message.BasicNameValuePair;
+import org.apache.http.util.EntityUtils;
+
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * @Author: binguo
+ * @Date: 2023/8/21 星期一 14:58
+ * @Description: com.repair.common.utils
+ * @Version: 1.0
+ */
+public class HttpUtils {
+    /**
+     * 发送http post请求
+     *
+     * @param
+     *
+     * @param
+     *
+     */
+    public static String post(String url, Map<String, String> params){
+        CloseableHttpClient httpClient = null;
+        HttpPost httpPost = null;
+        String re = "";
+        try {
+            httpClient = HttpClients.createDefault();
+            RequestConfig requestConfig = RequestConfig.custom()
+                    .setSocketTimeout(20000).setConnectTimeout(20000).build();
+            httpPost = new HttpPost(url);
+            httpPost.setConfig(requestConfig);
+            List<NameValuePair> ps = new ArrayList<NameValuePair>();
+            for (String pKey : params.keySet()) {
+                ps.add(new BasicNameValuePair(pKey, params.get(pKey)));
+            }
+            httpPost.setEntity(new UrlEncodedFormEntity(ps));
+            CloseableHttpResponse response = httpClient.execute(httpPost);
+            HttpEntity httpEntity = response.getEntity();
+            re = EntityUtils.toString(httpEntity, "utf-8");
+        } catch (ClientProtocolException e) {
+            e.printStackTrace();
+        } catch (IOException e) {
+            e.printStackTrace();
+        } finally {
+            try {
+                if (httpPost != null) {
+                    httpPost.releaseConnection();
+                }
+                if (httpClient != null) {
+                    httpClient.close();
+                }
+            } catch (IOException e) {
+                e.printStackTrace();
+            }
+        }
+        return re;
+    }
+
+    /**
+     * 发送post请求Https,参数是字符串
+     *
+     * @param
+     * @return
+     */
+    public static String post(String url, String body){
+        String str = "";
+        CloseableHttpClient httpClient = null;
+        HttpPost httpPost = null;
+        try {
+            httpClient = HttpClients.createDefault();
+            RequestConfig requestConfig = RequestConfig.custom()
+                    .setSocketTimeout(20000).setConnectTimeout(20000).build();
+            httpPost = new HttpPost(url);
+            httpPost.setConfig(requestConfig);
+            httpPost.setEntity(new StringEntity(body, "utf-8"));
+            CloseableHttpResponse response = httpClient.execute(httpPost);
+            HttpEntity httpEntity = response.getEntity();
+            str = EntityUtils.toString(httpEntity, "utf-8");
+
+        } catch (ClientProtocolException e) {
+            e.printStackTrace();
+        } catch (IOException e) {
+            e.printStackTrace();
+        } finally {
+            try {
+                if (httpPost != null) {
+                    httpPost.releaseConnection();
+                }
+                if (httpClient != null) {
+                    httpClient.close();
+                }
+            } catch (IOException e) {
+                e.printStackTrace();
+            }
+        }
+        return str;
+    }
+}

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

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

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

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

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

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

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

@@ -0,0 +1,113 @@
+package com.template.common.utils;
+
+import com.alibaba.druid.sql.visitor.SQLASTOutputVisitor;
+import com.alibaba.fastjson.JSONObject;
+import com.google.gson.Gson;
+import com.google.gson.reflect.TypeToken;
+import org.apache.commons.lang3.StringUtils;
+import org.apache.http.HttpEntity;
+import org.apache.http.HttpResponse;
+import org.apache.http.StatusLine;
+import org.apache.http.client.ClientProtocolException;
+import org.apache.http.client.HttpResponseException;
+import org.apache.http.client.methods.HttpPost;
+import org.apache.http.conn.ssl.SSLConnectionSocketFactory;
+import org.apache.http.entity.StringEntity;
+import org.apache.http.impl.client.CloseableHttpClient;
+import org.apache.http.impl.client.HttpClientBuilder;
+import org.apache.http.impl.client.HttpClients;
+import org.apache.http.util.EntityUtils;
+
+
+import java.io.IOException;
+import java.util.HashMap;
+
+/**
+ * 公众号,推送信息,推给商家信息
+ */
+public class Message2 {
+
+//小程序
+//    static String appId="wx2fc3f45732fae5d3";
+//    static String secret="7eee4a49a4470a77f9222995e8511547";
+
+//公众号
+    static String appId="wxa46ef222053a1047";
+    static String secret="16f74a1265c314fd79fdf90670173467";
+
+    /**
+     * 公众号推送消息
+     * @param openid 公众号openId
+     * @param type  事件
+     * @param location  地点
+     * @param dateTime  时间
+     * @return
+     * @throws Exception
+     */
+    public static String send(String openid,String type,String location,String dateTime)
+            throws Exception {
+
+        String url="https://api.weixin.qq.com/cgi-bin/token?grant_type=client_credential&appid="+appId+"&secret="+secret;
+
+        String s = HttpsClient.httpsRequestReturnString(url, "GET", "");
+        JSONObject jsonObject = JSONObject.parseObject(s);
+        String access_token = jsonObject.getString("access_token");
+
+
+        JSONObject message = new JSONObject();
+        message.put("touser", openid);
+        message.put("template_id", "vPuSS7nivkQHxcGzpZB-NedVKzqJ4ifk0FTiBI7Aa20");
+
+        JSONObject small = new JSONObject();
+        small.put("appid", "wx2fc3f45732fae5d3");
+        small.put("pagepath", "pages/msgWarn/msgWarn");
+        message.put("miniprogram", small);
+        // 报警类型
+        JSONObject const2 = new JSONObject();
+        const2.put("value", type);
+        const2.put("color", "#173177");
+
+        // 报警位置
+        JSONObject thing3 = new JSONObject();
+        thing3.put("value", location);
+        thing3.put("color", "#173177");
+
+        // 报警时间
+        JSONObject time4 = new JSONObject();
+        time4.put("value", dateTime);
+        time4.put("color", "#173177");
+
+        // 封装data
+        JSONObject data = new JSONObject();
+        data.put("const2",const2);
+        data.put("thing3",thing3);
+        data.put("time4",time4);
+
+        message.put("data",data);
+
+        String s1 = HttpsClient.sendJson("https://api.weixin.qq.com/cgi-bin/message/template/send?access_token=" + access_token, message);
+        System.out.println("s1 = " + s1);
+        return s1;
+    }
+
+
+    public static String getToken() throws Exception {
+        String url="https://api.weixin.qq.com/cgi-bin/token?grant_type=client_credential&appid="+appId+"&secret="+secret;
+
+        String s = HttpsClient.httpsRequestReturnString(url, "GET", "");
+        JSONObject jsonObject = JSONObject.parseObject(s);
+        System.out.println("jsonObject = " + jsonObject);
+        String access_token = jsonObject.getString("access_token");
+//        HttpsClient.httpsRequestReturnString("https://api.weixin.qq.com/cgi-bin/message/template/send?access_token="+access_token, "POST", message.toJSONString());
+        return access_token;
+    }
+
+
+
+
+    public static void main(String[] args) throws Exception {
+        String o9MsY67wqvQ__o_pOzF7oeN4MQPM = send("o9MsY67wqvQ__o_pOzF7oeN4MQPM","进入区域","IPCamera 01","2024-01-29 16:16:14");
+//        String token = getToken();
+//        System.out.println("token = " + token);
+    }
+}

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

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

+ 99 - 0
src/main/java/com/template/common/utils/PropertiesUtil.java

@@ -0,0 +1,99 @@
+package com.template.common.utils;
+
+import java.io.*;
+import java.net.URI;
+import java.util.Enumeration;
+import java.util.HashMap;
+import java.util.Map;
+import java.util.Properties;
+
+/**
+ * <p>Title: PropertiesUtil</p>
+ * <p>Description: properties资源文件解析工具</p>
+ * @author fengyong
+ * @date 2018年9月7日
+ */
+public class PropertiesUtil {
+
+	private static Properties props = null;
+	private static URI uri;
+	private static String fileName = "/application.properties";
+	
+	private static InputStream in = null;
+
+	static {
+		try {
+			props = new Properties();
+			InputStream fis = PropertiesUtil.class.getResourceAsStream(fileName);
+			props.load(fis);
+			uri = PropertiesUtil.class.getResource(fileName).toURI();
+		} catch (Exception e) {
+			e.printStackTrace();
+		}
+	}
+
+	/**
+	 * 获取某个属性
+	 */
+	public static String getProperty(String key) {
+		try {
+			props.load(PropertiesUtil.class.getResourceAsStream(fileName));
+		} catch (IOException e) {
+			e.printStackTrace();
+		}
+		return props.getProperty(key);
+	}
+
+	/**
+	 * 获取所有属性,返回一个map,不常用 可以试试props.putAll(t)
+	 */
+	@SuppressWarnings("rawtypes")
+	public static Map<String, String> getAllProperty() {
+		Map<String, String> map = new HashMap<String, String>();
+		Enumeration enu = props.propertyNames();
+		while (enu.hasMoreElements()) {
+			String key = (String) enu.nextElement();
+			String value = props.getProperty(key);
+			map.put(key, value);
+		}
+		return map;
+	}
+
+	/**
+	 * 在控制台上打印出所有属性,调试时用。
+	 */
+	public static void printProperties() {
+		props.list(System.out);
+	}
+
+	/**
+	 * 写入properties信息
+	 */
+	public static void writeProperties(String key, String value) {
+		try {
+			OutputStream fos = new FileOutputStream(new File(uri));
+			props.setProperty(key, value);
+			// 将此 Properties 表中的属性列表(键和元素对)写入输出流
+			props.store(fos, "『comments』Update key:" + key);
+		} catch (Exception e) {
+			e.printStackTrace();
+		}
+	}
+	
+	/**
+	 * 取默认key的value
+	 * */
+	public static String getValue(String key){
+		String value = null;
+		props = new Properties();
+		in = PropertiesUtil.class.getResourceAsStream(fileName);
+		try {
+			props.load(in);
+		} catch (IOException e) {
+//			e.printStackTrace();
+		}
+		value = (String) props.get(key);
+		return value;
+	}
+
+}

+ 32 - 0
src/main/java/com/template/common/utils/RandomTrackAlgorithm.java

@@ -0,0 +1,32 @@
+package com.template.common.utils;
+
+import com.alibaba.fastjson.JSONObject;
+
+import java.math.BigDecimal;
+import java.util.*;
+
+public class RandomTrackAlgorithm {
+
+    public static BigDecimal makeRandom(float max, float min, int scale){
+        BigDecimal cha = new BigDecimal(Math.random() * (max-min) + min);
+        return cha.setScale(scale,BigDecimal.ROUND_HALF_UP);//保留 scale 位小数,并四舍五入
+    }
+
+    public static List<List<BigDecimal>> getPosition(){
+        List<List<BigDecimal>> all = new ArrayList<>();
+        // 生成随机坐标点
+        BigDecimal x = null;
+        BigDecimal y = null;
+        for (int i = 0; i < 10; i++) {
+            List<BigDecimal> list = new LinkedList<>();
+            // 114.449557,28.109357
+            x = makeRandom(0.001f,0.000001f,6).add(BigDecimal.valueOf(114.449557));
+            y = makeRandom(0.001f,0.000001f,6).add(BigDecimal.valueOf(28.109357));
+            list.add(x);
+            list.add(y);
+            all.add(list);
+        }
+        return all;
+    }
+
+}

+ 126 - 0
src/main/java/com/template/common/utils/RequestUtils.java

@@ -0,0 +1,126 @@
+package com.template.common.utils;
+
+import java.io.BufferedReader;
+import java.io.IOException;
+import java.io.InputStreamReader;
+import java.io.PrintWriter;
+import java.net.URL;
+import java.net.URLConnection;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * @Author: binguo
+ * @Date: 2023/12/21 星期四 9:39
+ * @Description: com.template.common.utils
+ * @Version: 1.0
+ */
+public class RequestUtils {
+    /**
+     * GET请求
+     * @param url 请求地址
+     * @param param 请求参数
+     * @return
+     */
+    public static String httpGet(String url,String param){
+        String result = "";
+        BufferedReader in = null;
+        try {
+            String urlNameString = url + "?" + param;
+            URL realUrl = new URL(urlNameString);
+            // 打开和URL之间的连接
+            URLConnection connection = realUrl.openConnection();
+            // 设置通用的请求属性
+            connection.setRequestProperty("accept", "*/*");
+            connection.setRequestProperty("connection", "Keep-Alive");
+            connection.setRequestProperty("user-agent",
+                    "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1;SV1)");
+            // 建立实际的连接
+            connection.connect();
+            // 获取所有响应头字段
+            Map<String, List<String>> map = connection.getHeaderFields();
+            // 遍历所有的响应头字段
+            for (String key : map.keySet()) {
+                System.out.println(key + "--->" + map.get(key));
+            }
+            // 定义 BufferedReader输入流来读取URL的响应
+            in = new BufferedReader(new InputStreamReader(
+                    connection.getInputStream()));
+            String line;
+            while ((line = in.readLine()) != null) {
+                result += line;
+            }
+        } catch (Exception e) {
+            System.out.println("发送GET请求出现异常!" + e);
+            e.printStackTrace();
+        }
+        // 使用finally块来关闭输入流
+        finally {
+            try {
+                if (in != null) {
+                    in.close();
+                }
+            } catch (Exception e2) {
+                e2.printStackTrace();
+            }
+        }
+        return result;
+    }
+
+
+    /**
+     * POST请求
+     * @param url 请求的url
+     * @param param 参数
+     * @return
+     */
+    public static String httpPost(String url, String param){
+        String dummyData = param.replace("%", "").replace(",", "").replace(" ", "+").replace("/","");
+        PrintWriter out = null;
+        BufferedReader in = null;
+        String result = "";
+        try {
+            URL realUrl = new URL(url);
+            // 打开和URL之间的连接
+            URLConnection conn = realUrl.openConnection();
+            // 设置通用的请求属性
+            conn.setRequestProperty("accept", "*/*");
+            conn.setRequestProperty("connection", "Keep-Alive");
+            conn.setRequestProperty("user-agent", "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1;SV1)");
+            conn.setRequestProperty("Content-Type", "application/json");
+            // 发送POST请求必须设置如下两行
+            conn.setDoOutput(true);
+            conn.setDoInput(true);
+            // 获取URLConnection对象对应的输出流
+            out = new PrintWriter(conn.getOutputStream());
+            // 发送请求参数
+            out.print(param);
+            // flush输出流的缓冲
+            out.flush();
+            // 定义BufferedReader输入流来读取URL的响应
+            in = new BufferedReader(
+                    new InputStreamReader(conn.getInputStream()));
+            String line;
+            while ((line = in.readLine()) != null) {
+                result += line;
+            }
+        } catch (Exception e) {
+            System.out.println("发送 POST 请求出现异常!" + e);
+            e.printStackTrace();
+        }
+        //使用finally块来关闭输出流、输入流
+        finally {
+            try {
+                if (out != null) {
+                    out.close();
+                }
+                if (in != null) {
+                    in.close();
+                }
+            } catch (IOException ex) {
+                ex.printStackTrace();
+            }
+        }
+        return result;
+    }
+}

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

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

+ 54 - 19
src/main/java/com/template/common/utils/SendSms.java

@@ -1,5 +1,6 @@
 package com.template.common.utils;
 
+
 import com.tencentcloudapi.common.Credential;
 import com.tencentcloudapi.common.exception.TencentCloudSDKException;
 
@@ -14,39 +15,44 @@ import com.tencentcloudapi.sms.v20210111.SmsClient;
 import com.tencentcloudapi.sms.v20210111.models.SendSmsRequest;
 import com.tencentcloudapi.sms.v20210111.models.SendSmsResponse;
 import com.tencentcloudapi.sms.v20210111.models.SendStatus;
-import com.template.config.smsConfig;
 import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.annotation.Value;
+
+import java.util.Date;
 
 /**
  * Tencent Cloud Sms Sendsms
  */
 public class SendSms {
 
-    @Autowired
-    private static smsConfig smsConfig;
 
     //腾讯云上的签名
+//    private static String secretID="AKIDDPo13qZCZqtgJsGQL7AyYu1wc7QVMyLl";
+    private static String secretID = "AKIDCPVZdcWIxgHpy5FYxVyPiqkZGrhdXUBg";
 
-    private static String secretID="AKIDDPo13qZCZqtgJsGQL7AyYu1wc7QVMyLl";
     //腾讯云上的密钥
+//    private static String secretKey="JPGrELFySiv0pOrKOPEwSnulOq9IPPDr";
+    private static String secretKey = "NkyCN3cz97qKaeXLvHOGxOcdS8f184pL";
 
-    private static String secretKey="JPGrELFySiv0pOrKOPEwSnulOq9IPPDr";
     //短信应用id
+//    private static String sdkAppid="1400813506";
+    private static String sdkAppid = "1400885930";
 
-    private static String sdkAppid="1400813506";
     //短信签名内容
+//    private static String signName="华仁享学教育";
+    private static String signName = "江西省创海科技有限公司";
 
-    private static String signName="华仁享学教育";
     //模板Id
+//    private static String templateId="1770016";
+    private static String templateId = "2060673"; //验证码
+    private static String templateId2 = "2065770"; //预约短信
 
-    private static String templateId="1770016";
     //验证码有效时长
+    private static String smsMin = "1";
 
-    private static String smsMin="1";
 
-
-    public static SendStatus[] sendSms(String phoneNumber,String code) {
-        SendStatus[] returString= {};
+    public static String sendSms(String phoneNumber, String code) {
+        String returString = "";
         try {
             /* 必要步骤:
              * 实例化一个认证对象,入参需要传入腾讯云账户密钥对secretId,secretKey。
@@ -55,7 +61,7 @@ public class SendSms {
              * 以免泄露密钥对危及你的财产安全。
              * SecretId、SecretKey 查询: https://console.cloud.tencent.com/cam/capi */
 //            Credential cred = new Credential(smsConfig.getSecretID(), smsConfig.getSecretKey());
-            Credential cred = new Credential(secretID,secretKey);
+            Credential cred = new Credential(secretID, secretKey);
 
             // 实例化一个http选项,可选,没有特殊需求可以跳过
             HttpProfile httpProfile = new HttpProfile();
@@ -116,7 +122,7 @@ public class SendSms {
             /* 模板参数: 模板参数的个数需要与 TemplateId 对应模板的变量个数保持一致,若无模板参数,则设置为空 */
 //           第一个为验证码,第二个为有效时间
 //            String[] templateParamSet = {code,smsConfig.getSmsMin()};
-            String[] templateParamSet = {code,"1"};
+            String[] templateParamSet = {code, "1"};
             req.setTemplateParamSet(templateParamSet);
 
             /* 下发手机号码,采用 E.164 标准,+[国家或地区码][手机号]
@@ -155,23 +161,52 @@ public class SendSms {
              * 更多错误,可咨询[腾讯云助手](https://tccc.qcloud.com/web/im/index.html#/chat?webAppId=8fa15978f85cb41f7e2ea36920cb3ae1&title=Sms)
              */
             SendStatus sendStatus = res.getSendStatusSet()[0];
+            System.out.println(sendStatus.getMessage());
 //            System.out.println("sendStatus = " + sendStatus);
+            returString = sendStatus.getMessage();
+        } catch (TencentCloudSDKException e) {
+            e.printStackTrace();
+        }
+        return returString;
+    }
 
 
-            returString=res.getSendStatusSet();
+    public static String sendVisitorSms(String phoneNumber, String year, String month, String day, String startTime, String endTime, String code) {
+        String returString = "";
+        try {
+            Credential cred = new Credential(secretID, secretKey);
 
+            HttpProfile httpProfile = new HttpProfile();
+            httpProfile.setReqMethod("POST");
+            httpProfile.setConnTimeout(60);
+            httpProfile.setEndpoint("sms.tencentcloudapi.com");
+            ClientProfile clientProfile = new ClientProfile();
+            clientProfile.setSignMethod("HmacSHA256");
+            clientProfile.setHttpProfile(httpProfile);
+            SmsClient client = new SmsClient(cred, "ap-guangzhou", clientProfile);
+            SendSmsRequest req = new SendSmsRequest();
+            req.setSmsSdkAppId(sdkAppid);
+            req.setSignName(signName);
+            req.setTemplateId(templateId2);
+            String[] templateParamSet = {year, month, day, startTime, endTime, code};
+            req.setTemplateParamSet(templateParamSet);
+            String[] phoneNumbers = {phoneNumber};
+            req.setPhoneNumberSet(phoneNumbers);
+            SendSmsResponse res = client.SendSms(req);
+            SendStatus sendStatus = res.getSendStatusSet()[0];
+            System.out.println(sendStatus.getMessage());
+            returString = sendStatus.getMessage();
         } catch (TencentCloudSDKException e) {
             e.printStackTrace();
         }
         return returString;
     }
 
-
-    public static  void main(String[] args) throws TencentCloudSDKException{
+    public static void main(String[] args) throws TencentCloudSDKException {
         //这里定义一个存储电话号码的数组
 
-       String tels="+8615779633758"; // 手机号前面记得带上国家区域编码
-//        SendStatus[] test = sendSms(tels);
+        String tels = "+8618279193722"; // 手机号前面记得带上国家区域编码
+        String test = sendSms("+8618279193722", "123456");
 
     }
 

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

@@ -0,0 +1,748 @@
+package com.template.common.utils;
+
+import com.template.model.enumModel.eWeekStatu;
+import com.template.model.result.UnitTimeHelpModel;
+import com.template.model.vo.ClassSettingDateVo;
+import org.apache.commons.lang3.time.DateFormatUtils;
+import org.apache.commons.lang3.time.DateUtils;
+
+import java.sql.Timestamp;
+import java.text.DateFormat;
+import java.text.ParseException;
+import java.text.SimpleDateFormat;
+import java.time.DayOfWeek;
+import java.time.LocalDate;
+import java.time.LocalDateTime;
+import java.time.format.DateTimeFormatter;
+import java.time.temporal.ChronoUnit;
+import java.util.*;
+
+/**
+ * 时间转化工具 date转为时间戳 时间戳转date 互相与String的转换
+ * 所有出现的String time 格式都必须为(yyyy-MM-dd HH:mm:ss),否则出错
+ */
+public class TimeExchange {
+
+    /**
+     * String(yyyy-MM-dd HH:mm:ss) 转 Date
+     *
+     * @param time
+     * @return
+     * @throws ParseException
+     */
+    // String date = "2010/05/04 12:34:23";
+    public static Date StringToDate(String time, String formatDate) {
+
+        Date date = new Date();
+        // 注意format的格式要与日期String的格式相匹配
+        DateFormat dateFormat = new SimpleDateFormat(formatDate);
+        try {
+            date = dateFormat.parse(time);
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+
+        return date;
+    }
+
+    /**
+     * Date转为String(yyyy-MM-dd HH:mm:ss)
+     *
+     * @param time
+     * @return
+     */
+    public static String DateToString(Date time) {
+        String dateStr = "";
+        DateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss:sss");
+        try {
+            dateStr = dateFormat.format(time);
+            System.out.println(dateStr);
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+        return dateStr;
+    }
+
+    public static String chineseDateTime(Date time) {
+        SimpleDateFormat sdf = new SimpleDateFormat("yyyy年MM月dd日 HH时mm分");
+        String dateStringParse = null;
+        try {
+            dateStringParse = sdf.format(time);
+
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+
+        return dateStringParse;
+    }
+
+    /**
+     * String(yyyy-MM-dd HH:mm:ss)转10位时间戳
+     *
+     * @param time
+     * @return
+     */
+    public static Integer StringToTimestamp(String time) {
+
+        int times = 0;
+        try {
+            times = (int) ((Timestamp.valueOf(time).getTime()) / 1000);
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+        if (times == 0) {
+            System.out.println("String转10位时间戳失败");
+        }
+        return times;
+
+    }
+
+    /**
+     * 10位int型的时间戳转换为String(yyyy-MM-dd HH:mm:ss)
+     *
+     * @param time
+     * @return
+     */
+    public static String timestampToString(Integer time) {
+        //int转long时,先进行转型再进行计算,否则会是计算结束后在转型
+        long temp = (long) time * 1000;
+        Timestamp ts = new Timestamp(temp);
+        String tsStr = "";
+        DateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
+        try {
+            //方法一
+            tsStr = dateFormat.format(ts);
+            System.out.println(tsStr);
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+        return tsStr;
+    }
+
+    /**
+     * 10位时间戳转Date
+     *
+     * @param time
+     * @return
+     */
+    public static Date TimestampToDate(Integer time) {
+        long temp = (long) time * 1000;
+        Timestamp ts = new Timestamp(temp);
+        Date date = new Date();
+        try {
+            date = ts;
+            //System.out.println(date);
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+        return date;
+    }
+
+    /**
+     * 获取当前时间戳
+     *
+     * @return
+     */
+    public static String DateNowTimeStamo() {
+        Date date = new Date();//获取当前的日期
+        SimpleDateFormat df = new SimpleDateFormat("yyyyMMddHHmmssSSS");//设置日期格式
+        String str = df.format(date);//获取String类型的时间
+        return str;
+    }
+
+    /**
+     * Date类型转换为10位时间戳
+     *
+     * @param time
+     * @return
+     */
+    public static Integer DateToTimestamp(Date time) {
+        Timestamp ts = new Timestamp(time.getTime());
+
+        return (int) ((ts.getTime()) / 1000);
+    }
+
+    // 当前时间减1小时
+    public static String TimeDesH(Date time, int hour) {
+        Calendar nowTime2 = Calendar.getInstance();
+        nowTime2.setTime(time);
+        nowTime2.add(Calendar.HOUR, -hour);
+        SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
+        return simpleDateFormat.format(nowTime2.getTime());
+    }
+
+
+    // 当前时间加5分钟
+    public static String TimeRangeI(String time) throws ParseException {
+        // 当前时间+5分钟
+        Date endTime = DateUtils.addMinutes(StringToDate(time, "yyyy-MM-dd HH:mm:ss"), 300);
+        SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
+        return simpleDateFormat.format(endTime);
+    }
+
+    // 当前时间加X秒
+    public static String TimeRangeSrcond(String time, int s) {
+        Calendar nowTime2 = Calendar.getInstance();
+        nowTime2.setTime(StringToDate(time, "yyyy-MM-dd HH:mm:ss"));
+        nowTime2.add(Calendar.SECOND, s);//秒钟
+        SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
+        return simpleDateFormat.format(nowTime2.getTime());
+    }
+
+    // 当前时间加X分钟
+    public static String TimeRangeMinute(String time, int m) {
+        Calendar nowTime2 = Calendar.getInstance();
+        nowTime2.setTime(StringToDate(time, "yyyy-MM-dd HH:mm:ss"));
+        nowTime2.add(Calendar.MINUTE, m);//分钟
+        SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
+        return simpleDateFormat.format(nowTime2.getTime());
+    }
+
+    // 当前时间减5分钟
+    public static String TimeRangeD(String time) throws ParseException {
+        Calendar nowTime2 = Calendar.getInstance();
+        nowTime2.setTime(StringToDate(time, "yyyy-MM-dd HH:mm:ss"));
+        nowTime2.add(Calendar.MINUTE, -300);//5分钟前的时间
+        SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
+        return simpleDateFormat.format(nowTime2.getTime());
+    }
+
+    // 获取当天开始时间
+    public static String getStartDate() {
+        Calendar calendar = Calendar.getInstance();
+        calendar.setTime(new Date());
+        int year = calendar.get(Calendar.YEAR);
+        int month = calendar.get(Calendar.MONTH);
+        int day = calendar.get(Calendar.DATE);
+        calendar.setTimeInMillis(0);
+        calendar.set(year, month, day, 0, 0, 0);
+        return new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(calendar.getTime());
+    }
+
+    // 获取当天结束时间
+    public static String getEndDate() {
+        Calendar calendar = Calendar.getInstance();
+        calendar.setTime(new Date());
+        int year = calendar.get(Calendar.YEAR);
+        int month = calendar.get(Calendar.MONTH);
+        int day = calendar.get(Calendar.DATE);
+        calendar.setTimeInMillis(0);
+        calendar.set(year, month, day, 23, 59, 59);
+        return new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(calendar.getTime());
+    }
+
+    // 获取当前日期
+    public static String getDate() {
+        SimpleDateFormat sp = new SimpleDateFormat("yyyy-MM-dd");
+        return sp.format(new Date());
+    }
+
+    // 获取当前日期的年月
+    public static String getDateMonth() {
+        SimpleDateFormat sp = new SimpleDateFormat("yyyy-MM-");
+        return sp.format(new Date());
+    }
+
+    // 获取前天
+    public static String getQianDay() throws ParseException {
+        Calendar nowTime2 = Calendar.getInstance();
+        nowTime2.setTime(StringToDate(getTime(), "yyyy-MM-dd HH:mm:ss"));
+        nowTime2.add(Calendar.DATE, -5);//5分钟前的时间
+        SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
+        return simpleDateFormat.format(nowTime2.getTime());
+    }
+
+    // 获取当前时间
+    public static String getTime() {
+        SimpleDateFormat sp = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
+        return sp.format(new Date());
+    }
+
+    public static String getOnlyMM() {
+        SimpleDateFormat sp = new SimpleDateFormat("HH:mm");
+        return sp.format(new Date());
+    }
+
+    public static String getOnlyDesMM() throws ParseException {
+        Calendar nowTime2 = Calendar.getInstance();
+        nowTime2.setTime(StringToDate(getTime(), "yyyy-MM-dd HH:mm:ss"));
+        nowTime2.add(Calendar.MINUTE, -5);//5分钟前的时间
+        SimpleDateFormat simpleDateFormat = new SimpleDateFormat("HH:mm");
+        return simpleDateFormat.format(nowTime2.getTime());
+    }
+
+    public static String getYear() {
+        SimpleDateFormat sp = new SimpleDateFormat("yyyy");
+        return sp.format(new Date());
+    }
+
+    public static String getMonth() {
+        SimpleDateFormat sp = new SimpleDateFormat("yyyy-MM");
+        return sp.format(new Date());
+    }
+
+    public static String getNowMonth() {
+        SimpleDateFormat sp = new SimpleDateFormat("MM");
+        return sp.format(new Date());
+    }
+
+    // 获取当前时间
+    public static String getOnlyTime() {
+        SimpleDateFormat sp = new SimpleDateFormat("HH:mm:ss");
+        return sp.format(new Date());
+    }
+
+
+    public static String getYear(Date dateNow) {
+        SimpleDateFormat sp = new SimpleDateFormat("yyyy");
+        return sp.format(dateNow);
+    }
+
+    public static String getMonth(Date dateNow) {
+        SimpleDateFormat sp = new SimpleDateFormat("MM");
+        return sp.format(new Date());
+    }
+
+    public static String getDay(Date dateNow) {
+        SimpleDateFormat sp = new SimpleDateFormat("dd");
+        return sp.format(new Date());
+    }
+
+    public static String getTime(Date dateNow) {
+        SimpleDateFormat sp = new SimpleDateFormat("HH:mm:ss");
+        return sp.format(new Date());
+    }
+
+    /**
+     * 计算两个日期的时间差
+     *
+     * @param time1
+     * @param time2
+     * @return
+     */
+    public static double getTimeDifference(String time1, String time2) {
+        SimpleDateFormat timeformat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
+        long t1 = 0L;
+        long t2 = 0L;
+        try {
+            t1 = timeformat.parse(time1).getTime();
+        } catch (ParseException e) {
+            // TODO Auto-generated catch block
+            e.printStackTrace();
+        }
+        try {
+            t2 = timeformat.parse(time2).getTime();
+        } catch (ParseException e) {
+            // TODO Auto-generated catch block
+            e.printStackTrace();
+        }
+        //因为t1-t2得到的是毫秒级,所以要初3600000得出小时.算天数或秒同理
+        double hours = (double) ((t2 - t1) / 3600000);
+        double minutes = (double) (((t2 - t1) / 1000 - hours * 3600) / 60 / 60);
+        return hours + minutes;
+    }
+
+    public static double getOnlyTimeDifference(String time1, String time2) {
+        SimpleDateFormat timeformat = new SimpleDateFormat("HH:mm:ss");
+        long t1 = 0L;
+        long t2 = 0L;
+        try {
+            t1 = timeformat.parse(time1).getTime();
+        } catch (ParseException e) {
+            // TODO Auto-generated catch block
+            e.printStackTrace();
+        }
+        try {
+            t2 = timeformat.parse(time2).getTime();
+        } catch (ParseException e) {
+            // TODO Auto-generated catch block
+            e.printStackTrace();
+        }
+        //因为t1-t2得到的是毫秒级,所以要初3600000得出小时.算天数或秒同理
+        double hours = (double) ((t2 - t1) / 3600000);
+        double minutes = (double) (((t2 - t1) / 1000 - hours * 3600) / 60 / 60);
+        return hours + minutes;
+    }
+
+    public static double getDiff(String str1, String str2) {
+        return str2.compareTo(str1);
+    }
+
+    /**
+     * 时间加减分钟数
+     *
+     * @param time      时间
+     * @param FormatStr 时间格式
+     * @param amount    要加减的时间(单位为分钟)
+     * @return
+     * @throws ParseException
+     */
+    public static String TimeRangeMinute(String time, int amount, String FormatStr) throws ParseException {
+        Date endTime = DateUtils.addMinutes(ShortStringToDate(time, FormatStr), amount);
+        SimpleDateFormat simpleDateFormat = new SimpleDateFormat(FormatStr);
+        return simpleDateFormat.format(endTime);
+    }
+
+    /**
+     * 时间加减小时数
+     *
+     * @param time      时间
+     * @param FormatStr 时间格式
+     * @param amount    要加减的时间(单位为小时)
+     * @return
+     * @throws ParseException
+     */
+    public static String TimeRangeHour(Date time, int amount, String FormatStr) {
+        Date endTime = DateUtils.addHours(time, amount);
+        SimpleDateFormat simpleDateFormat = new SimpleDateFormat(FormatStr);
+        return simpleDateFormat.format(endTime);
+    }
+
+    /**
+     * String 转 Date
+     *
+     * @param time      时间
+     * @param formatStr 自定义时间格式
+     * @return
+     * @throws ParseException
+     */
+    public static Date ShortStringToDate(String time, String formatStr) throws ParseException {
+
+        Date date = new Date();
+        // 注意format的格式要与日期String的格式相匹配
+        DateFormat dateFormat = new SimpleDateFormat(formatStr);
+        try {
+            date = dateFormat.parse(time);
+            System.out.println(date.toString());
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+
+        return date;
+    }
+
+    /**
+     * Date转为String
+     *
+     * @param time      时间
+     * @param FormatStr 自定义时间格式
+     * @return
+     */
+    public static String DateToString(Date time, String FormatStr) {
+        String dateStr = "";
+        DateFormat dateFormat = new SimpleDateFormat(FormatStr);
+        try {
+            dateStr = dateFormat.format(time);
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+        return dateStr;
+    }
+
+    /**
+     * 日期路径 即年/月/日 如2018/08/08
+     */
+    public static final String datePath() {
+        Date now = new Date();
+        return DateFormatUtils.format(now, "yyyy/MM/dd");
+    }
+
+    /**
+     * 比较时间1是否小于时间2
+     * 如果时间1小于时间2,接口返回true
+     * 如果时间1大于时间2,接口返回false
+     *
+     * @param dateOne 时间1
+     * @param dateTwo 时间2
+     * @param Forma   时间格式
+     * @return
+     * @throws ParseException
+     */
+    public static boolean CompareDate(String dateOne, String dateTwo, String Forma) throws ParseException {
+        SimpleDateFormat df = new SimpleDateFormat(Forma);
+        Date sd1 = df.parse(dateOne);
+        Date sd2 = df.parse(dateTwo);
+        return sd1.before(sd2);
+    }
+
+    public static LocalDateTime StringToLocalTime(String time, String formatStr) {
+        //1.具有转换功能的对象
+        DateTimeFormatter df = DateTimeFormatter.ofPattern(formatStr);
+        //3.LocalDate发动,将字符串转换成  df格式的LocalDateTime对象,的功能
+        LocalDateTime LocalTime = LocalDateTime.parse(time, df);
+
+        return LocalTime;
+    }
+
+    /**
+     * 获取一周的开始时间和结束时间
+     * 获取本周星期一作为一周的第一天的起始时间和结束时间
+     *
+     * @return 返回的数据中第一个是开始时间 第二个是结束时间
+     */
+    public static String[] getCurrentWeekTimeFrame() {
+        Calendar calendar = Calendar.getInstance();
+        calendar.setTimeZone(TimeZone.getTimeZone("GMT+8"));
+        //start of the week
+        if (calendar.get(Calendar.DAY_OF_WEEK) == Calendar.SUNDAY) {
+            calendar.add(Calendar.DAY_OF_YEAR, -1);
+        }
+        calendar.add(Calendar.DAY_OF_WEEK, -(calendar.get(Calendar.DAY_OF_WEEK) - 2));
+        //给0的时候查不出数据
+//        calendar.set(Calendar.HOUR_OF_DAY, 0);
+//        calendar.set(Calendar.MINUTE, 0);
+//        calendar.set(Calendar.SECOND, 0);
+//        calendar.set(Calendar.MILLISECOND, 0);
+
+        String startTime = DateToString(calendar.getTime(), "yyyy-MM-dd");
+        //end of the week
+        calendar.add(Calendar.DAY_OF_WEEK, 6);
+        calendar.set(Calendar.HOUR_OF_DAY, 23);
+        calendar.set(Calendar.MINUTE, 59);
+        calendar.set(Calendar.SECOND, 59);
+        calendar.set(Calendar.MILLISECOND, 999);
+        String endTime = DateToString(calendar.getTime(), "yyyy-MM-dd");
+        return new String[]{startTime, endTime};
+    }
+
+    /**
+     * 获取指定月份有多少天
+     *
+     * @param month
+     * @return
+     */
+    public static int getMonthDays(String date, int month) {
+        int year = Integer.valueOf(date.substring(0, 4));
+        int[] arr = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};
+        int day = arr[month - 1];//天数对应=数组-1
+        if (month == 2 && year % 4 == 0 && year % 100 != 0 || year % 400 == 0) {
+            day = 29;
+        }
+
+        return day;
+
+    }
+
+    /**
+     * 获取指定月份的第一天和最后一天
+     *
+     * @param DateStr 指定月份
+     * @return 返回的数据中第一个是开始时间 第二个是结束时间
+     */
+    public static String[] getCurrentMonthTimeFrame(String DateStr) {
+        Calendar c = Calendar.getInstance();//获取Calendar实例
+        c.set(Calendar.YEAR, Integer.parseInt(DateStr.substring(0, 4)));
+        int sss = Integer.parseInt(DateStr.substring(5, 7));
+        c.set(Calendar.MONTH, Integer.parseInt(DateStr.substring(5, 7).replace("-", "")) - 1);
+
+        c.set(Calendar.DAY_OF_MONTH, 1);
+
+        String startDate = new SimpleDateFormat("yyyy-MM-dd").format(c.getTime());
+
+        int lastDay = c.getActualMaximum(Calendar.DAY_OF_MONTH);
+        c.set(Calendar.DAY_OF_MONTH, lastDay);
+        String endDate = new SimpleDateFormat("yyyy-MM-dd").format(c.getTime()) + " 23:59:59";
+
+        return new String[]{startDate, endDate};
+    }
+
+    //region 获取某一天的开始时间
+    public static String getStartOfDayStr(Date date) {
+        Calendar calendar = Calendar.getInstance();
+        calendar.setTime(date);
+        int year = calendar.get(Calendar.YEAR);
+        int month = calendar.get(Calendar.MONTH);
+        int day = calendar.get(Calendar.DATE);
+        calendar.setTimeInMillis(0);
+        calendar.set(year, month, day, 0, 0, 0);
+        return new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(calendar.getTime());
+    }
+    //endregion
+
+    //region 获取某一天的结束时间
+    public static String getEndOfDayStr(Date date) {
+        Calendar calendar = Calendar.getInstance();
+        calendar.setTime(date);
+        int year = calendar.get(Calendar.YEAR);
+        int month = calendar.get(Calendar.MONTH);
+        int day = calendar.get(Calendar.DATE);
+        calendar.setTimeInMillis(0);
+        calendar.set(year, month, day, 23, 59, 59);
+        return new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(calendar.getTime());
+    }
+    //endregion
+
+    //region 获取指定月份的最后一天
+    public static Date getToMonthEndDate(String DateStr) {
+        Calendar c = Calendar.getInstance();
+        c.clear();
+        c.set(Calendar.YEAR, Integer.parseInt(DateStr.substring(0, 4)));
+        c.set(Calendar.MONTH, Integer.parseInt(DateStr.substring(5, 7).replace("-", "")) - 1);
+        c.roll(Calendar.DAY_OF_MONTH, -1);
+        c.set(Calendar.HOUR_OF_DAY, 23);
+        c.set(Calendar.MINUTE, 59);
+        c.set(Calendar.SECOND, 59);
+        c.set(Calendar.MILLISECOND, 999);
+
+        return c.getTime();
+    }
+    //endregion
+
+    //region 获取指定月份的第一天
+    public static Date getToMonthBeginDate(String DateStr) {
+        Calendar c = Calendar.getInstance();
+        c.clear();
+        c.set(Calendar.YEAR, Integer.parseInt(DateStr.substring(0, 4)));
+        c.set(Calendar.MONTH, Integer.parseInt(DateStr.substring(5, 7).replace("-", "")) - 1);
+        c.set(Calendar.HOUR_OF_DAY, 0);
+        c.set(Calendar.MINUTE, 0);
+        c.set(Calendar.SECOND, 0);
+        c.set(Calendar.MILLISECOND, 000);
+        return c.getTime();
+    }
+    //endregion
+
+    //region 获取某一天的开始时间
+    public static Date getStartOfDay(Date date) {
+        Calendar calendar = Calendar.getInstance();
+        calendar.setTime(date);
+        int year = calendar.get(Calendar.YEAR);
+        int month = calendar.get(Calendar.MONTH);
+        int day = calendar.get(Calendar.DATE);
+        calendar.set(year, month, day, 0, 0, 0);
+        calendar.set(Calendar.MILLISECOND, 000);
+        return calendar.getTime();
+    }
+    //endregion
+
+    //region 获取某一天的结束时间
+    public static Date getEndOfDay(Date date) {
+        Calendar calendar = Calendar.getInstance();
+        calendar.setTime(date);
+        int year = calendar.get(Calendar.YEAR);
+        int month = calendar.get(Calendar.MONTH);
+        int day = calendar.get(Calendar.DATE);
+        calendar.setTimeInMillis(0);
+        calendar.set(year, month, day, 23, 59, 59);
+        return calendar.getTime();
+    }
+    //endregion
+
+    public static List<UnitTimeHelpModel> MonthArrayTime(Date StartDate, Date EndDate) {
+
+        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");//格式化为年月
+        Calendar StartTime = Calendar.getInstance();
+        StartTime.setTime(StartDate);
+        StartTime.set(StartTime.get(Calendar.YEAR), StartTime.get(Calendar.MONTH), StartTime.get(Calendar.DATE));
+        Calendar EndTime = Calendar.getInstance();
+        EndTime.setTime(EndDate);
+        EndTime.set(EndTime.get(Calendar.YEAR), EndTime.get(Calendar.MONTH), EndTime.get(Calendar.DATE));
+        int total = (EndTime.get(Calendar.YEAR) - StartTime.get(Calendar.YEAR)) * 12 + (EndTime.get(Calendar.MONTH) - StartTime.get(Calendar.MONTH));
+        List<UnitTimeHelpModel> result = new ArrayList() {
+        };
+        for (int i = 0; i <= total; i++) {
+            StartTime.add(Calendar.MONTH, i == 0 ? 0 : 1);
+            Date MonthLastDay = getToMonthEndDate(sdf.format(StartTime.getTime()));
+            UnitTimeHelpModel data = new UnitTimeHelpModel();
+            data.setStartDate(i == 0 ? StartTime.getTime() : getStartOfDay(getToMonthBeginDate(sdf.format(StartTime.getTime()))));
+            data.setEndDate(EndTime.getTime().before(MonthLastDay) ? getEndOfDay(EndTime.getTime()) : MonthLastDay);
+            result.add(data);
+        }
+
+        return result;
+    }
+
+    public static List<ClassSettingDateVo> getDatesBetween(LocalDate startDate, LocalDate endDate) {
+        List<ClassSettingDateVo> datas = new ArrayList<>();
+        long numOfDaysBetween = ChronoUnit.DAYS.between(startDate, endDate);
+        for (int i = 0; i <= numOfDaysBetween; i++) {
+            ClassSettingDateVo data = new ClassSettingDateVo();
+            LocalDate date = startDate.plusDays(i);
+            // 获取当前日期对应的星期几
+            DayOfWeek dow = date.getDayOfWeek();
+            int dayOfWeek = dow.getValue(); // 获取星期几的数字表示,1表示周一,7表示周日
+            data.setWeekStr(eWeekStatu.stringOf(dayOfWeek));
+            data.setWeek(dayOfWeek);
+            data.setDateStr(date.toString());
+            datas.add(data);
+        }
+        return datas;
+    }
+
+    /**
+     * 获取时间date1与date2相差的秒数
+     *
+     * @param date1 起始时间
+     * @param date2 结束时间
+     * @return 返回相差的秒数
+     */
+    public static int getOffsetSeconds(Date date1, Date date2) {
+        int seconds = (int) ((date2.getTime() - date1.getTime()) / 1000);
+        return seconds;
+    }
+
+    /**
+     * 获取时间date1与date2相差的分钟数
+     *
+     * @param date1 起始时间
+     * @param date2 结束时间
+     * @return 返回相差的分钟数
+     */
+    public static int getOffsetMinutes(Date date1, Date date2) {
+        return getOffsetSeconds(date1, date2) / 60;
+    }
+
+    /**
+     * 获取时间date1与date2相差的小时数
+     *
+     * @param date1 起始时间
+     * @param date2 结束时间
+     * @return 返回相差的小时数
+     */
+    public static int getOffsetHours(Date date1, Date date2) {
+        return getOffsetMinutes(date1, date2) / 60;
+    }
+
+    /**
+     * 获取时间date1与date2相差的天数数
+     *
+     * @param date1 起始时间
+     * @param date2 结束时间
+     * @return 返回相差的天数
+     */
+    public static int getOffsetDays(Date date1, Date date2) {
+        return getOffsetHours(date1, date2) / 24 + 1;
+    }
+
+    public static boolean overlapping(String start1, String end1, String start2, String end2) throws ParseException {
+        boolean one = CompareDate(start1, end2, "HH:mm");
+        boolean two = CompareDate(start2, end1, "HH:mm");
+        return (one && two);
+    }
+
+    public static String getWeek(String sdate) throws ParseException {
+        // 再转换为时间
+        Date date = StringToDate(sdate, "yyyy-MM-dd");
+        Calendar c = Calendar.getInstance();
+        c.setTime(date);
+        // int hour=c.get(Calendar.DAY_OF_WEEK);
+        // hour中存的就是星期几了,其范围 1~7
+        // 1=星期日 7=星期六,其他类推
+        return new SimpleDateFormat("EEEE").format(c.getTime());
+    }
+
+    public static void main(String[] args) {
+        String[] s = new String[]{"5","2","C","D","+"};
+
+        int sds = calPoints(s);
+        String sdsd = "";
+    }
+
+
+    public static int calPoints(String[] operations) {
+
+        return 0;
+    }
+
+}
+

+ 628 - 0
src/main/java/com/template/common/utils/TimeExchange2.java

@@ -0,0 +1,628 @@
+package com.template.common.utils;
+
+import java.sql.Timestamp;
+import java.text.DateFormat;
+import java.text.ParseException;
+import java.text.SimpleDateFormat;
+import java.util.*;
+
+/**
+ * 时间转化工具 date转为时间戳 时间戳转date 互相与String的转换
+ * 所有出现的String time 格式都必须为(yyyy-MM-dd HH:mm:ss),否则出错
+ * @author
+ *
+ */
+public class TimeExchange2 {
+
+    /**
+     * String(yyyy-MM-dd HH:mm:ss) 转 Date
+     *
+     * @param time
+     * @return
+     * @throws ParseException
+     */
+    // String date = "2010/05/04 12:34:23";
+    public static Date StringToDate(String time) throws ParseException {
+
+        Date date = new Date();
+        // 注意format的格式要与日期String的格式相匹配
+        DateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
+        try {
+            date = dateFormat.parse(time);
+            System.out.println(date.toString());
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+
+        return date;
+    }
+
+    public static Date StringToDate2(String time) throws ParseException {
+
+        Date date = new Date();
+        // 注意format的格式要与日期String的格式相匹配
+        DateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
+        try {
+            date = dateFormat.parse(time);
+            System.out.println(date.toString());
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+
+        return date;
+    }
+
+    /**
+     * String(yyyy-MM-dd HH:mm:ss) 转 Date
+     *
+     * @param time
+     * @return
+     * @throws ParseException
+     */
+    // String date = "2010/05/04 12:34:23";
+    public static Date StringToDate(String time, String formatStr) throws ParseException {
+
+        Date date = new Date();
+        // 注意format的格式要与日期String的格式相匹配
+        DateFormat dateFormat = new SimpleDateFormat(formatStr);
+        try {
+            date = dateFormat.parse(time);
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+
+        return date;
+    }
+
+
+    /**
+     * Date转为String(yyyy-MM-dd HH:mm:ss)
+     *
+     * @param time
+     * @return
+     */
+    public static String DateToString(Date time) {
+        String dateStr = "";
+        Date date = new Date();
+        DateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH/mm/ss");
+        try {
+            dateStr = dateFormat.format(time);
+            System.out.println(dateStr);
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+        return dateStr;
+    }
+
+    public static String ToSimpleMonth(Date time) {
+        String dateStr = "";
+        DateFormat dateFormat = new SimpleDateFormat("M");
+        try {
+            dateStr = dateFormat.format(time);
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+        return dateStr;
+    }
+
+    /**
+     * String(yyyy-MM-dd HH:mm:ss)转10位时间戳
+     * @param time
+     * @return
+     */
+    public static Integer StringToTimestamp(String time){
+
+        int times = 0;
+        try {
+            times = (int) ((Timestamp.valueOf(time).getTime())/1000);
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+        if(times==0){
+            System.out.println("String转10位时间戳失败");
+        }
+        return times;
+
+    }
+    /**
+     * 10位int型的时间戳转换为String(yyyy-MM-dd HH:mm:ss)
+     * @param time
+     * @return
+     */
+    public static String timestampToString(Integer time){
+        //int转long时,先进行转型再进行计算,否则会是计算结束后在转型
+        long temp = (long)time*1000;
+        Timestamp ts = new Timestamp(temp);
+        String tsStr = "";
+        DateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
+        try {
+            //方法一
+            tsStr = dateFormat.format(ts);
+            System.out.println(tsStr);
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+        return tsStr;
+    }
+    /**
+     * 10位时间戳转Date
+     * @param time
+     * @return
+     */
+    public static Date TimestampToDate(Integer time){
+        long temp = (long)time*1000;
+        Timestamp ts = new Timestamp(temp);
+        Date date = new Date();
+        try {
+            date = ts;
+            //System.out.println(date);
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+        return date;
+    }
+    /**
+     * Date类型转换为10位时间戳
+     * @param time
+     * @return
+     */
+    public static Integer DateToTimestamp(Date time){
+        Timestamp ts = new Timestamp(time.getTime());
+
+        return (int) ((ts.getTime())/1000);
+    }
+
+    // 当前时间减1小时
+    public static String TimeDesH(String time) throws ParseException {
+        Calendar nowTime2 = Calendar.getInstance();
+        nowTime2.setTime(StringToDate(time));
+        nowTime2.add(Calendar.HOUR, -1);
+        SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
+        return simpleDateFormat.format(nowTime2.getTime());
+    }
+
+    // 最近两天
+    public static String getLastTwo() throws ParseException {
+        Calendar nowTime2 = Calendar.getInstance();
+        nowTime2.setTime(StringToDate(getTime()));
+        nowTime2.add(Calendar.DATE, -2);
+        SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd");
+        return simpleDateFormat.format(nowTime2.getTime());
+    }
+
+    // 当前时间加2分钟
+    public static String TimeRangeI10(String time,int m) throws ParseException {
+        Calendar nowTime2 = Calendar.getInstance();
+        nowTime2.setTime(StringToDate(time));
+        nowTime2.add(Calendar.SECOND, m);//10分钟前的时间
+        SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
+        return simpleDateFormat.format(nowTime2.getTime());
+    }
+
+    // 当前时间加多少分钟
+    public static String TimeRangeM(String time,int m) throws ParseException {
+        Calendar nowTime2 = Calendar.getInstance();
+        nowTime2.setTime(StringToDate2(time));
+        nowTime2.add(Calendar.MINUTE, m);//10分钟前的时间
+        SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
+        return simpleDateFormat.format(nowTime2.getTime());
+    }
+
+
+    // 当前时间减5分钟
+    public static String TimeRangeD(String time) throws ParseException {
+        Calendar nowTime2 = Calendar.getInstance();
+        nowTime2.setTime(StringToDate(time));
+        nowTime2.add(Calendar.MINUTE, -300);//5分钟前的时间
+        SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
+        return simpleDateFormat.format(nowTime2.getTime());
+    }
+
+    // 获取当前日期
+    public static String getDateStr(){
+        SimpleDateFormat sp = new SimpleDateFormat("yyyy-MM-dd");
+        return sp.format(new Date());
+    }
+
+    // 获取当前日期
+    public static String getDate(){
+        SimpleDateFormat sp = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
+        return sp.format(new Date());
+    }
+
+    // 获取前天
+    public static String getQianDay() throws ParseException {
+        Calendar nowTime2 = Calendar.getInstance();
+        nowTime2.setTime(StringToDate(getTime()));
+        nowTime2.add(Calendar.DATE, -5);//5分钟前的时间
+        SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
+        return simpleDateFormat.format(nowTime2.getTime());
+    }
+
+    // 获取明天
+    public static String getTomorrow() throws ParseException {
+        Calendar nowTime2 = Calendar.getInstance();
+        nowTime2.setTime(StringToDate(getTime()));
+        nowTime2.add(Calendar.DATE, 1);//5分钟前的时间
+        SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd");
+        return simpleDateFormat.format(nowTime2.getTime());
+    }
+
+    // 获取昨天
+    public static String getYesturday()  {
+        try {
+            Calendar nowTime2 = Calendar.getInstance();
+            nowTime2.setTime(StringToDate(getTime()));
+            nowTime2.add(Calendar.DATE, -1);
+            SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd");
+            return simpleDateFormat.format(nowTime2.getTime());
+        } catch (ParseException e) {
+            throw new RuntimeException(e);
+        }
+    }
+
+    // 获取最近7个月
+    public static List<String> getLastSevenMonth() throws ParseException {
+        List<String> ls = new ArrayList<>();
+        SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM");
+        for (int i = -6; i <= 0; i++) {
+            Calendar nowTime2 = Calendar.getInstance();
+            nowTime2.setTime(StringToDate(getTime()));
+            nowTime2.add(Calendar.MONTH, i);//5分钟前的时间
+            ls.add(simpleDateFormat.format(nowTime2.getTime()));
+        }
+        return ls;
+    }
+
+    public static String getTomorrowTime() throws ParseException {
+        Calendar nowTime2 = Calendar.getInstance();
+        nowTime2.setTime(StringToDate(getTime()));
+        nowTime2.add(Calendar.DATE, 1);//5分钟前的时间
+        SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
+        return simpleDateFormat.format(nowTime2.getTime());
+    }
+
+    public static String getWeek(String sdate) throws ParseException {
+        // 再转换为时间
+        Date date = StringToDate(sdate,"yyyy-MM-dd");
+        Calendar c = Calendar.getInstance();
+        c.setTime(date);
+        // int hour=c.get(Calendar.DAY_OF_WEEK);
+        // hour中存的就是星期几了,其范围 1~7
+        // 1=星期日 7=星期六,其他类推
+        return new SimpleDateFormat("EEEE").format(c.getTime());
+    }
+
+    // 今天星期几
+    public static String getWeek() throws ParseException {
+        String[] weeks = {"7","1","2","3","4","5","6"};
+        Calendar cal = Calendar.getInstance();
+        cal.setTime(StringToDate(getTime()));
+        int week_index = cal.get(Calendar.DAY_OF_WEEK) - 1;
+        if(week_index<0){
+            week_index = 0;
+        }
+        return weeks[week_index];
+    }
+
+    // 明天星期几
+    public static String getTomorrowWeek() throws ParseException {
+        String[] weeks = {"7","1","2","3","4","5","6"};
+        Calendar cal = Calendar.getInstance();
+        cal.setTime(StringToDate(getTomorrowTime()));
+        int week_index = cal.get(Calendar.DAY_OF_WEEK) - 1;
+        if(week_index<0){
+            week_index = 0;
+        }
+        return weeks[week_index];
+    }
+
+    // 获取当前时间
+    public static String getTime(){
+        SimpleDateFormat sp = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
+        return sp.format(new Date());
+    }
+
+    public static String getOnlyMM(){
+        SimpleDateFormat sp = new SimpleDateFormat("HH:mm");
+        return sp.format(new Date());
+    }
+
+    public static String getOnlyDesMM() throws ParseException {
+        Calendar nowTime2 = Calendar.getInstance();
+        nowTime2.setTime(StringToDate(getTime()));
+        nowTime2.add(Calendar.MINUTE, -5);//5分钟前的时间
+        SimpleDateFormat simpleDateFormat = new SimpleDateFormat("HH:mm");
+        return simpleDateFormat.format(nowTime2.getTime());
+    }
+
+    public static String getYear(){
+        SimpleDateFormat sp = new SimpleDateFormat("yyyy");
+        return sp.format(new Date());
+    }
+
+    public static String getMonth(){
+        SimpleDateFormat sp = new SimpleDateFormat("yyyy-MM");
+        return sp.format(new Date());
+    }
+
+    // 获取当前时间
+    public static String getOnlyTime(){
+        SimpleDateFormat sp = new SimpleDateFormat("HH:mm:ss");
+        return sp.format(new Date());
+    }
+    /**
+     * 计算两个日期的时间差
+     * @param time1
+     * @param time2
+     * @return
+     */
+    public static double getTimeDifference(String time1, String time2) {
+        SimpleDateFormat timeformat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
+        long t1 = 0L;
+        long t2 = 0L;
+        try {
+            t1 = timeformat.parse(time1).getTime();
+        } catch (ParseException e) {
+            // TODO Auto-generated catch block
+            e.printStackTrace();
+        }
+        try {
+            t2 = timeformat.parse(time2).getTime();
+        } catch (ParseException e) {
+            // TODO Auto-generated catch block
+            e.printStackTrace();
+        }
+        //因为t1-t2得到的是毫秒级,所以要初3600000得出小时.算天数或秒同理
+        double hours=(double) ((t2 - t1)/3600000);
+        double minutes=(double) (((t2 - t1)/1000-hours*3600)/60/60);
+        return hours+minutes;
+    }
+
+    public static double getOnlyTimeDifference(String time1, String time2) {
+        SimpleDateFormat timeformat = new SimpleDateFormat("HH:mm:ss");
+        long t1 = 0L;
+        long t2 = 0L;
+        try {
+            t1 = timeformat.parse(time1).getTime();
+        } catch (ParseException e) {
+            // TODO Auto-generated catch block
+            e.printStackTrace();
+        }
+        try {
+            t2 = timeformat.parse(time2).getTime();
+        } catch (ParseException e) {
+            // TODO Auto-generated catch block
+            e.printStackTrace();
+        }
+        //因为t1-t2得到的是毫秒级,所以要初3600000得出小时.算天数或秒同理
+        double hours=(double) ((t2 - t1)/3600000);
+        double minutes=(double) (((t2 - t1)/1000-hours*3600)/60/60);
+        return hours+minutes;
+    }
+
+    public static double getDiff(String str1, String str2){
+        return str2.compareTo(str1);
+    }
+
+    /**
+     * String 转 Date
+     * @param time 时间
+     * @param formatStr 自定义时间格式
+     * @return
+     * @throws ParseException
+     */
+    public static Date ShortStringToDate(String time, String formatStr) throws ParseException {
+
+        Date date = new Date();
+        // 注意format的格式要与日期String的格式相匹配
+        DateFormat dateFormat = new SimpleDateFormat(formatStr);
+        try {
+            date = dateFormat.parse(time);
+            System.out.println(date.toString());
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+
+        return date;
+    }
+
+    /**
+     * 获取指定月份有多少天
+     *
+     * @param month
+     * @return
+     */
+    public static int getMonthDays(String date, int month) {
+        int year = Integer.valueOf(date.substring(0, 4));
+        int[] arr = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};
+        int day = arr[month - 1];//天数对应=数组-1
+        if (month == 2 && year % 4 == 0 && year % 100 != 0 || year % 400 == 0) {
+            day = 29;
+        }
+
+        return day;
+
+    }
+
+    /**
+     * Date转为String
+     * @param time 时间
+     * @param FormatStr 自定义时间格式
+     * @return
+     */
+    public static String DateToString(Date time, String FormatStr) {
+        String dateStr = "";
+        DateFormat dateFormat = new SimpleDateFormat(FormatStr);
+        try {
+            dateStr = dateFormat.format(time);
+            System.out.println(dateStr);
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+        return dateStr;
+    }
+
+    /**
+     * 比较时间1是否小于时间2
+     * 如果时间1小于时间2,接口返回true
+     * 如果时间1大于时间2,接口返回false
+     * @param dateOne 时间1
+     * @param dateTwo 时间2
+     * @return
+     * @throws ParseException
+     */
+    public static boolean CompareDate(String dateOne, String dateTwo) throws ParseException {
+        SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
+        Date sd1=df.parse(dateOne);
+        Date sd2=df.parse(dateTwo);
+        return sd1.before(sd2);
+    }
+
+    /**
+     * 比较时间1是否小于时间2
+     * 如果时间1小于时间2,接口返回true
+     * 如果时间1大于时间2,接口返回false
+     *
+     * @param dateOne 时间1
+     * @param dateTwo 时间2
+     * @param Forma   时间格式
+     * @return
+     * @throws ParseException
+     */
+    public static boolean CompareDate(String dateOne, String dateTwo, String Forma) throws ParseException {
+        SimpleDateFormat df = new SimpleDateFormat(Forma);
+        Date sd1 = df.parse(dateOne);
+        Date sd2 = df.parse(dateTwo);
+        return sd1.before(sd2);
+    }
+
+    /**
+     * 时间加减天数
+     *
+     * @param time   时间
+     * @param amount 天数 负的为减多少天 正的为加多少天
+     * @return
+     * @throws ParseException
+     */
+    public static String TimeDesD(String time, int amount) throws ParseException {
+        Calendar nowTime2 = Calendar.getInstance();
+        nowTime2.setTime(StringToDate(time, "yyyy-MM-dd"));
+        nowTime2.add(Calendar.DATE, amount);
+        SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd");
+        return simpleDateFormat.format(nowTime2.getTime());
+    }
+
+    /**
+     * 相差的天数
+     */
+    public static int daysBetween(String smdate, String bdate) throws ParseException {
+        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
+        Calendar cal = Calendar.getInstance();
+        cal.setTime(sdf.parse(smdate));
+        long time1 = cal.getTimeInMillis();
+        cal.setTime(sdf.parse(bdate));
+        long time2 = cal.getTimeInMillis();
+        long between_days = (time2 - time1) / (1000 * 3600 * 24);
+
+        return Integer.parseInt(String.valueOf(between_days));
+    }
+
+    /**
+     * 获取一周的开始时间和结束时间
+     * 获取本周星期一作为一周的第一天的起始时间和结束时间
+     *
+     * @return 返回的数据中第一个是开始时间 第二个是结束时间
+     */
+    public static String[] getCurrentWeekTimeFrame() {
+        Calendar calendar = Calendar.getInstance();
+        calendar.setTimeZone(TimeZone.getTimeZone("GMT+8"));
+        //start of the week
+        if (calendar.get(Calendar.DAY_OF_WEEK) == Calendar.SUNDAY) {
+            calendar.add(Calendar.DAY_OF_YEAR,-1);
+        }
+        calendar.add(Calendar.DAY_OF_WEEK, -(calendar.get(Calendar.DAY_OF_WEEK) - 2));
+        //给0的时候查不出数据
+//        calendar.set(Calendar.HOUR_OF_DAY, 0);
+//        calendar.set(Calendar.MINUTE, 0);
+//        calendar.set(Calendar.SECOND, 0);
+//        calendar.set(Calendar.MILLISECOND, 0);
+
+        String startTime = DateToString(calendar.getTime(), "yyyy-MM-dd");
+        //end of the week
+        calendar.add(Calendar.DAY_OF_WEEK, 6);
+        calendar.set(Calendar.HOUR_OF_DAY, 23);
+        calendar.set(Calendar.MINUTE, 59);
+        calendar.set(Calendar.SECOND, 59);
+        calendar.set(Calendar.MILLISECOND, 999);
+        String endTime = DateToString(calendar.getTime());
+        return new String[]{startTime, endTime};
+    }
+
+    /**
+     * 获取指定月份的第一天和最后一天
+     * @param DateStr 指定月份
+     * @return 返回的数据中第一个是开始时间 第二个是结束时间
+     */
+    public static String[] getCurrentMonthTimeFrame(String DateStr) {
+        Calendar c = Calendar.getInstance();//获取Calendar实例
+        c.set(Calendar.YEAR, Integer.parseInt(DateStr.substring(0, 4)));
+        c.set(Calendar.MONTH, Integer.parseInt(DateStr.substring(5, 7).replace("-", "")) - 1);
+
+        c.set(Calendar.DAY_OF_MONTH, 1);
+
+        String startDate = new SimpleDateFormat("yyyy-MM-dd").format(c.getTime());
+
+        int lastDay = c.getActualMaximum(Calendar.DAY_OF_MONTH);
+        c.set(Calendar.DAY_OF_MONTH, lastDay);
+        String endDate = new SimpleDateFormat("yyyy-MM-dd").format(c.getTime());
+
+        return new String[]{startDate, endDate};
+    }
+
+    public static List<String> getHighTime(){
+        String year = getYear();
+        return Arrays.asList(year+"-"+"08-30",year+"-"+"08-31",year+"-"+"09-01",year+"-"+"09-02",year+"-"+"09-03",year+"-"+"09-04");
+    }
+
+    public static List<String> getDays(String startTime, String endTime) {
+        // 返回的日期集合
+        List<String> days = new ArrayList<String>();
+        DateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd");
+        try {
+            Date start = dateFormat.parse(startTime);
+            Date end = dateFormat.parse(endTime);
+            Calendar tempStart = Calendar.getInstance();
+            tempStart.setTime(start);
+
+            Calendar tempEnd = Calendar.getInstance();
+            tempEnd.setTime(end);
+            tempEnd.add(Calendar.DATE, 0);// 日期加1(包含结束)
+            while (tempStart.before(tempEnd)) {
+                days.add(dateFormat.format(tempStart.getTime()));
+                tempStart.add(Calendar.DAY_OF_YEAR, 1);
+            }
+        } catch (ParseException e) {
+            e.printStackTrace();
+        }
+        return days;
+    }
+
+
+    public static void main(String[] args) throws ParseException {
+        char a = 'A';
+        char b = 'B';
+        int result = b -a;
+
+        String s = "ZY";
+        int ans = 0;
+        for(int i=0;i<s.length();i++) {
+            int num = s.charAt(i) - 'A' + 1;
+            ans = ans * 26 + num;
+        }
+
+        System.out.println(ans);
+    }
+
+}
+

+ 25 - 0
src/main/java/com/template/common/utils/UUIDUtil.java

@@ -0,0 +1,25 @@
+package com.template.common.utils;
+
+import java.text.SimpleDateFormat;
+import java.util.Date;
+import java.util.Random;
+
+public class UUIDUtil {
+
+    public static long generateID(){
+
+        Random r = new Random();
+        long numbers = 1000000000L + (long)(r.nextDouble() * 999999999L);
+
+        return numbers;
+    }
+
+    public static String getNewDate(){
+        Date nowDate = new Date();// 取当前时间
+        SimpleDateFormat dateFormat = new SimpleDateFormat(
+                "yyyy-MM-dd HH:mm:ss"); // 转换时间格式
+        String date = dateFormat.format(nowDate);
+        return date;
+    }
+
+}

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

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

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

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

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

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

+ 47 - 0
src/main/java/com/template/common/utils/imageUtils.java

@@ -0,0 +1,47 @@
+package com.template.common.utils;
+
+import java.io.ByteArrayOutputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.net.HttpURLConnection;
+import java.net.URL;
+import java.util.Base64;
+
+/**
+ * @Author: binguo
+ * @Date: 2024/1/9 星期二 15:17
+ * @Description: com.template.common.utils
+ * @Version: 1.0
+ */
+public class imageUtils {
+
+    public static String getBase64Url(String imagePath){
+        ByteArrayOutputStream outPut = new ByteArrayOutputStream();
+        byte[] data = new byte[1024];
+        try {
+            // 创建URL
+            URL url = new URL(imagePath);
+            // 创建链接
+            HttpURLConnection conn = (HttpURLConnection) url.openConnection();
+            conn.setRequestMethod("GET");
+            conn.setConnectTimeout(10 * 1000);
+
+            if(conn.getResponseCode() != 200) {
+                return "fail";//连接失败/链接失效/图片不存在
+            }
+            InputStream inStream = conn.getInputStream();
+            int len = -1;
+            while ((len = inStream.read(data)) != -1) {
+                outPut.write(data, 0, len);
+            }
+            inStream.close();
+        } catch (IOException e) {
+            e.printStackTrace();
+        }
+        // 对字节数组Base64编码
+        byte[] encode = Base64.getEncoder().encode(outPut.toByteArray());
+        String res = new String(encode);
+        return res;
+    }
+    //https://www.jb51.net/program/288342ppk.htm 图片压缩大小
+}

+ 53 - 0
src/main/java/com/template/config/CosConfig.java

@@ -0,0 +1,53 @@
+package com.template.config;
+
+import com.qcloud.cos.COSClient;
+import com.qcloud.cos.ClientConfig;
+import com.qcloud.cos.auth.BasicCOSCredentials;
+import com.qcloud.cos.auth.COSCredentials;
+import com.qcloud.cos.region.Region;
+import lombok.Data;
+import org.springframework.boot.context.properties.ConfigurationProperties;
+import org.springframework.context.annotation.Bean;
+import org.springframework.stereotype.Component;
+
+@Component
+@ConfigurationProperties(prefix = "cos")
+@Data
+public class CosConfig {
+    /**
+     * 腾讯云账号秘钥
+     */
+    private String secretId;
+    /**
+     * 密码秘钥
+     */
+    private String secretKey;
+    /**
+     * 存储桶地区
+     */
+    private String region;
+    /**
+     * 存储桶名称
+     */
+    private String bucketName;
+    /**
+     * 存储桶访问路径
+     */
+    private String path;
+
+    /**
+     * 初始化cos对象,配置相关配置信息
+     */
+    @Bean
+    public COSClient cosClient(){
+        // 1 初始化用户身份信息(secretId, secretKey)。
+        COSCredentials cred = new BasicCOSCredentials(this.secretId, this.secretKey);
+        // 2 设置 bucket 的区域
+        Region region = new Region(this.region);
+        ClientConfig clientConfig = new ClientConfig(region);
+        // 3 生成 cos 客户端。
+        COSClient cosClient = new COSClient(cred, clientConfig);
+        return cosClient;
+    }
+}
+

+ 12 - 12
src/main/java/com/template/config/MyBatisPlusConfig.java

@@ -36,17 +36,17 @@ public class MyBatisPlusConfig {
     }
 
 
-//    /**
-//     * SQL执行效率插件
-//     * 在控制台显示sql语句
-//     */
-//    @Bean
-//    @Profile({"dev","test"})// 设置 dev test 环境开启,保证我们的效率
-//    public PerformanceInterceptor performanceInterceptor() {
-//        PerformanceInterceptor performanceInterceptor = new PerformanceInterceptor();
-//        performanceInterceptor.setMaxTime(3000); //ms 设置sql执行的最大时间,如果超过了则不执行
-//        performanceInterceptor.setFormat(true);
-//        return performanceInterceptor;
-//    }
+    /**
+     * SQL执行效率插件
+     * 在控制台显示sql语句
+     */
+    @Bean
+    @Profile({"dev","test"})// 设置 dev test 环境开启,保证我们的效率
+    public PerformanceInterceptor performanceInterceptor() {
+        PerformanceInterceptor performanceInterceptor = new PerformanceInterceptor();
+        performanceInterceptor.setMaxTime(3000); //ms 设置sql执行的最大时间,如果超过了则不执行
+        performanceInterceptor.setFormat(true);
+        return performanceInterceptor;
+    }
 
 }

+ 6 - 6
src/main/java/com/template/config/smsConfig.java

@@ -15,22 +15,22 @@ import org.springframework.stereotype.Component;
 @ConfigurationProperties(prefix = "tencentcloud")
 @Data
 public class smsConfig {
-    //腾讯云上的签名
 
+    //腾讯云上的签名  AKIDCPVZdcWIxgHpy5FYxVyPiqkZGrhdXUBg
     private String secretID;
-    //腾讯云上的密钥
 
+    //腾讯云上的密钥   NkyCN3cz97qKaeXLvHOGxOcdS8f184pL
     private String secretKey;
-    //短信应用id
 
+    //短信应用id  1400885930
     private String sdkAppid;
-    //短信签名内容
 
+    //短信签名内容  	江西省创海科技有限公司
     private String signName;
-    //模板Id
 
+    //模板Id   2060673
     private String templateId;
-    //验证码有效时长
 
+    //验证码有效时长
     private String smsMin;
 }

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

@@ -21,7 +21,7 @@ public class LogInfoController implements LogInfoControllerAPI {
     @Override
     @PassToken
     public CommonResult verifyPhone(@RequestParam String phone) {
-        return systemUserService.verifyPhone(phone);
+        return CommonResult.ok();
     }
 
     @Override

+ 0 - 29
src/main/java/com/template/controller/SendController.java

@@ -1,29 +0,0 @@
-package com.template.controller;
-
-import com.tencentcloudapi.sms.v20210111.models.SendStatus;
-import com.template.api.SendControllerAPI;
-import com.template.common.utils.SendSms;
-import com.template.common.utils.ValidateCode;
-import io.swagger.annotations.Api;
-import org.springframework.web.bind.annotation.*;
-
-@RestController
-@RequestMapping("/send/sms")
-@Api(tags = {"SendController"},value = "短信发送接口")
-public class SendController implements SendControllerAPI {
-
-
-    @Override
-//    @PassToken
-//    @PostMapping("/sendCodeAgain")
-    public SendStatus[] sendCodeAgain(@RequestBody String phone){
-        //         随机验证码
-        int vode= ValidateCode.generateValidateCode(6);
-        String code=String.valueOf(vode);
-        phone="+86"+phone;
-        SendStatus[] ret = SendSms.sendSms(phone,code);
-        return ret;
-    }
-
-
-}

+ 24 - 13
src/main/java/com/template/handler/MyMetaObjectHandler.java

@@ -21,29 +21,40 @@ public class MyMetaObjectHandler implements MetaObjectHandler {
     @Override
     public void insertFill(MetaObject metaObject) {
         HttpServletRequest request = getHttpServletRequest();
-        String user_id = request.getHeader("user_head") == null ? "0" : AesUtils.decrypt(request.getHeader("user_head"));
-        log.info("start insert fill.....");
-        // setFieldValByName(String fieldName, Object fieldVal, MetaObject metaObject
-        this.setFieldValByName("createTime", new Date(), metaObject);
-        this.setFieldValByName("updateTime", new Date(), metaObject);
-        this.setFieldValByName("createUser", user_id , metaObject);
-        this.setFieldValByName("updateUser", user_id , metaObject);
-        this.setFieldValByName("deleted", 0 , metaObject);
+        if (request != null) {
+            String user_id = request.getHeader("user_head") == null ? "0" : AesUtils.decrypt(request.getHeader("user_head"));
+            log.info("start insert fill.....");
+            // setFieldValByName(String fieldName, Object fieldVal, MetaObject metaObject
+            this.setFieldValByName("createTime", new Date(), metaObject);
+            this.setFieldValByName("updateTime", new Date(), metaObject);
+            this.setFieldValByName("createUser", user_id, metaObject);
+            this.setFieldValByName("updateUser", user_id, metaObject);
+            this.setFieldValByName("deleted", 0, metaObject);
+        } else {
+            this.setFieldValByName("createTime", new Date(), metaObject);
+            this.setFieldValByName("updateTime", new Date(), metaObject);
+            this.setFieldValByName("createUser","0", metaObject);
+            this.setFieldValByName("updateUser","0", metaObject);
+            this.setFieldValByName("deleted", 0, metaObject);
+        }
     }
 
     // 更新时的填充策略
     @Override
     public void updateFill(MetaObject metaObject) {
         HttpServletRequest request = getHttpServletRequest();
-        String user_id = request.getHeader("user_head") == null ? "0" : AesUtils.decrypt(request.getHeader("user_head"));
-        log.info("start update fill.....");
-        this.setFieldValByName("updateTime", new Date(), metaObject);
-        this.setFieldValByName("updateUser", user_id, metaObject);
+        if (request != null) {
+            String user_id = request.getHeader("user_head") == null ? "0" : AesUtils.decrypt(request.getHeader("user_head"));
+            log.info("start update fill.....");
+            this.setFieldValByName("updateTime", new Date(), metaObject);
+            this.setFieldValByName("updateUser", user_id, metaObject);
+        }
+
     }
 
     private HttpServletRequest getHttpServletRequest() {
         RequestAttributes requestAttributes = RequestContextHolder.getRequestAttributes();
         ServletRequestAttributes attributes = (ServletRequestAttributes) requestAttributes;
-        return attributes.getRequest();
+        return attributes == null ? null : attributes.getRequest();
     }
 }

+ 67 - 0
src/main/java/com/template/model/enumModel/eWeekStatu.java

@@ -0,0 +1,67 @@
+package com.template.model.enumModel;
+
+/**
+ * @Author: binguo
+ * @Date: 2023/7/26 星期三 14:55
+ * @Description: com.repair.model.enumModel
+ * @Version: 1.0
+ */
+public enum eWeekStatu {
+    Monday(1),//周一
+    Tuesday(2),//周二
+    Wednesday(3),//周三
+    Thursday(4),//周四
+    Friday(5),//周五
+    Saturday(6),//周六
+    Sunday(7);//周天
+
+    private int value;
+
+    eWeekStatu(int value){
+        this.value = value;
+    }
+
+    public int getValue() {
+        return value;
+    }
+    public static eWeekStatu valueOf(int value) {
+        switch (value) {
+            case 1:
+                return eWeekStatu.Monday;
+            case 2:
+                return eWeekStatu.Tuesday;
+            case 3:
+                return eWeekStatu.Wednesday;
+            case 4:
+                return eWeekStatu.Thursday;
+            case 5:
+                return eWeekStatu.Friday;
+            case 6:
+                return eWeekStatu.Saturday;
+            case 7:
+                return eWeekStatu.Sunday;
+            default:
+                return null;
+        }
+    }
+    public static String stringOf(Integer value) {
+        switch (value) {
+            case 1:
+                return "周一";
+            case 2:
+                return "周二";
+            case 3:
+                return "周三";
+            case 4:
+                return "周四";
+            case 5:
+                return "周五";
+            case 6:
+                return "周六";
+            case 7:
+                return "周天";
+            default:
+                return null;
+        }
+    }
+}

+ 30 - 0
src/main/java/com/template/model/result/UnitTimeHelpModel.java

@@ -0,0 +1,30 @@
+package com.template.model.result;
+
+import java.util.Date;
+
+/**
+ * @Author: binguo
+ * @Date: 2023/7/28 星期五 15:09
+ * @Description: com.repair.model.pojo
+ * @Version: 1.0
+ */
+public class UnitTimeHelpModel {
+    private Date StartDate;
+    private Date EndDate;
+
+    public Date getStartDate() {
+        return StartDate;
+    }
+
+    public void setStartDate(Date startDate) {
+        StartDate = startDate;
+    }
+
+    public Date getEndDate() {
+        return EndDate;
+    }
+
+    public void setEndDate(Date endDate) {
+        EndDate = endDate;
+    }
+}

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

@@ -0,0 +1,28 @@
+package com.template.model.vo;
+
+import lombok.Data;
+
+
+/**
+ * @Author: binguo
+ * @Date: 2023/7/28 星期五 15:03
+ * @Description: com.repair.model.vo
+ * @Version: 1.0
+ */
+@Data
+public class ClassSettingDateVo {
+    /**
+     * 星期ID
+     */
+    private Integer week;
+    /**
+     * 星期名称
+     */
+    private String weekStr;
+
+    /**
+     * 日期
+     */
+    private String dateStr;
+
+}

+ 0 - 1
src/main/java/com/template/services/SystemUserService.java

@@ -14,6 +14,5 @@ import com.template.model.result.CommonResult;
  */
 public interface SystemUserService extends IService<SystemUser> {
 
-    CommonResult verifyPhone(String phone);
 
 }

+ 0 - 63
src/main/java/com/template/services/impl/SystemUserServiceImpl.java

@@ -29,7 +29,6 @@ import java.util.Date;
  */
 @Service
 public class SystemUserServiceImpl extends ServiceImpl<SystemUserMapper, SystemUser> implements SystemUserService {
-
     @Autowired
     SmsCodeServiceImpl smsCodeService;
 
@@ -38,66 +37,4 @@ public class SystemUserServiceImpl extends ServiceImpl<SystemUserMapper, SystemU
      */
     @Autowired
     MySecurity mySecurity;
-
-    /**
-     * 判断手机号是否符合发送验证码的要求
-     * @param phone
-     * @return
-     */
-    @Override
-    @Transactional(rollbackFor=Exception.class )
-    public CommonResult verifyPhone(String phone) {
-//        String privateKey = mySecurity.getPrivateKey();
-//        postman传参会将+转换成空格
-//        phone=phone.replace(" ","+");
-//        String decrypt;
-//        try {
-//             decrypt = RSAUtils.decrypt(phone, RSAUtils.getPrivateKey(privateKey));
-//        } catch (Exception e) {
-//            return CommonResult.fail("500","解密失败");
-//        }
-//        phone=decrypt;
-        if (ObjectUtils.isEmpty(phone) || 11 != phone.length()) {
-            return CommonResult.resultValue(ResponseStatusEnum.SEND_PARAMS);
-        }
-        LambdaQueryWrapper<SystemUser> wrapper = new LambdaQueryWrapper<>();
-        wrapper.eq(SystemUser::getPhoneNumber, phone);
-        SystemUser one = this.getOne(wrapper);
-        if (ObjectUtils.isEmpty(one)) {
-            return CommonResult.resultValue(ResponseStatusEnum.SYSTEM_PHONE_ERROR);
-        }
-
-        LambdaQueryWrapper<SmsCode> wrappers=new LambdaQueryWrapper<>();
-        wrappers.eq(SmsCode::getPhoneNumber,phone);
-        wrappers.ge(SmsCode::getExpirationTime,new Date());
-        wrappers.eq(SmsCode::getIsVerify,"0");
-        int count = smsCodeService.count(wrappers);
-        if (count>0) {
-            return CommonResult.fail("500","请不要频繁操作");
-        }
-        //         随机验证码
-        int vode= ValidateCode.generateValidateCode(6);
-        String code=String.valueOf(vode);
-        SmsCode smsCode = new SmsCode();
-        smsCode.setPhoneNumber(phone);
-        phone = "+86" + phone;
-//        发送短信
-        SendStatus[] ret = SendSms.sendSms(phone,code);
-//        获取code
-        String code1 = ret[0].getCode();
-//        判断短信是否发送成功
-        if ("LimitExceeded.PhoneNumberDailyLimit".equals(code1)) {
-            return CommonResult.fail("500","手机号已超过发送上限");
-        }
-
-//            发送成功后存储到短信表
-            smsCode.setCode(code);
-            long time = new Date().getTime() + 60000L;
-            smsCode.setExpirationTime(new Date(time));
-            smsCode.setIsVerify("0");
-            smsCode.setDeleted(0L);
-            smsCodeService.save(smsCode);
-
-        return CommonResult.ok();
-    }
 }

+ 11 - 0
src/main/resources/application-dev.yml

@@ -6,6 +6,10 @@ server:
 spring:
   main:
     allow-circular-references: true
+  servlet:
+    multipart:
+      max-file-size: 100MB
+      max-request-size: 150MB
   datasource:
     username: root
     password: root
@@ -41,6 +45,13 @@ mybatis-plus:
       logic-delete-value: 1
       logic-not-delete-value: 0
 
+#cos存储对象
+cos:
+  secretId: AKIDCPVZdcWIxgHpy5FYxVyPiqkZGrhdXUBg
+  secretKey: NkyCN3cz97qKaeXLvHOGxOcdS8f184pL
+  region: ap-shanghai
+  bucketName: wanzai-1306339220
+  path: https://wanzai-1306339220.cos.ap-shanghai.myqcloud.com
 #腾讯云
 tencentcloud:
   secretID: AKIDDPo13qZCZqtgJsGQL7AyYu1wc7QVMyLl  #签名

+ 4 - 0
src/main/resources/application-prod.yml

@@ -6,6 +6,10 @@ server:
 spring:
   main:
     allow-circular-references: true
+  servlet:
+    multipart:
+      max-file-size: 100MB
+      max-request-size: 150MB
   datasource:
     username: root
     password: root

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

@@ -8,6 +8,10 @@ spring:
       active: dev
   main:
     allow-circular-references: true
+  servlet:
+    multipart:
+      max-file-size: 100MB
+      max-request-size: 150MB
   datasource:
     username: root
     password: root

+ 35 - 0
target/classes/META-INF/spring-configuration-metadata.json

@@ -1,6 +1,11 @@
 {
   "groups": [
     {
+      "name": "cos",
+      "type": "com.template.config.CosConfig",
+      "sourceType": "com.template.config.CosConfig"
+    },
+    {
       "name": "tencentcloud",
       "type": "com.template.config.smsConfig",
       "sourceType": "com.template.config.smsConfig"
@@ -8,6 +13,36 @@
   ],
   "properties": [
     {
+      "name": "cos.bucket-name",
+      "type": "java.lang.String",
+      "description": "存储桶名称",
+      "sourceType": "com.template.config.CosConfig"
+    },
+    {
+      "name": "cos.path",
+      "type": "java.lang.String",
+      "description": "存储桶访问路径",
+      "sourceType": "com.template.config.CosConfig"
+    },
+    {
+      "name": "cos.region",
+      "type": "java.lang.String",
+      "description": "存储桶地区",
+      "sourceType": "com.template.config.CosConfig"
+    },
+    {
+      "name": "cos.secret-id",
+      "type": "java.lang.String",
+      "description": "腾讯云账号秘钥",
+      "sourceType": "com.template.config.CosConfig"
+    },
+    {
+      "name": "cos.secret-key",
+      "type": "java.lang.String",
+      "description": "密码秘钥",
+      "sourceType": "com.template.config.CosConfig"
+    },
+    {
       "name": "tencentcloud.sdk-appid",
       "type": "java.lang.String",
       "sourceType": "com.template.config.smsConfig"

+ 11 - 0
target/classes/application-dev.yml

@@ -6,6 +6,10 @@ server:
 spring:
   main:
     allow-circular-references: true
+  servlet:
+    multipart:
+      max-file-size: 100MB
+      max-request-size: 150MB
   datasource:
     username: root
     password: root
@@ -41,6 +45,13 @@ mybatis-plus:
       logic-delete-value: 1
       logic-not-delete-value: 0
 
+#cos存储对象
+cos:
+  secretId: AKIDCPVZdcWIxgHpy5FYxVyPiqkZGrhdXUBg
+  secretKey: NkyCN3cz97qKaeXLvHOGxOcdS8f184pL
+  region: ap-shanghai
+  bucketName: wanzai-1306339220
+  path: https://wanzai-1306339220.cos.ap-shanghai.myqcloud.com
 #腾讯云
 tencentcloud:
   secretID: AKIDDPo13qZCZqtgJsGQL7AyYu1wc7QVMyLl  #签名

+ 4 - 0
target/classes/application-prod.yml

@@ -6,6 +6,10 @@ server:
 spring:
   main:
     allow-circular-references: true
+  servlet:
+    multipart:
+      max-file-size: 100MB
+      max-request-size: 150MB
   datasource:
     username: root
     password: root

+ 4 - 0
target/classes/application.yml

@@ -8,6 +8,10 @@ spring:
       active: dev
   main:
     allow-circular-references: true
+  servlet:
+    multipart:
+      max-file-size: 100MB
+      max-request-size: 150MB
   datasource:
     username: root
     password: root

BIN
target/classes/com/template/MybatisPlusApplication.class


BIN
target/classes/com/template/annotation/DESRespondSecret.class


BIN
target/classes/com/template/annotation/ExcelExport.class


BIN
target/classes/com/template/annotation/ExcelImport.class


BIN
target/classes/com/template/aop/DESResponseSecretAspect.class


BIN
target/classes/com/template/api/SendControllerAPI.class


BIN
target/classes/com/template/common/constanst/Constanst.class


BIN
target/classes/com/template/common/exception/EmsExceptionHandler.class


BIN
target/classes/com/template/common/jh/ReqRespResearchProductQuestionnaireItem.class


BIN
target/classes/com/template/common/jh/SectionUtil.class


BIN
target/classes/com/template/common/result/ResponseStatusEnum.class


BIN
target/classes/com/template/common/utils/AccessToken.class


BIN
target/classes/com/template/common/utils/AesTestOne.class


BIN
target/classes/com/template/common/utils/AesUtil.class


BIN
target/classes/com/template/common/utils/Base64Util.class


BIN
target/classes/com/template/common/utils/CommonUtil.class


BIN
target/classes/com/template/common/utils/DataBliu.class


BIN
target/classes/com/template/common/utils/DateUtils.class


BIN
target/classes/com/template/common/utils/EncryptUtil.class


BIN
target/classes/com/template/common/utils/ExcelClassField.class


BIN
target/classes/com/template/common/utils/ExcelUtil3.class


BIN
target/classes/com/template/common/utils/ExcelUtils.class


BIN
target/classes/com/template/common/utils/ExcelUtils2.class


BIN
target/classes/com/template/common/utils/FileUtils.class


BIN
target/classes/com/template/common/utils/GetVertifyCode.class


BIN
target/classes/com/template/common/utils/HttpClientUtils$1.class


BIN
target/classes/com/template/common/utils/HttpClientUtils$LazyHolder.class


BIN
target/classes/com/template/common/utils/HttpClientUtils.class


BIN
target/classes/com/template/common/utils/HttpUtils.class


BIN
target/classes/com/template/common/utils/HttpsClient.class


BIN
target/classes/com/template/common/utils/Md5Utils.class


BIN
target/classes/com/template/common/utils/Message$1.class


BIN
target/classes/com/template/common/utils/Message.class


BIN
target/classes/com/template/common/utils/Message2.class


+ 0 - 0
target/classes/com/template/common/utils/MyX509TrustManager.class


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