瀏覽代碼

开心灵工对接慧盈调整

ZhangWenQiang 5 年之前
父節點
當前提交
9e2a6f3a60

+ 5 - 0
happy-boot-module-flexjob/pom.xml

@@ -53,6 +53,11 @@
             <artifactId>happy-boot-module-econtract</artifactId>
             <version>2.1.0</version>
         </dependency>
+        <dependency>
+            <groupId>org.jeecgframework.boot</groupId>
+            <artifactId>happy-boot-module-settlement</artifactId>
+            <version>2.1.0</version>
+        </dependency>
 
         <!--腾讯云sdk-->
         <dependency>

+ 23 - 0
happy-boot-module-settlement/pom.xml

@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+    <modelVersion>4.0.0</modelVersion>
+    <artifactId>happy-boot-module-settlement</artifactId>
+    <version>2.1.0</version>
+
+    <parent>
+        <artifactId>happy-boot-parent</artifactId>
+        <groupId>org.jeecgframework.boot</groupId>
+        <version>2.1.0</version>
+    </parent>
+
+    <dependencies>
+        <dependency>
+            <groupId>org.jeecgframework.boot</groupId>
+            <artifactId>happy-boot-base-common</artifactId>
+            <version>2.1.0</version>
+        </dependency>
+    </dependencies>
+
+</project>

+ 48 - 48
happy-boot-module-system/src/main/java/org/jeecg/modules/util/CryptTool.java

@@ -1,48 +1,48 @@
-package org.jeecg.modules.util;
-
-import org.apache.commons.codec.binary.Base64;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import java.io.UnsupportedEncodingException;
-import java.net.URLEncoder;
-
-/**
- * @Author: zwq
- * @Date: Create in 2020/8/12 16:29
- * @Description: 加密工具类
- */
-public class CryptTool {
-    private static Logger log = LoggerFactory.getLogger(CryptTool.class);
-
-    /**
-     * 请求报文加密
-     *
-     * @param biz_content
-     * @return
-     */
-    public static String encode(String biz_content) {
-        //将JSON串进行URLEncoder 编码,编码格式都是 UTF-8
-        try {
-            biz_content = URLEncoder.encode(biz_content, "UTF-8");
-            log.info("urlencode加密====={}", biz_content);
-            //base64加密
-            biz_content = encryptBASE64(biz_content.getBytes());
-            log.info("base64加密====={}", biz_content);
-        } catch (UnsupportedEncodingException e) {
-            e.printStackTrace();
-        }
-        return biz_content;
-    }
-
-    /**
-     * base64加密
-     *
-     * @param key
-     * @return
-     */
-    public static String encryptBASE64(byte[] key) {
-        return Base64.encodeBase64String(key);
-    }
-
-}
+package org.jeecg.common.utils;
+
+import org.apache.commons.codec.binary.Base64;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import java.io.UnsupportedEncodingException;
+import java.net.URLEncoder;
+
+/**
+ * @Author: zwq
+ * @Date: Create in 2020/8/12 16:29
+ * @Description: 加密工具类
+ */
+public class CryptTool {
+    private static Logger log = LoggerFactory.getLogger(CryptTool.class);
+
+    /**
+     * 请求报文加密
+     *
+     * @param biz_content
+     * @return
+     */
+    public static String encode(String biz_content) {
+        //将JSON串进行URLEncoder 编码,编码格式都是 UTF-8
+        try {
+            biz_content = URLEncoder.encode(biz_content, "UTF-8");
+            log.info("urlencode加密====={}", biz_content);
+            //base64加密
+            biz_content = encryptBASE64(biz_content.getBytes());
+            log.info("base64加密====={}", biz_content);
+        } catch (UnsupportedEncodingException e) {
+            e.printStackTrace();
+        }
+        return biz_content;
+    }
+
+    /**
+     * base64加密
+     *
+     * @param key
+     * @return
+     */
+    public static String encryptBASE64(byte[] key) {
+        return Base64.encodeBase64String(key);
+    }
+
+}

+ 43 - 39
happy-boot-module-system/src/main/java/org/jeecg/modules/util/HttpsContants.java

@@ -1,39 +1,43 @@
-package org.jeecg.modules.util;
-
-
-public class HttpsContants {
-
-    public static final String POST = "POST";
-
-    public static final String GET = "GET";
-
-    /**
-     * 获取授权accessToken
-     */
-    public static final String OAUTH_TOKEN_URL = "/oauth/token?grant_type=client_credentials&client_id=CLIENT&client_secret=SECRET";
-
-    /**
-     * 验证accessToken有效性
-     */
-    public static final String OAUTH_CKECK_TOKEN_URL = "/oauth/check_token?token=TOKEN";
-
-    /**
-     * 授权模式
-     */
-    public static final String GRANT_TYPE = "client_credentials";
-
-    /**
-     * 客户端id
-     */
-    public static final String CLIENT_ID = "";
-
-    /**
-     * 客户端秘钥
-     */
-    public static final String CLIENT_SECRET = "";
-
-    /**
-     * 接口获取成功与否标志
-     */
-    public static final String SUCCESS_FLAG = "success";
-}
+package org.jeecg.common.utils;
+
+/**
+ * @Author: zwq
+ * @Date: Create in 2020/8/12 14:31
+ * @Description: https请求常量类
+ */
+public interface HttpsContants {
+
+    public static final String POST = "POST";
+
+    public static final String GET = "GET";
+
+    /**
+     * 获取授权accessToken
+     */
+    public static final String OAUTH_TOKEN_URL = "/oauth/token?grant_type=client_credentials&client_id=CLIENT&client_secret=SECRET";
+
+    /**
+     * 验证accessToken有效性
+     */
+    public static final String OAUTH_CKECK_TOKEN_URL = "/oauth/check_token?token=TOKEN";
+
+    /**
+     * 授权模式
+     */
+    public static final String GRANT_TYPE = "client_credentials";
+
+    /**
+     * 客户端id
+     */
+    public static final String CLIENT_ID = "";
+
+    /**
+     * 客户端秘钥
+     */
+    public static final String CLIENT_SECRET = "";
+
+    /**
+     * 接口获取成功与否标志
+     */
+    public static final String SUCCESS_FLAG = "success";
+}

+ 448 - 448
happy-boot-module-system/src/main/java/org/jeecg/modules/util/HttpsUtils.java

@@ -1,448 +1,448 @@
-package org.jeecg.modules.util;
-
-import com.alibaba.fastjson.JSONObject;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import sun.net.www.protocol.https.Handler;
-
-import javax.net.ssl.*;
-import java.io.BufferedReader;
-import java.io.InputStream;
-import java.io.InputStreamReader;
-import java.io.OutputStream;
-import java.net.ConnectException;
-import java.net.HttpURLConnection;
-import java.net.URL;
-import java.security.cert.X509Certificate;
-
-/**
- * @Author: zwq
- * @Date: Create in 2020/8/12 14:18
- * @Description: https请求工具类
- */
-public class HttpsUtils {
-    private static Logger log = LoggerFactory.getLogger(HttpsUtils.class);
-
-    /**
-     * 发起https请求并获取结果
-     *
-     * @param requestUrl    请求地址
-     * @param requestMethod 请求方式(GET、post)
-     * @param outputStr     提交的数据
-     * @return json字符串
-     */
-    public static JSONObject doHttpsRequest(String requestUrl, String requestMethod, String outputStr) {
-        HttpsURLConnection httpUrlConn = null;
-        StringBuffer buffer = new StringBuffer();
-        JSONObject jsonObject;
-        InputStream inputStream = null;
-        InputStreamReader inputStreamReader = null;
-        BufferedReader bufferedReader = null;
-        try {
-            // 创建SSLContext对象,并使用我们制定的信任管理器初始化
-            TrustManager[] tm = {new MyX509TrustManager()};
-            SSLContext sslContext = SSLContext.getInstance("SSL", "SunJSSE");
-            sslContext.init(null, tm, new java.security.SecureRandom());
-            // 从上述SSLContext对象中得到SSLSocketFactory对象
-            SSLSocketFactory ssf = sslContext.getSocketFactory();
-
-            //url是https的时候,使用异常更正
-            URL url = new URL(null, requestUrl, new Handler());
-            httpUrlConn = (HttpsURLConnection) url.openConnection();
-            /** 设置连接主机服务器超时时间:15000毫秒 */
-            httpUrlConn.setConnectTimeout(15000);
-            /** 设置读取远程返回的数据时间:60000毫秒 */
-            httpUrlConn.setReadTimeout(60000);
-            httpUrlConn.setSSLSocketFactory(ssf);
-
-            /** 设置是否向httpUrlConnection输出,设置是否从httpUrlConnection读入,此外发送post请求必须设置这两个 */
-            if (HttpsContants.POST.equalsIgnoreCase(requestMethod)) {
-                httpUrlConn.setDoOutput(true);
-                httpUrlConn.setDoInput(true);
-            }
-            httpUrlConn.setUseCaches(false);
-            // 设置请求方式(GET/POST)
-            httpUrlConn.setRequestMethod(requestMethod);
-            /** 发送GET方式请求,使用connet方法建立和远程资源之间的实际连接即可 */
-            if (HttpsContants.GET.equalsIgnoreCase(requestMethod)) {
-                httpUrlConn.connect();
-            }
-            if (HttpsContants.POST.equalsIgnoreCase(requestMethod)) {
-                //当outputStr不为null时向输出流写数据
-                if (null != outputStr) {
-                    OutputStream outputStream = httpUrlConn.getOutputStream();
-                    // 注意编码格式,防止中文乱码
-                    outputStream.write(outputStr.getBytes("UTF-8"));
-                    outputStream.close();
-                }
-            }
-            /** 请求成功:返回码为200 */
-            if (httpUrlConn.getResponseCode() == 200) {
-                // 将返回的输入流转换成字符串
-                inputStream = httpUrlConn.getInputStream();
-                inputStreamReader = new InputStreamReader(inputStream, "utf-8");
-                bufferedReader = new BufferedReader(inputStreamReader);
-
-                String str = null;
-                while ((str = bufferedReader.readLine()) != null) {
-                    buffer.append(str);
-                }
-            }
-            log.debug("https buffer:" + buffer.toString());
-        } catch (ConnectException ce) {
-            log.error("server connection timed out");
-        } catch (Exception e) {
-            log.error(e.getMessage());
-        } finally {
-            /** 关闭资源 */
-            try {
-                if (null != bufferedReader) {
-                    bufferedReader.close();
-                }
-                if (null != inputStreamReader) {
-                    inputStreamReader.close();
-                }
-                if (null != inputStream) {
-                    inputStream.close();
-                }
-            } catch (Exception e) {
-                e.printStackTrace();
-            }
-            /** 关闭远程连接 */
-            // 断开连接,最好写上,disconnect是在底层tcp socket链接空闲时才切断。如果正在被其他线程使用就不切断。
-            // 固定多线程的话,如果不disconnect,链接会增多,直到收发不出信息。写上disconnect后正常一些
-            httpUrlConn.disconnect();
-            log.info("--------->>> " + requestMethod + " request end <<<----------");
-        }
-        jsonObject = JSONObject.parseObject(buffer.toString());
-        return jsonObject;
-    }
-
-    /**
-     * 发起https请求并获取结果
-     *
-     * @param requestUrl    请求地址
-     * @param requestMethod 请求方式(GET、post)
-     * @param outputStr     提交的数据
-     * @param token         鉴权accessToken
-     * @return json字符串
-     */
-    public static JSONObject doHttpsRequest(String requestUrl, String requestMethod, String outputStr, String token) {
-        HttpsURLConnection httpUrlConn = null;
-        StringBuffer buffer = new StringBuffer();
-        JSONObject jsonObject;
-        InputStream inputStream = null;
-        InputStreamReader inputStreamReader = null;
-        BufferedReader bufferedReader = null;
-        try {
-            // 创建SSLContext对象,并使用我们制定的信任管理器初始化
-            TrustManager[] tm = {new MyX509TrustManager()};
-            SSLContext sslContext = SSLContext.getInstance("SSL", "SunJSSE");
-            sslContext.init(null, tm, new java.security.SecureRandom());
-            // 从上述SSLContext对象中得到SSLSocketFactory对象
-            SSLSocketFactory ssf = sslContext.getSocketFactory();
-
-            //url是https的时候,使用异常更正
-            URL url = new URL(null, requestUrl, new Handler());
-            httpUrlConn = (HttpsURLConnection) url.openConnection();
-            /** 设置连接主机服务器超时时间:15000毫秒 */
-            httpUrlConn.setConnectTimeout(15000);
-            /** 设置读取远程返回的数据时间:60000毫秒 */
-            httpUrlConn.setReadTimeout(60000);
-            httpUrlConn.setSSLSocketFactory(ssf);
-
-            /** 设置是否向httpUrlConnection输出,设置是否从httpUrlConnection读入,此外发送post请求必须设置这两个 */
-            if (HttpsContants.POST.equalsIgnoreCase(requestMethod)) {
-                httpUrlConn.setDoOutput(true);
-                httpUrlConn.setDoInput(true);
-            }
-            httpUrlConn.setUseCaches(false);
-            // 设置请求方式(GET/POST)
-            httpUrlConn.setRequestMethod(requestMethod);
-            //设置Authorization授权token
-            httpUrlConn.setRequestProperty("Authorization", "bearer" + token);
-            httpUrlConn.setRequestProperty("Content-type", "application/json");
-
-            /** 发送GET方式请求,使用connet方法建立和远程资源之间的实际连接即可 */
-            if (HttpsContants.GET.equalsIgnoreCase(requestMethod)) {
-                httpUrlConn.connect();
-            }
-            if (HttpsContants.POST.equalsIgnoreCase(requestMethod)) {
-                //当outputStr不为null时向输出流写数据
-                if (null != outputStr) {
-                    OutputStream outputStream = httpUrlConn.getOutputStream();
-                    // 注意编码格式,防止中文乱码
-                    outputStream.write(outputStr.getBytes("UTF-8"));
-                    outputStream.close();
-                }
-            }
-            /** 请求成功:返回码为200 */
-            if (httpUrlConn.getResponseCode() == 200) {
-                // 将返回的输入流转换成字符串
-                inputStream = httpUrlConn.getInputStream();
-                inputStreamReader = new InputStreamReader(inputStream, "utf-8");
-                bufferedReader = new BufferedReader(inputStreamReader);
-
-                String str = null;
-                while ((str = bufferedReader.readLine()) != null) {
-                    buffer.append(str);
-                }
-            }
-            log.debug("https buffer:" + buffer.toString());
-        } catch (ConnectException ce) {
-            log.error("server connection timed out");
-        } catch (Exception e) {
-            log.error(e.getMessage());
-        } finally {
-            /** 关闭资源 */
-            try {
-                if (null != bufferedReader) {
-                    bufferedReader.close();
-                }
-                if (null != inputStreamReader) {
-                    inputStreamReader.close();
-                }
-                if (null != inputStream) {
-                    inputStream.close();
-                }
-            } catch (Exception e) {
-                e.printStackTrace();
-            }
-            /** 关闭远程连接 */
-            // 断开连接,最好写上,disconnect是在底层tcp socket链接空闲时才切断。如果正在被其他线程使用就不切断。
-            // 固定多线程的话,如果不disconnect,链接会增多,直到收发不出信息。写上disconnect后正常一些
-            httpUrlConn.disconnect();
-            log.info("--------->>> " + requestMethod + " request end <<<----------");
-        }
-        jsonObject = JSONObject.parseObject(buffer.toString());
-        return jsonObject;
-    }
-
-    /**
-     * 证书信任管理器(用于https请求)
-     */
-    static class MyX509TrustManager implements X509TrustManager {
-
-        @Override
-        public void checkClientTrusted(X509Certificate[] x509Certificates, String s) {
-
-        }
-
-        @Override
-        public void checkServerTrusted(X509Certificate[] x509Certificates, String s) {
-
-        }
-
-        @Override
-        public X509Certificate[] getAcceptedIssuers() {
-            return new X509Certificate[0];
-        }
-    }
-
-
-    /**
-     * 发起http请求并获取结果
-     *
-     * @param requestUrl    请求地址
-     * @param requestMethod 请求方式(GET、post)
-     * @param param         提交的数据
-     * @return json字符串
-     */
-    public static JSONObject doHttpRequest(String requestUrl, String requestMethod, String param) {
-        HttpURLConnection connection = null;
-        InputStream is = null;
-        OutputStream os = null;
-        BufferedReader br = null;
-        String result = null;
-        JSONObject jsonObject;
-        try {
-            /** 创建远程url连接对象 */
-            URL url = new URL(requestUrl);
-
-            /** 通过远程url对象打开一个连接,强制转换为HttpUrlConnection类型 */
-            connection = (HttpURLConnection) url.openConnection();
-            /** 设置连接主机服务器超时时间:15000毫秒 */
-            connection.setConnectTimeout(15000);
-            /** 设置读取远程返回的数据时间:60000毫秒 */
-            connection.setReadTimeout(60000);
-
-            /** 设置是否向httpUrlConnection输出,设置是否从httpUrlConnection读入,此外发送post请求必须设置这两个 */
-            if (HttpsContants.POST.equalsIgnoreCase(requestMethod)) {
-                // 默认值为:false,当向远程服务器传送数据/写数据时,需要设置为true
-                connection.setDoOutput(true);
-                // 默认值为:true,当前向远程服务读取数据时,设置为true,该参数可有可无
-                connection.setDoInput(true);
-            }
-            connection.setUseCaches(false);
-            /** 设置连接方式:GET/POST */
-            connection.setRequestMethod(requestMethod);
-            /** 设置通用的请求属性 */
-            connection.setRequestProperty("accept", "*/*");
-            connection.setRequestProperty("connection", "Keep-Alive");
-            connection.setRequestProperty("user-agent", "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1;SV1)");
-
-            /** 发送GET方式请求,使用connet方法建立和远程资源之间的实际连接即可 */
-            if (HttpsContants.GET.equalsIgnoreCase(requestMethod)) {
-                connection.connect();
-            }
-
-            if (HttpsContants.POST.equalsIgnoreCase(requestMethod)) {
-                /** 通过输出流对象将参数写出去/传输出去,它是通过字节数组写出的 */
-                // 若使用os.print(param);则需要释放缓存:os.flush();即使用字符流输出需要释放缓存,字节流则不需要
-                if (param != null && param.length() > 0) {
-                    /** 通过连接对象获取一个输出流 */
-                    os = connection.getOutputStream();
-                    // 注意编码格式,防止中文乱码
-                    os.write(param.getBytes("UTF-8"));
-                    os.close();
-                }
-            }
-
-            /** 请求成功:返回码为200 */
-            if (connection.getResponseCode() == 200) {
-                /** 通过连接对象获取一个输入流,向远程读取 */
-                is = connection.getInputStream();
-                /** 封装输入流is,并指定字符集 */
-                br = new BufferedReader(new InputStreamReader(is, "UTF-8"));
-
-                StringBuffer sbf = new StringBuffer();
-                String line = null;
-                while ((line = br.readLine()) != null) {
-                    sbf.append(line);
-                    sbf.append("\r\n");
-                }
-                result = sbf.toString();
-            }
-
-        } catch (Exception e) {
-            e.printStackTrace();
-        } finally {
-            /** 关闭资源 */
-            try {
-                if (null != br) {
-                    br.close();
-                }
-                if (null != is) {
-                    is.close();
-                }
-                if (null != os) {
-                    os.close();
-                }
-            } catch (Exception e) {
-                e.printStackTrace();
-            }
-            /** 关闭远程连接 */
-            // 断开连接,最好写上,disconnect是在底层tcp socket链接空闲时才切断。如果正在被其他线程使用就不切断。
-            // 固定多线程的话,如果不disconnect,链接会增多,直到收发不出信息。写上disconnect后正常一些
-            connection.disconnect();
-            log.info("--------->>> " + requestMethod + " request end <<<----------");
-        }
-        jsonObject = JSONObject.parseObject(result);
-        return jsonObject;
-    }
-
-    /**
-     * 发起http请求并获取结果
-     *
-     * @param requestUrl    请求地址
-     * @param requestMethod 请求方式(GET、post)
-     * @param param         提交的数据
-     * @param token         鉴权accessToken
-     * @return json字符串
-     */
-    public static JSONObject doHttpRequest(String requestUrl, String requestMethod, String param, String token) {
-        HttpURLConnection connection = null;
-        InputStream is = null;
-        OutputStream os = null;
-        BufferedReader br = null;
-        String result = null;
-        JSONObject jsonObject;
-        try {
-            /** 创建远程url连接对象 */
-            URL url = new URL(requestUrl);
-
-            /** 通过远程url对象打开一个连接,强制转换为HttpUrlConnection类型 */
-            connection = (HttpURLConnection) url.openConnection();
-            /** 设置连接主机服务器超时时间:15000毫秒 */
-            connection.setConnectTimeout(15000);
-            /** 设置读取远程返回的数据时间:60000毫秒 */
-            connection.setReadTimeout(60000);
-
-            /** 设置是否向httpUrlConnection输出,设置是否从httpUrlConnection读入,此外发送post请求必须设置这两个 */
-            if (HttpsContants.POST.equalsIgnoreCase(requestMethod)) {
-                // 默认值为:false,当向远程服务器传送数据/写数据时,需要设置为true
-                connection.setDoOutput(true);
-                // 默认值为:true,当前向远程服务读取数据时,设置为true,该参数可有可无
-                connection.setDoInput(true);
-            }
-            connection.setUseCaches(false);
-            /** 设置连接方式:GET/POST */
-            connection.setRequestMethod(requestMethod);
-            /** 设置通用的请求属性 */
-            connection.setRequestProperty("accept", "*/*");
-            connection.setRequestProperty("connection", "Keep-Alive");
-            connection.setRequestProperty("user-agent", "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1;SV1)");
-            //设置Authorization授权token
-            connection.setRequestProperty("Authorization", "bearer" + token);
-            connection.setRequestProperty("Content-type", "application/json");
-
-            /** 发送GET方式请求,使用connet方法建立和远程资源之间的实际连接即可 */
-            if (HttpsContants.GET.equalsIgnoreCase(requestMethod)) {
-                connection.connect();
-            }
-
-            if (HttpsContants.POST.equalsIgnoreCase(requestMethod)) {
-                /** 通过输出流对象将参数写出去/传输出去,它是通过字节数组写出的 */
-                // 若使用os.print(param);则需要释放缓存:os.flush();即使用字符流输出需要释放缓存,字节流则不需要
-                if (param != null && param.length() > 0) {
-                    /** 通过连接对象获取一个输出流 */
-                    os = connection.getOutputStream();
-                    // 注意编码格式,防止中文乱码
-                    os.write(param.getBytes("UTF-8"));
-                    os.close();
-                }
-            }
-
-            /** 请求成功:返回码为200 */
-            if (connection.getResponseCode() == 200) {
-                /** 通过连接对象获取一个输入流,向远程读取 */
-                is = connection.getInputStream();
-                /** 封装输入流is,并指定字符集 */
-                br = new BufferedReader(new InputStreamReader(is, "UTF-8"));
-
-                StringBuffer sbf = new StringBuffer();
-                String line = null;
-                while ((line = br.readLine()) != null) {
-                    sbf.append(line);
-                    sbf.append("\r\n");
-                }
-                result = sbf.toString();
-            }
-
-        } catch (Exception e) {
-            e.printStackTrace();
-        } finally {
-            /** 关闭资源 */
-            try {
-                if (null != br) {
-                    br.close();
-                }
-                if (null != is) {
-                    is.close();
-                }
-                if (null != os) {
-                    os.close();
-                }
-            } catch (Exception e) {
-                e.printStackTrace();
-            }
-            /** 关闭远程连接 */
-            // 断开连接,最好写上,disconnect是在底层tcp socket链接空闲时才切断。如果正在被其他线程使用就不切断。
-            // 固定多线程的话,如果不disconnect,链接会增多,直到收发不出信息。写上disconnect后正常一些
-            connection.disconnect();
-            log.info("--------->>> " + requestMethod + " request end <<<----------");
-        }
-        jsonObject = JSONObject.parseObject(result);
-        return jsonObject;
-    }
-}
+package org.jeecg.common.utils;
+
+import com.alibaba.fastjson.JSONObject;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import sun.net.www.protocol.https.Handler;
+
+import javax.net.ssl.*;
+import java.io.BufferedReader;
+import java.io.InputStream;
+import java.io.InputStreamReader;
+import java.io.OutputStream;
+import java.net.ConnectException;
+import java.net.HttpURLConnection;
+import java.net.URL;
+import java.security.cert.X509Certificate;
+
+/**
+ * @Author: zwq
+ * @Date: Create in 2020/8/12 14:18
+ * @Description: https请求工具类
+ */
+public class HttpsUtils {
+    private static Logger log = LoggerFactory.getLogger(HttpsUtils.class);
+
+    /**
+     * 发起https请求并获取结果
+     *
+     * @param requestUrl    请求地址
+     * @param requestMethod 请求方式(GET、post)
+     * @param outputStr     提交的数据
+     * @return json字符串
+     */
+    public static JSONObject doHttpsRequest(String requestUrl, String requestMethod, String outputStr) {
+        HttpsURLConnection httpUrlConn = null;
+        StringBuffer buffer = new StringBuffer();
+        JSONObject jsonObject;
+        InputStream inputStream = null;
+        InputStreamReader inputStreamReader = null;
+        BufferedReader bufferedReader = null;
+        try {
+            // 创建SSLContext对象,并使用我们制定的信任管理器初始化
+            TrustManager[] tm = {new MyX509TrustManager()};
+            SSLContext sslContext = SSLContext.getInstance("SSL", "SunJSSE");
+            sslContext.init(null, tm, new java.security.SecureRandom());
+            // 从上述SSLContext对象中得到SSLSocketFactory对象
+            SSLSocketFactory ssf = sslContext.getSocketFactory();
+
+            //url是https的时候,使用异常更正
+            URL url = new URL(null, requestUrl, new Handler());
+            httpUrlConn = (HttpsURLConnection) url.openConnection();
+            /** 设置连接主机服务器超时时间:15000毫秒 */
+            httpUrlConn.setConnectTimeout(15000);
+            /** 设置读取远程返回的数据时间:60000毫秒 */
+            httpUrlConn.setReadTimeout(60000);
+            httpUrlConn.setSSLSocketFactory(ssf);
+
+            /** 设置是否向httpUrlConnection输出,设置是否从httpUrlConnection读入,此外发送post请求必须设置这两个 */
+            if (HttpsContants.POST.equalsIgnoreCase(requestMethod)) {
+                httpUrlConn.setDoOutput(true);
+                httpUrlConn.setDoInput(true);
+            }
+            httpUrlConn.setUseCaches(false);
+            // 设置请求方式(GET/POST)
+            httpUrlConn.setRequestMethod(requestMethod);
+            /** 发送GET方式请求,使用connet方法建立和远程资源之间的实际连接即可 */
+            if (HttpsContants.GET.equalsIgnoreCase(requestMethod)) {
+                httpUrlConn.connect();
+            }
+            if (HttpsContants.POST.equalsIgnoreCase(requestMethod)) {
+                //当outputStr不为null时向输出流写数据
+                if (null != outputStr) {
+                    OutputStream outputStream = httpUrlConn.getOutputStream();
+                    // 注意编码格式,防止中文乱码
+                    outputStream.write(outputStr.getBytes("UTF-8"));
+                    outputStream.close();
+                }
+            }
+            /** 请求成功:返回码为200 */
+            if (httpUrlConn.getResponseCode() == 200) {
+                // 将返回的输入流转换成字符串
+                inputStream = httpUrlConn.getInputStream();
+                inputStreamReader = new InputStreamReader(inputStream, "utf-8");
+                bufferedReader = new BufferedReader(inputStreamReader);
+
+                String str = null;
+                while ((str = bufferedReader.readLine()) != null) {
+                    buffer.append(str);
+                }
+            }
+            log.debug("https buffer:" + buffer.toString());
+        } catch (ConnectException ce) {
+            log.error("server connection timed out");
+        } catch (Exception e) {
+            log.error(e.getMessage());
+        } finally {
+            /** 关闭资源 */
+            try {
+                if (null != bufferedReader) {
+                    bufferedReader.close();
+                }
+                if (null != inputStreamReader) {
+                    inputStreamReader.close();
+                }
+                if (null != inputStream) {
+                    inputStream.close();
+                }
+            } catch (Exception e) {
+                e.printStackTrace();
+            }
+            /** 关闭远程连接 */
+            // 断开连接,最好写上,disconnect是在底层tcp socket链接空闲时才切断。如果正在被其他线程使用就不切断。
+            // 固定多线程的话,如果不disconnect,链接会增多,直到收发不出信息。写上disconnect后正常一些
+            httpUrlConn.disconnect();
+            log.info("--------->>> " + requestMethod + " request end <<<----------");
+        }
+        jsonObject = JSONObject.parseObject(buffer.toString());
+        return jsonObject;
+    }
+
+    /**
+     * 发起https请求并获取结果
+     *
+     * @param requestUrl    请求地址
+     * @param requestMethod 请求方式(GET、post)
+     * @param outputStr     提交的数据
+     * @param token         鉴权accessToken
+     * @return json字符串
+     */
+    public static JSONObject doHttpsRequest(String requestUrl, String requestMethod, String outputStr, String token) {
+        HttpsURLConnection httpUrlConn = null;
+        StringBuffer buffer = new StringBuffer();
+        JSONObject jsonObject;
+        InputStream inputStream = null;
+        InputStreamReader inputStreamReader = null;
+        BufferedReader bufferedReader = null;
+        try {
+            // 创建SSLContext对象,并使用我们制定的信任管理器初始化
+            TrustManager[] tm = {new MyX509TrustManager()};
+            SSLContext sslContext = SSLContext.getInstance("SSL", "SunJSSE");
+            sslContext.init(null, tm, new java.security.SecureRandom());
+            // 从上述SSLContext对象中得到SSLSocketFactory对象
+            SSLSocketFactory ssf = sslContext.getSocketFactory();
+
+            //url是https的时候,使用异常更正
+            URL url = new URL(null, requestUrl, new Handler());
+            httpUrlConn = (HttpsURLConnection) url.openConnection();
+            /** 设置连接主机服务器超时时间:15000毫秒 */
+            httpUrlConn.setConnectTimeout(15000);
+            /** 设置读取远程返回的数据时间:60000毫秒 */
+            httpUrlConn.setReadTimeout(60000);
+            httpUrlConn.setSSLSocketFactory(ssf);
+
+            /** 设置是否向httpUrlConnection输出,设置是否从httpUrlConnection读入,此外发送post请求必须设置这两个 */
+            if (HttpsContants.POST.equalsIgnoreCase(requestMethod)) {
+                httpUrlConn.setDoOutput(true);
+                httpUrlConn.setDoInput(true);
+            }
+            httpUrlConn.setUseCaches(false);
+            // 设置请求方式(GET/POST)
+            httpUrlConn.setRequestMethod(requestMethod);
+            //设置Authorization授权token
+            httpUrlConn.setRequestProperty("Authorization", "bearer" + token);
+            httpUrlConn.setRequestProperty("Content-type", "application/json");
+
+            /** 发送GET方式请求,使用connet方法建立和远程资源之间的实际连接即可 */
+            if (HttpsContants.GET.equalsIgnoreCase(requestMethod)) {
+                httpUrlConn.connect();
+            }
+            if (HttpsContants.POST.equalsIgnoreCase(requestMethod)) {
+                //当outputStr不为null时向输出流写数据
+                if (null != outputStr) {
+                    OutputStream outputStream = httpUrlConn.getOutputStream();
+                    // 注意编码格式,防止中文乱码
+                    outputStream.write(outputStr.getBytes("UTF-8"));
+                    outputStream.close();
+                }
+            }
+            /** 请求成功:返回码为200 */
+            if (httpUrlConn.getResponseCode() == 200) {
+                // 将返回的输入流转换成字符串
+                inputStream = httpUrlConn.getInputStream();
+                inputStreamReader = new InputStreamReader(inputStream, "utf-8");
+                bufferedReader = new BufferedReader(inputStreamReader);
+
+                String str = null;
+                while ((str = bufferedReader.readLine()) != null) {
+                    buffer.append(str);
+                }
+            }
+            log.debug("https buffer:" + buffer.toString());
+        } catch (ConnectException ce) {
+            log.error("server connection timed out");
+        } catch (Exception e) {
+            log.error(e.getMessage());
+        } finally {
+            /** 关闭资源 */
+            try {
+                if (null != bufferedReader) {
+                    bufferedReader.close();
+                }
+                if (null != inputStreamReader) {
+                    inputStreamReader.close();
+                }
+                if (null != inputStream) {
+                    inputStream.close();
+                }
+            } catch (Exception e) {
+                e.printStackTrace();
+            }
+            /** 关闭远程连接 */
+            // 断开连接,最好写上,disconnect是在底层tcp socket链接空闲时才切断。如果正在被其他线程使用就不切断。
+            // 固定多线程的话,如果不disconnect,链接会增多,直到收发不出信息。写上disconnect后正常一些
+            httpUrlConn.disconnect();
+            log.info("--------->>> " + requestMethod + " request end <<<----------");
+        }
+        jsonObject = JSONObject.parseObject(buffer.toString());
+        return jsonObject;
+    }
+
+    /**
+     * 证书信任管理器(用于https请求)
+     */
+    static class MyX509TrustManager implements X509TrustManager {
+
+        @Override
+        public void checkClientTrusted(X509Certificate[] x509Certificates, String s) {
+
+        }
+
+        @Override
+        public void checkServerTrusted(X509Certificate[] x509Certificates, String s) {
+
+        }
+
+        @Override
+        public X509Certificate[] getAcceptedIssuers() {
+            return new X509Certificate[0];
+        }
+    }
+
+
+    /**
+     * 发起http请求并获取结果
+     *
+     * @param requestUrl    请求地址
+     * @param requestMethod 请求方式(GET、post)
+     * @param param         提交的数据
+     * @return json字符串
+     */
+    public static JSONObject doHttpRequest(String requestUrl, String requestMethod, String param) {
+        HttpURLConnection connection = null;
+        InputStream is = null;
+        OutputStream os = null;
+        BufferedReader br = null;
+        String result = null;
+        JSONObject jsonObject;
+        try {
+            /** 创建远程url连接对象 */
+            URL url = new URL(requestUrl);
+
+            /** 通过远程url对象打开一个连接,强制转换为HttpUrlConnection类型 */
+            connection = (HttpURLConnection) url.openConnection();
+            /** 设置连接主机服务器超时时间:15000毫秒 */
+            connection.setConnectTimeout(15000);
+            /** 设置读取远程返回的数据时间:60000毫秒 */
+            connection.setReadTimeout(60000);
+
+            /** 设置是否向httpUrlConnection输出,设置是否从httpUrlConnection读入,此外发送post请求必须设置这两个 */
+            if (HttpsContants.POST.equalsIgnoreCase(requestMethod)) {
+                // 默认值为:false,当向远程服务器传送数据/写数据时,需要设置为true
+                connection.setDoOutput(true);
+                // 默认值为:true,当前向远程服务读取数据时,设置为true,该参数可有可无
+                connection.setDoInput(true);
+            }
+            connection.setUseCaches(false);
+            /** 设置连接方式:GET/POST */
+            connection.setRequestMethod(requestMethod);
+            /** 设置通用的请求属性 */
+            connection.setRequestProperty("accept", "*/*");
+            connection.setRequestProperty("connection", "Keep-Alive");
+            connection.setRequestProperty("user-agent", "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1;SV1)");
+
+            /** 发送GET方式请求,使用connet方法建立和远程资源之间的实际连接即可 */
+            if (HttpsContants.GET.equalsIgnoreCase(requestMethod)) {
+                connection.connect();
+            }
+
+            if (HttpsContants.POST.equalsIgnoreCase(requestMethod)) {
+                /** 通过输出流对象将参数写出去/传输出去,它是通过字节数组写出的 */
+                // 若使用os.print(param);则需要释放缓存:os.flush();即使用字符流输出需要释放缓存,字节流则不需要
+                if (param != null && param.length() > 0) {
+                    /** 通过连接对象获取一个输出流 */
+                    os = connection.getOutputStream();
+                    // 注意编码格式,防止中文乱码
+                    os.write(param.getBytes("UTF-8"));
+                    os.close();
+                }
+            }
+
+            /** 请求成功:返回码为200 */
+            if (connection.getResponseCode() == 200) {
+                /** 通过连接对象获取一个输入流,向远程读取 */
+                is = connection.getInputStream();
+                /** 封装输入流is,并指定字符集 */
+                br = new BufferedReader(new InputStreamReader(is, "UTF-8"));
+
+                StringBuffer sbf = new StringBuffer();
+                String line = null;
+                while ((line = br.readLine()) != null) {
+                    sbf.append(line);
+                    sbf.append("\r\n");
+                }
+                result = sbf.toString();
+            }
+
+        } catch (Exception e) {
+            e.printStackTrace();
+        } finally {
+            /** 关闭资源 */
+            try {
+                if (null != br) {
+                    br.close();
+                }
+                if (null != is) {
+                    is.close();
+                }
+                if (null != os) {
+                    os.close();
+                }
+            } catch (Exception e) {
+                e.printStackTrace();
+            }
+            /** 关闭远程连接 */
+            // 断开连接,最好写上,disconnect是在底层tcp socket链接空闲时才切断。如果正在被其他线程使用就不切断。
+            // 固定多线程的话,如果不disconnect,链接会增多,直到收发不出信息。写上disconnect后正常一些
+            connection.disconnect();
+            log.info("--------->>> " + requestMethod + " request end <<<----------");
+        }
+        jsonObject = JSONObject.parseObject(result);
+        return jsonObject;
+    }
+
+    /**
+     * 发起http请求并获取结果
+     *
+     * @param requestUrl    请求地址
+     * @param requestMethod 请求方式(GET、post)
+     * @param param         提交的数据
+     * @param token         鉴权accessToken
+     * @return json字符串
+     */
+    public static JSONObject doHttpRequest(String requestUrl, String requestMethod, String param, String token) {
+        HttpURLConnection connection = null;
+        InputStream is = null;
+        OutputStream os = null;
+        BufferedReader br = null;
+        String result = null;
+        JSONObject jsonObject;
+        try {
+            /** 创建远程url连接对象 */
+            URL url = new URL(requestUrl);
+
+            /** 通过远程url对象打开一个连接,强制转换为HttpUrlConnection类型 */
+            connection = (HttpURLConnection) url.openConnection();
+            /** 设置连接主机服务器超时时间:15000毫秒 */
+            connection.setConnectTimeout(15000);
+            /** 设置读取远程返回的数据时间:60000毫秒 */
+            connection.setReadTimeout(60000);
+
+            /** 设置是否向httpUrlConnection输出,设置是否从httpUrlConnection读入,此外发送post请求必须设置这两个 */
+            if (HttpsContants.POST.equalsIgnoreCase(requestMethod)) {
+                // 默认值为:false,当向远程服务器传送数据/写数据时,需要设置为true
+                connection.setDoOutput(true);
+                // 默认值为:true,当前向远程服务读取数据时,设置为true,该参数可有可无
+                connection.setDoInput(true);
+            }
+            connection.setUseCaches(false);
+            /** 设置连接方式:GET/POST */
+            connection.setRequestMethod(requestMethod);
+            /** 设置通用的请求属性 */
+            connection.setRequestProperty("accept", "*/*");
+            connection.setRequestProperty("connection", "Keep-Alive");
+            connection.setRequestProperty("user-agent", "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1;SV1)");
+            //设置Authorization授权token
+            connection.setRequestProperty("Authorization", "bearer" + token);
+            connection.setRequestProperty("Content-type", "application/json");
+
+            /** 发送GET方式请求,使用connet方法建立和远程资源之间的实际连接即可 */
+            if (HttpsContants.GET.equalsIgnoreCase(requestMethod)) {
+                connection.connect();
+            }
+
+            if (HttpsContants.POST.equalsIgnoreCase(requestMethod)) {
+                /** 通过输出流对象将参数写出去/传输出去,它是通过字节数组写出的 */
+                // 若使用os.print(param);则需要释放缓存:os.flush();即使用字符流输出需要释放缓存,字节流则不需要
+                if (param != null && param.length() > 0) {
+                    /** 通过连接对象获取一个输出流 */
+                    os = connection.getOutputStream();
+                    // 注意编码格式,防止中文乱码
+                    os.write(param.getBytes("UTF-8"));
+                    os.close();
+                }
+            }
+
+            /** 请求成功:返回码为200 */
+            if (connection.getResponseCode() == 200) {
+                /** 通过连接对象获取一个输入流,向远程读取 */
+                is = connection.getInputStream();
+                /** 封装输入流is,并指定字符集 */
+                br = new BufferedReader(new InputStreamReader(is, "UTF-8"));
+
+                StringBuffer sbf = new StringBuffer();
+                String line = null;
+                while ((line = br.readLine()) != null) {
+                    sbf.append(line);
+                    sbf.append("\r\n");
+                }
+                result = sbf.toString();
+            }
+
+        } catch (Exception e) {
+            e.printStackTrace();
+        } finally {
+            /** 关闭资源 */
+            try {
+                if (null != br) {
+                    br.close();
+                }
+                if (null != is) {
+                    is.close();
+                }
+                if (null != os) {
+                    os.close();
+                }
+            } catch (Exception e) {
+                e.printStackTrace();
+            }
+            /** 关闭远程连接 */
+            // 断开连接,最好写上,disconnect是在底层tcp socket链接空闲时才切断。如果正在被其他线程使用就不切断。
+            // 固定多线程的话,如果不disconnect,链接会增多,直到收发不出信息。写上disconnect后正常一些
+            connection.disconnect();
+            log.info("--------->>> " + requestMethod + " request end <<<----------");
+        }
+        jsonObject = JSONObject.parseObject(result);
+        return jsonObject;
+    }
+}

+ 119 - 118
happy-boot-module-system/src/main/java/org/jeecg/modules/util/WisdomUrlUtil.java

@@ -1,118 +1,119 @@
-package org.jeecg.modules.util;
-
-/**
- * 慧盈接口路径
- */
-public class WisdomUrlUtil {
-
-    /**
-     * 企业-新增
-     */
-    public static final String companyAdd = "/oauth/hlwcompany/add";
-
-    //企业-编辑
-    public static final String companyedit = "/oauth/hlwcompany/edit";
-
-    //企业-锁定/解锁
-    public static final String companyLock = "/oauth/hlwcompany/lock";
-
-    //企业-删除
-    public static final String companyDelete = "/oauth/hlwcompany/delete";
-
-    //企业-设置-基本配置
-    public static final String companyConfig = "/oauth/hlwcompany/config";
-
-    //获取应用设置参数
-    public static final String applicationGet = "/oauth/hlwcompany/getApplicationSetting";
-
-    //获取获取企业信息
-    public static final String getCompanyInfo = "/oauth/hlwcompany/get";
-
-    //企业服务商-新增
-    public static final String companySubcontractorAdd = "/oauth/hlwCompanySubcontractor/add";
-
-    //企业服务商-编辑
-    public static final String companySubcontractoredit = "/oauth/hlwCompanySubcontractor/edit";
-
-    //企业服务商-停用/启用
-    public static final String companySubcontractorLock = "/oauth/hlwCompanySubcontractor/lock";
-
-    //企业服务商-删除
-    public static final String companySubcontractorDelete = "/oauth/hlwCompanySubcontractor/delete";
-
-    //企业服务商-上传服务合同
-    public static final String requireUploadContract = "/oauth/hlwRequirement/uploadServiceContract";
-
-    //企业服务商-列表
-    public static final String companySubcontractorList = "/oauth/hlwCompanySubcontractor/list";
-
-    //企业服务商-服务商配置选择列表
-    public static final String applicationSubcontractorList = "/oauth/hlwCompanySubcontractor/applicationSubList";
-
-    //付款申请-导入
-    public static final String paymentApply = "/oauth/hlwPayment/applyPayment";
-
-    //付款申请-删除
-    public static final String paymentDelete = "/oauth/hlwPayment/delete";
-
-    //付款申请-关联需求
-    public static final String requireRelate = "/oauth/hlwRequirement/relateRequirement";
-
-    //付款申请-查看需求
-    public static final String requireView = "/oauth/hlwRequirement/viewRequirement";
-
-    //付款申请-列表
-    public static final String paymentList = "/oauth/hlwPayment/list";
-
-    //付款明细-列表
-    public static final String paymentDetailList = "/oauth/hlwPayment/detailList";
-
-    //我的账户-服务商账户明细
-    public static final String companyAccountDetailList = "/oauth/hlwCompanyAccount/detailList";
-
-    //我的账户-导出
-    public static final String companyAccountDetailExport = "/oauth/hlwCompanyAccount/detailExport";
-
-    //用户-新增
-    public static final String userAdd = "/oauth/hlwUser/add";
-
-    //用户-编辑
-    public static final String userEdit = "/oauth/hlwUser/edit";
-
-    //用户-上传身份证
-    public static final String userUploadIdcard = "/oauth/hlwUser/uploadIdcard";
-
-    //用户-上传承揽合同
-    public static final String orderUploadUserContract = "/oauth/hlwOrder/uploadUserContract";
-
-    //用户合同监测
-    public static final String userContract = "/oauth/autoMonitor/userContract";
-
-    //企业合同监测
-    public static final String companyContract = "/oauth/autoMonitor/companyContract";
-
-    //企业账户监测
-    public static final String statisticData = "/oauth/autoMonitor/statisticData";
-
-    //需求—新增
-    private static final String requirementAdd ="/oauth/hlwRequirement/add";
-
-    //需求—编辑
-    private static final String requirementEdit ="/oauth/hlwRequirement/edit";
-
-    //需求—删除
-    private static final String requirementDelete ="/oauth/hlwRequirement/delete";
-
-    //订单列表
-    private static final String orderList="/oauth/hlwOrder/list";
-
-    //开心灵工订单服务商列表(不包含开心)
-    private static final String HwOrderSubcontractorList="/oauth/hlwCompanySubcontractor/hwOrderSubcontractorList";
-
-    //订单上面上传用户合同(承揽合同)
-    private static final String uploadWorkContract="/oauth/hlwOrder/uploadWorkContract";
-
-    //开心灵工甲方签章服务商列表(包含开心)(需要服务商名称)
-    private static final String HwSubcontractorList="/oauth/hlwCompanySubcontractor/hwSubcontractorList";
-
-}
+package org.jeecg.common.utils;
+
+/**
+ * @Author: zwq
+ * @Date: Create in 2020/8/17 13:35
+ * @Description: 慧盈业务接口
+ */
+public interface OauthApi {
+    /**
+     * 企业-新增
+     */
+    public static final String companyAdd = "/oauth/hlwcompany/add";
+
+    //企业-编辑
+    public static final String companyedit = "/oauth/hlwcompany/edit";
+
+    //企业-锁定/解锁
+    public static final String companyLock = "/oauth/hlwcompany/lock";
+
+    //企业-删除
+    public static final String companyDelete = "/oauth/hlwcompany/delete";
+
+    //企业-设置-基本配置
+    public static final String companyConfig = "/oauth/hlwcompany/config";
+
+    //获取应用设置参数
+    public static final String applicationGet = "/oauth/hlwcompany/getApplicationSetting";
+
+    //获取获取企业信息
+    public static final String getCompanyInfo = "/oauth/hlwcompany/get";
+
+    //企业服务商-新增
+    public static final String companySubcontractorAdd = "/oauth/hlwCompanySubcontractor/add";
+
+    //企业服务商-编辑
+    public static final String companySubcontractoredit = "/oauth/hlwCompanySubcontractor/edit";
+
+    //企业服务商-停用/启用
+    public static final String companySubcontractorLock = "/oauth/hlwCompanySubcontractor/lock";
+
+    //企业服务商-删除
+    public static final String companySubcontractorDelete = "/oauth/hlwCompanySubcontractor/delete";
+
+    //企业服务商-上传服务合同
+    public static final String requireUploadContract = "/oauth/hlwRequirement/uploadServiceContract";
+
+    //企业服务商-列表
+    public static final String companySubcontractorList = "/oauth/hlwCompanySubcontractor/list";
+
+    //企业服务商-服务商配置选择列表
+    public static final String applicationSubcontractorList = "/oauth/hlwCompanySubcontractor/applicationSubList";
+
+    //付款申请-导入
+    public static final String paymentApply = "/oauth/hlwPayment/applyPayment";
+
+    //付款申请-删除
+    public static final String paymentDelete = "/oauth/hlwPayment/delete";
+
+    //付款申请-关联需求
+    public static final String requireRelate = "/oauth/hlwRequirement/relateRequirement";
+
+    //付款申请-查看需求
+    public static final String requireView = "/oauth/hlwRequirement/viewRequirement";
+
+    //付款申请-列表
+    public static final String paymentList = "/oauth/hlwPayment/list";
+
+    //付款明细-列表
+    public static final String paymentDetailList = "/oauth/hlwPayment/detailList";
+
+    //我的账户-服务商账户明细
+    public static final String companyAccountDetailList = "/oauth/hlwCompanyAccount/detailList";
+
+    //我的账户-导出
+    public static final String companyAccountDetailExport = "/oauth/hlwCompanyAccount/detailExport";
+
+    //用户-新增
+    public static final String userAdd = "/oauth/hlwUser/add";
+
+    //用户-编辑
+    public static final String userEdit = "/oauth/hlwUser/edit";
+
+    //用户-上传身份证
+    public static final String userUploadIdcard = "/oauth/hlwUser/uploadIdcard";
+
+    //用户-上传承揽合同
+    public static final String orderUploadUserContract = "/oauth/hlwOrder/uploadUserContract";
+
+    //用户合同监测
+    public static final String userContract = "/oauth/autoMonitor/userContract";
+
+    //企业合同监测
+    public static final String companyContract = "/oauth/autoMonitor/companyContract";
+
+    //企业账户监测
+    public static final String statisticData = "/oauth/autoMonitor/statisticData";
+
+    //需求—新增
+    public static final String requirementAdd ="/oauth/hlwRequirement/add";
+
+    //需求—编辑
+    public static final String requirementEdit ="/oauth/hlwRequirement/edit";
+
+    //需求—删除
+    public static final String requirementDelete ="/oauth/hlwRequirement/delete";
+
+    //订单列表
+    public static final String orderList="/oauth/hlwOrder/list";
+
+    //开心灵工订单服务商列表(不包含开心)
+    public static final String HwOrderSubcontractorList="/oauth/hlwCompanySubcontractor/hwOrderSubcontractorList";
+
+    //订单上面上传用户合同(承揽合同)
+    public static final String uploadWorkContract="/oauth/hlwOrder/uploadWorkContract";
+
+    //开心灵工甲方签章服务商列表(包含开心)(需要服务商名称)
+    public static final String HwSubcontractorList="/oauth/hlwCompanySubcontractor/hwSubcontractorList";
+
+}

+ 238 - 240
happy-boot-module-system/src/main/java/org/jeecg/modules/util/OauthTokenUtils.java

@@ -1,240 +1,238 @@
-package org.jeecg.modules.util;
-
-import com.alibaba.fastjson.JSONObject;
-import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
-import org.jeecg.common.util.SpringContextUtils;
-import org.jeecg.modules.hwclient.entity.HwClientToken;
-import org.jeecg.modules.hwclient.service.IHwClientTokenService;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.springframework.beans.factory.annotation.Value;
-import org.springframework.context.annotation.DependsOn;
-import org.springframework.stereotype.Component;
-
-import javax.annotation.PostConstruct;
-
-/**
- * @Author: zwq
- * @Date: Create in 2020/8/12 15:11
- * @Description: 授权token工具类
- */
-@Component
-@DependsOn("springContextUtils")
-public class OauthTokenUtils {
-    private static Logger log = LoggerFactory.getLogger(OauthTokenUtils.class);
-
-    private static IHwClientTokenService hwClientTokenService = SpringContextUtils.getBean(IHwClientTokenService.class);
-
-    /**
-     * 开发环境
-     */
-    @Value("${spring.profiles.active}")
-    private String profile;
-    /**
-     * 结算中心接口统一前缀
-     */
-    @Value("${jeecg.oauth.oauth-prefix-url}")
-    private String OAUTH_PREFIX_URL;
-    @Value("${jeecg.oauth.client-id}")
-    private String clientId;
-    @Value("${jeecg.oauth.client-secret}")
-    private String clientSecret;
-
-    public static OauthTokenUtils oauthTokenUtils;
-
-    public static String profiles;
-    public static String OAUTH_PREFIX_URLS;
-    /**
-     * 客户端id
-     */
-    public static String CLIENT_ID;
-
-    /**
-     * 客户端秘钥
-     */
-    public static String CLIENT_SECRET;
-
-    @PostConstruct
-    public void init() {
-        oauthTokenUtils = this;
-        profiles = profile;
-        OAUTH_PREFIX_URLS = OAUTH_PREFIX_URL;
-        CLIENT_ID = clientId;
-        CLIENT_SECRET = clientSecret;
-    }
-
-    /**
-     * http/https请求公共方法
-     *
-     * @param requestUrl
-     * @param requestMethod
-     * @param param
-     * @return
-     */
-    public static JSONObject doRequest(String requestUrl, String requestMethod, String param) {
-        JSONObject jsonObject = null;
-        requestUrl = OAUTH_PREFIX_URLS + requestUrl;
-        if ("dev".equals(profiles)) {
-            jsonObject = HttpsUtils.doHttpRequest(requestUrl, requestMethod, param);
-        } else {
-            jsonObject = HttpsUtils.doHttpsRequest(requestUrl, requestMethod, param);
-        }
-        return jsonObject;
-    }
-
-    /**
-     * http/https请求公共方法
-     * 业务带token请求
-     *
-     * @param requestUrl
-     * @param requestMethod
-     * @param param
-     * @return
-     */
-    public static JSONObject doRequest(String requestUrl, String requestMethod, String param, String token) {
-        JSONObject jsonObject = null;
-        requestUrl = OAUTH_PREFIX_URLS + requestUrl;
-        if ("dev".equals(profiles)) {
-            jsonObject = HttpsUtils.doHttpRequest(requestUrl, requestMethod, param, token);
-        } else {
-            jsonObject = HttpsUtils.doHttpsRequest(requestUrl, requestMethod, param, token);
-        }
-        return jsonObject;
-    }
-
-    /**
-     * 获取凭证accesstoken
-     *
-     * @return
-     */
-    public static JSONObject getAccessToken() {
-        try {
-            String requestUrl = HttpsContants.OAUTH_TOKEN_URL.replace("CLIENT", CLIENT_ID).replace("SECRET", CLIENT_SECRET);
-            JSONObject jsonObject = doRequest(requestUrl, HttpsContants.POST, null);
-            log.info("Token=============,{}", jsonObject);
-            return jsonObject;
-        } catch (Exception e) {
-            e.printStackTrace();
-        }
-        return null;
-    }
-
-    /**
-     * 验证accesstoken
-     *
-     * @param token
-     * @return
-     */
-    public static JSONObject checkAccessToken(String token) {
-        try {
-            String requestUrl = HttpsContants.OAUTH_CKECK_TOKEN_URL.replace("TOKEN", token);
-            JSONObject jsonObject = doRequest(requestUrl, HttpsContants.POST, null);
-            return jsonObject;
-        } catch (Exception e) {
-            e.printStackTrace();
-        }
-        return null;
-    }
-
-    /**
-     * 验证access_token是否有效
-     *
-     * @param token
-     * @return
-     */
-    public static boolean tokenIsvalid(String token) {
-        boolean isValid = false;
-        try {
-            if (token != null) {
-                JSONObject jsonObject = checkAccessToken(token);
-                log.info("checkToken=============,{}", jsonObject);
-                if (jsonObject != null) {
-                    if (jsonObject.getBoolean("success")) {
-                        JSONObject jsonObject1 = jsonObject.getJSONObject("result");
-                        log.info("isValid=============,{}", jsonObject1.getBoolean("active"));
-                        isValid = jsonObject1.getBoolean("active");
-                    }
-                }
-            }
-        } catch (Exception e) {
-            e.printStackTrace();
-        }
-        return isValid;
-    }
-
-
-    /**
-     * 日常获取凭证accesstoken
-     *
-     * @return
-     */
-    public static String getDayAccessToken() {
-        String accessToken = "";
-        try {
-            QueryWrapper<HwClientToken> queryWrapper = new QueryWrapper<>();
-            HwClientToken hwClientToken = hwClientTokenService.getOne(queryWrapper);
-            if (hwClientToken != null) {
-                accessToken = hwClientToken.getAccessToken();
-                //验证accessToken
-                boolean result = tokenIsvalid(accessToken);
-                //刷新accessToken
-                if (!result) {
-                    JSONObject jsonObject = getAccessToken();
-                    accessToken = parseTokenAndUpdate(jsonObject, hwClientToken);
-                }
-            } else {
-                //获取accessToken
-                JSONObject jsonObject = getAccessToken();
-                accessToken = parseTokenAndSave(jsonObject);
-            }
-        } catch (Exception e) {
-            e.printStackTrace();
-        }
-        return accessToken;
-    }
-
-    /**
-     * 解析token
-     *
-     * @param jsonObject
-     * @return
-     */
-    public static String parseTokenAndSave(JSONObject jsonObject) {
-        String accessToken = "";
-        if (jsonObject != null) {
-            if (jsonObject.getBoolean("success")) {
-                JSONObject jsonObject1 = jsonObject.getJSONObject("result");
-                log.info("accessToken=============,{}", jsonObject1.getString("accessToken"));
-                accessToken = jsonObject1.getString("accessToken");
-                //保存accessToken表信息
-                HwClientToken hwClientToken1 = new HwClientToken();
-                hwClientToken1.setAccessToken(accessToken);
-                hwClientToken1.setExpiresIn(jsonObject1.getInteger("expiresIn"));
-                hwClientTokenService.save(hwClientToken1);
-            }
-        }
-        return accessToken;
-    }
-
-    /**
-     * 解析token
-     *
-     * @param jsonObject
-     * @return
-     */
-    public static String parseTokenAndUpdate(JSONObject jsonObject, HwClientToken hwClientToken) {
-        String accessToken = "";
-        if (jsonObject != null) {
-            if (jsonObject.getBoolean("success")) {
-                JSONObject jsonObject1 = jsonObject.getJSONObject("result");
-                log.info("accessToken=============,{}", jsonObject1.getString("accessToken"));
-                accessToken = jsonObject1.getString("accessToken");
-                //更新accessToken表信息
-                hwClientToken.setAccessToken(accessToken);
-                hwClientToken.setExpiresIn(jsonObject1.getInteger("expiresIn"));
-                hwClientTokenService.updateById(hwClientToken);
-            }
-        }
-        return accessToken;
-    }
-}
+package org.jeecg.common.utils;
+
+import com.alibaba.fastjson.JSONObject;
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import org.jeecg.common.util.SpringContextUtils;
+import org.jeecg.modules.hlgclient.entity.HlgClientToken;
+import org.jeecg.modules.hlgclient.service.IHlgClientTokenService;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.beans.factory.annotation.Value;
+import org.springframework.stereotype.Component;
+
+import javax.annotation.PostConstruct;
+
+/**
+ * @Author: zwq
+ * @Date: Create in 2020/8/12 15:11
+ * @Description: 授权token工具类
+ */
+@Component
+public class OauthTokenUtils {
+    private static Logger log = LoggerFactory.getLogger(OauthTokenUtils.class);
+
+    private static IHlgClientTokenService hlgClientTokenService = SpringContextUtils.getBean(IHlgClientTokenService.class);
+
+    /**
+     * 开发环境
+     */
+    @Value("${spring.profiles.active}")
+    private String profile;
+    /**
+     * 结算中心接口统一前缀
+     */
+    @Value("${jeecg.oauth.oauth-prefix-url}")
+    private String OAUTH_PREFIX_URL;
+    @Value("${jeecg.oauth.client-id}")
+    private String clientId;
+    @Value("${jeecg.oauth.client-secret}")
+    private String clientSecret;
+
+    public static OauthTokenUtils oauthTokenUtils;
+
+    public static String profiles;
+    public static String OAUTH_PREFIX_URLS;
+    /**
+     * 客户端id
+     */
+    public static String CLIENT_ID;
+
+    /**
+     * 客户端秘钥
+     */
+    public static String CLIENT_SECRET;
+
+    @PostConstruct
+    public void init() {
+        oauthTokenUtils = this;
+        profiles = profile;
+        OAUTH_PREFIX_URLS = OAUTH_PREFIX_URL;
+        CLIENT_ID = clientId;
+        CLIENT_SECRET = clientSecret;
+    }
+
+    /**
+     * http/https请求公共方法
+     *
+     * @param requestUrl
+     * @param requestMethod
+     * @param param
+     * @return
+     */
+    public static JSONObject doRequest(String requestUrl, String requestMethod, String param) {
+        JSONObject jsonObject = null;
+        requestUrl = OAUTH_PREFIX_URLS + requestUrl;
+        if ("dev".equals(profiles)) {
+            jsonObject = HttpsUtils.doHttpRequest(requestUrl, requestMethod, param);
+        } else {
+            jsonObject = HttpsUtils.doHttpsRequest(requestUrl, requestMethod, param);
+        }
+        return jsonObject;
+    }
+
+    /**
+     * http/https请求公共方法
+     * 业务带token请求
+     *
+     * @param requestUrl
+     * @param requestMethod
+     * @param param
+     * @return
+     */
+    public static JSONObject doRequest(String requestUrl, String requestMethod, String param, String token) {
+        JSONObject jsonObject = null;
+        requestUrl = OAUTH_PREFIX_URLS + requestUrl;
+        if ("dev".equals(profiles)) {
+            jsonObject = HttpsUtils.doHttpRequest(requestUrl, requestMethod, param, token);
+        } else {
+            jsonObject = HttpsUtils.doHttpsRequest(requestUrl, requestMethod, param, token);
+        }
+        return jsonObject;
+    }
+
+    /**
+     * 获取凭证accesstoken
+     *
+     * @return
+     */
+    public static JSONObject getAccessToken() {
+        try {
+            String requestUrl = HttpsContants.OAUTH_TOKEN_URL.replace("CLIENT", CLIENT_ID).replace("SECRET", CLIENT_SECRET);
+            JSONObject jsonObject = doRequest(requestUrl, HttpsContants.POST, null);
+            log.info("Token=============,{}", jsonObject);
+            return jsonObject;
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+        return null;
+    }
+
+    /**
+     * 验证accesstoken
+     *
+     * @param token
+     * @return
+     */
+    public static JSONObject checkAccessToken(String token) {
+        try {
+            String requestUrl = HttpsContants.OAUTH_CKECK_TOKEN_URL.replace("TOKEN", token);
+            JSONObject jsonObject = doRequest(requestUrl, HttpsContants.POST, null);
+            return jsonObject;
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+        return null;
+    }
+
+    /**
+     * 验证access_token是否有效
+     *
+     * @param token
+     * @return
+     */
+    public static boolean tokenIsvalid(String token) {
+        boolean isValid = false;
+        try {
+            if (token != null) {
+                JSONObject jsonObject = checkAccessToken(token);
+                log.info("checkToken=============,{}", jsonObject);
+                if (jsonObject != null) {
+                    if (jsonObject.getBoolean("success")) {
+                        JSONObject jsonObject1 = jsonObject.getJSONObject("result");
+                        log.info("isValid=============,{}", jsonObject1.getBoolean("active"));
+                        isValid = jsonObject1.getBoolean("active");
+                    }
+                }
+            }
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+        return isValid;
+    }
+
+
+    /**
+     * 日常获取凭证accesstoken
+     *
+     * @return
+     */
+    public static String getDayAccessToken() {
+        String accessToken = "";
+        try {
+            QueryWrapper<HlgClientToken> queryWrapper = new QueryWrapper<>();
+            HlgClientToken hlgClientToken = hlgClientTokenService.getOne(queryWrapper);
+            if (hlgClientToken != null) {
+                accessToken = hlgClientToken.getAccessToken();
+                //验证accessToken
+                boolean result = tokenIsvalid(accessToken);
+                //刷新accessToken
+                if (!result) {
+                    JSONObject jsonObject = getAccessToken();
+                    accessToken = parseTokenAndUpdate(jsonObject, hlgClientToken);
+                }
+            } else {
+                //获取accessToken
+                JSONObject jsonObject = getAccessToken();
+                accessToken = parseTokenAndSave(jsonObject);
+            }
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+        return accessToken;
+    }
+
+    /**
+     * 解析token
+     *
+     * @param jsonObject
+     * @return
+     */
+    public static String parseTokenAndSave(JSONObject jsonObject) {
+        String accessToken = "";
+        if (jsonObject != null) {
+            if (jsonObject.getBoolean("success")) {
+                JSONObject jsonObject1 = jsonObject.getJSONObject("result");
+                log.info("accessToken=============,{}", jsonObject1.getString("accessToken"));
+                accessToken = jsonObject1.getString("accessToken");
+                //保存accessToken表信息
+                HlgClientToken hlgClientToken1 = new HlgClientToken();
+                hlgClientToken1.setAccessToken(accessToken);
+                hlgClientToken1.setExpiresIn(jsonObject1.getInteger("expiresIn"));
+                hlgClientTokenService.save(hlgClientToken1);
+            }
+        }
+        return accessToken;
+    }
+
+    /**
+     * 解析token
+     *
+     * @param jsonObject
+     * @return
+     */
+    public static String parseTokenAndUpdate(JSONObject jsonObject, HlgClientToken hlgClientToken) {
+        String accessToken = "";
+        if (jsonObject != null) {
+            if (jsonObject.getBoolean("success")) {
+                JSONObject jsonObject1 = jsonObject.getJSONObject("result");
+                log.info("accessToken=============,{}", jsonObject1.getString("accessToken"));
+                accessToken = jsonObject1.getString("accessToken");
+                //更新accessToken表信息
+                hlgClientToken.setAccessToken(accessToken);
+                hlgClientToken.setExpiresIn(jsonObject1.getInteger("expiresIn"));
+                hlgClientTokenService.updateById(hlgClientToken);
+            }
+        }
+        return accessToken;
+    }
+}

happy-boot-module-system/src/main/java/org/jeecg/modules/hwclient/controller/HwClientTokenController.java → happy-boot-module-settlement/src/main/java/org/jeecg/modules/hwclient/controller/HwClientTokenController.java


happy-boot-module-system/src/main/java/org/jeecg/modules/hwclient/entity/HwClientToken.java → happy-boot-module-settlement/src/main/java/org/jeecg/modules/hwclient/entity/HwClientToken.java


happy-boot-module-system/src/main/java/org/jeecg/modules/hwclient/mapper/HwClientTokenMapper.java → happy-boot-module-settlement/src/main/java/org/jeecg/modules/hwclient/mapper/HwClientTokenMapper.java


happy-boot-module-system/src/main/java/org/jeecg/modules/hwclient/mapper/xml/HwClientTokenMapper.xml → happy-boot-module-settlement/src/main/java/org/jeecg/modules/hwclient/mapper/xml/HwClientTokenMapper.xml


happy-boot-module-system/src/main/java/org/jeecg/modules/hwclient/service/IHwClientTokenService.java → happy-boot-module-settlement/src/main/java/org/jeecg/modules/hwclient/service/IHwClientTokenService.java


happy-boot-module-system/src/main/java/org/jeecg/modules/hwclient/service/impl/HwClientTokenServiceImpl.java → happy-boot-module-settlement/src/main/java/org/jeecg/modules/hwclient/service/impl/HwClientTokenServiceImpl.java


+ 381 - 380
pom.xml

@@ -1,381 +1,382 @@
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
-  <modelVersion>4.0.0</modelVersion>
-  <groupId>org.jeecgframework.boot</groupId>
-  <artifactId>happy-boot-parent</artifactId>
-  <version>2.1.0</version>
-  <packaging>pom</packaging>
-  
-  	<parent>
-	    <groupId>org.springframework.boot</groupId>
-	    <artifactId>spring-boot-starter-parent</artifactId>
-	    <version>2.1.3.RELEASE</version>
-	    <relativePath/>
-	</parent>
-
-
-	<modules>
-		<module>happy-boot-base-common</module>
-		<module>happy-boot-module-system</module>
-		<module>happy-boot-module-common</module>
-		<module>happy-boot-module-flexjob</module>
-        <module>happy-boot-module-pay</module>
-        <module>happy-boot-module-econtract</module>
-    </modules>
-	
-	<distributionManagement>
-	  	<repository>
-            <id>jeecg</id>
-            <name>jeecg Repository</name>
-            <url>http://maven.jeecg.com:8090/nexus/content/repositories/jeecg</url>
-        </repository>
-        <snapshotRepository>
-	        <id>jeecg-snapshots</id>
-            <name>jeecg Snapshot Repository</name>
-            <url>http://maven.jeecg.com:8090/nexus/content/repositories/snapshots/</url>
-	    </snapshotRepository>
-	</distributionManagement>
-	
-	<repositories>
-		<repository>
-            <id>aliyun</id>
-            <name>aliyun Repository</name>
-            <url>http://maven.aliyun.com/nexus/content/groups/public</url>
-            <snapshots>
-				<enabled>false</enabled>
-			</snapshots>
-        </repository>
-		<repository>
-            <id>jeecg</id>
-            <name>jeecg Repository</name>
-            <url>http://maven.jeewx.com/nexus/content/repositories/jeecg</url>
-            <snapshots>
-				<enabled>false</enabled>
-			</snapshots>
-        </repository>
-	</repositories>
-	
-    <properties>
-        <happyboot.common.version>2.1.0</happyboot.common.version>
-        <java.version>1.8</java.version>
-        <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
-        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
-        <mybatis-plus.version>3.1.2</mybatis-plus.version>
-        <druid.version>1.1.17</druid.version>
-        <jwt.version>0.9.1</jwt.version>
-        <commons.version>2.6</commons.version>
-        <aliyun-java-sdk-core.version>3.2.3</aliyun-java-sdk-core.version>
-		<aliyun-java-sdk-dysmsapi.version>1.0.0</aliyun-java-sdk-dysmsapi.version>
-		<okhttp-version>3.11.0</okhttp-version>
-    </properties>
-    
-	<dependencies>
-		<!--集成springmvc框架并实现自动配置 -->
-		<dependency>
-			<groupId>org.springframework.boot</groupId>
-			<artifactId>spring-boot-starter-web</artifactId>
-		</dependency>
-		<dependency>
-    		<groupId>org.springframework.boot</groupId>
-    		<artifactId>spring-boot-starter-mail</artifactId>
-		</dependency>
-		<dependency>
-	        <groupId>org.springframework.boot</groupId>
-	        <artifactId>spring-boot-starter-test</artifactId>
-	        <scope>test</scope>
-	    </dependency>
-	    <dependency>
-            <groupId>org.springframework.boot</groupId>
-            <artifactId>spring-boot-starter-aop</artifactId>
-        </dependency>
-        <dependency>
-            <groupId>org.springframework.boot</groupId>
-            <artifactId>spring-boot-starter-actuator</artifactId>
-        </dependency>
-	    <!-- <dependency>
-			<groupId>org.springframework.boot</groupId>
-			<artifactId>spring-boot-devtools</artifactId>
-			<optional>true</optional>
-		</dependency> -->
-		
-		<!-- commons -->
-		<dependency>
-			<groupId>commons-io</groupId>
-			<artifactId>commons-io</artifactId>
-			<version>${commons.version}</version>
-		</dependency>
-		<dependency>
-			<groupId>commons-lang</groupId>
-			<artifactId>commons-lang</artifactId>
-			<version>${commons.version}</version>
-		</dependency>
-		<dependency>
-			<groupId>commons-fileupload</groupId>
-			<artifactId>commons-fileupload</artifactId>
-			<version>1.4</version>
-		</dependency>
-		
-		<!-- freemarker -->
-		<dependency>
-			<groupId>org.springframework.boot</groupId>
-			<artifactId>spring-boot-starter-freemarker</artifactId>
-		</dependency>
-		
-		<!-- Lombok -->
-		<dependency>
-			<groupId>org.projectlombok</groupId>
-			<artifactId>lombok</artifactId>
-		</dependency>
-		
-		<!-- mybatis-plus -->
-		 <dependency>
-	        <groupId>com.baomidou</groupId>
-	        <artifactId>mybatis-plus-boot-starter</artifactId>
-	        <version>${mybatis-plus.version}</version>
-	    </dependency>
-		
-		<!-- druid -->
-       <dependency>
-		   <groupId>com.alibaba</groupId>
-		   <artifactId>druid-spring-boot-starter</artifactId>
-		   <version>${druid.version}</version>
-		</dependency>
-		
-		<!-- 动态数据源 -->
-		<dependency>
-		  <groupId>com.baomidou</groupId>
-		  <artifactId>dynamic-datasource-spring-boot-starter</artifactId>
-		  <version>2.5.4</version>
-		</dependency>
-				
-		<!-- json -->
-		<dependency>
-         	<groupId>com.alibaba</groupId>
-         	<artifactId>fastjson</artifactId>
-         	<version>1.2.69</version>
-        </dependency>
-      
-		<!--mysql-->
-		<dependency>
-		   <groupId>mysql</groupId>
-		   <artifactId>mysql-connector-java</artifactId>
-		   <version>5.1.47</version>
-		   <scope>runtime</scope>
-		</dependency>
-		<!--  sqlserver-->
-		<dependency>
-		    <groupId>com.microsoft.sqlserver</groupId>
-		    <artifactId>sqljdbc4</artifactId>
-		    <version>4.0</version>
-		    <scope>runtime</scope>
-		</dependency>
-		<!-- oracle驱动 -->
-		<dependency>
-		    <groupId>com.oracle</groupId>
-		    <artifactId>ojdbc6</artifactId>
-		    <version>11.2.0.3</version>
-			<scope>runtime</scope>
-		</dependency>
-		
-		 <!-- Quartz定时任务 -->
-        <dependency>
-            <groupId>org.springframework.boot</groupId>
-            <artifactId>spring-boot-starter-quartz</artifactId>
-        </dependency>
-        
-		<!--JWT-->
-		<dependency>
-			<groupId>com.auth0</groupId>
-			<artifactId>java-jwt</artifactId>
-			<version>3.7.0</version>
-		</dependency>
-		
-		<!--shiro-->
-		<dependency>
-		    <groupId>org.apache.shiro</groupId>
-		    <artifactId>shiro-spring-boot-starter</artifactId>
-		    <version>1.4.0</version>
-		</dependency>
-		
-		<!-- Swagger API文档 -->
-        <dependency>
-		    <groupId>io.springfox</groupId>
-		    <artifactId>springfox-swagger2</artifactId>
-		    <version>2.9.2</version>
-		</dependency>
-		<dependency>
-		    <groupId>io.springfox</groupId>
-		    <artifactId>springfox-swagger-ui</artifactId>
-		    <version>2.9.2</version>
-		</dependency>
-		<dependency>
-			<groupId>com.github.xiaoymin</groupId>
-			<artifactId>swagger-bootstrap-ui</artifactId>
-			<version>1.9.3</version>
-		</dependency>
-		<dependency>
-			<groupId>io.springfox</groupId>
-			<artifactId>springfox-bean-validators</artifactId>
-			<version>2.9.2</version>
-		</dependency>
-		<!-- # 增加两个配置解决 NumberFormatException -->
-		<dependency>
-			<groupId>io.swagger</groupId>
-			<artifactId>swagger-annotations</artifactId>
-			<version>1.5.22</version>
-		</dependency>
-		<dependency>
-			<groupId>io.swagger</groupId>
-			<artifactId>swagger-models</artifactId>
-			<version>1.5.22</version>
-		</dependency>
-		
-		
-		<!-- Redis -->
-		<dependency>
-			 <groupId>org.springframework.boot</groupId>
-			  <artifactId>spring-boot-starter-data-redis</artifactId>
-		</dependency>
-		<dependency>
-            <groupId>org.apache.commons</groupId>
-            <artifactId>commons-pool2</artifactId>
-        </dependency>
-        
-		<!-- 代码生成器 -->
-		<!-- 如果下载失败,看这个链接http://jeecg-boot.mydoc.io/?t=345672 -->
-		<dependency>
-			<groupId>org.jeecgframework.boot</groupId>
-			<artifactId>codegenerate</artifactId>
-			<version>1.0.5</version>
-		</dependency>
-		
-        <!-- AutoPoi Excel工具类-->
-		<dependency>
-			<groupId>org.jeecgframework</groupId>
-			<artifactId>autopoi-web</artifactId>
-			<version>1.0.3</version>
-			<exclusions>
-				<exclusion>
-					<groupId>commons-codec</groupId>
-					<artifactId>commons-codec</artifactId>
-				</exclusion>
-			</exclusions>
-		</dependency>
-		
-		<dependency>
-		    <groupId>cn.hutool</groupId>
-		    <artifactId>hutool-all</artifactId>
-		    <version>4.5.11</version>
-		</dependency>
-		
-		<!-- 阿里云短信 -->
-		<dependency>
-			<groupId>com.aliyun</groupId>
-			<artifactId>aliyun-java-sdk-dysmsapi</artifactId>
-			<version>${aliyun-java-sdk-dysmsapi.version}</version>
-		</dependency>
-		<dependency>
-			<groupId>com.aliyun</groupId>
-			<artifactId>aliyun-java-sdk-core</artifactId>
-			<version>${aliyun-java-sdk-core.version}</version>
-		</dependency>
-		
-		<!--HttpClient-->
-		<dependency>
-			<groupId>org.apache.httpcomponents</groupId>
-			<artifactId>httpclient</artifactId>
-			<version>4.5.3</version>
-		</dependency>
-		
-		<!-- websocket -->
-		<dependency>
-		   <groupId>org.springframework.boot</groupId>
-		   <artifactId>spring-boot-starter-websocket</artifactId>
-		</dependency>
-
-		<!--阿里云图片服务-->
-		<dependency>
-			<groupId>com.aliyun.oss</groupId>
-			<artifactId>aliyun-sdk-oss</artifactId>
-			<version>2.6.0</version>
-		</dependency>
-
-		<dependency>
-			<groupId>com.squareup.okhttp3</groupId>
-			<artifactId>okhttp</artifactId>
-			<version>${okhttp-version}</version>
-		</dependency>
-
-		<!-- 配置文件处理器,会提示 -->
-		<dependency>
-			<groupId>org.springframework.boot</groupId>
-			<artifactId>spring-boot-configuration-processor</artifactId>
-			<optional>true</optional>
-		</dependency>
-		
-	</dependencies>
-
-	<dependencyManagement>
-		<dependencies>
-			<!-- happy-boot-base-common -->
-			<dependency>
-	    		<groupId>org.jeecgframework.boot</groupId>
-	    		<artifactId>happy-boot-base-common</artifactId>
-	    		<version>${happyboot.common.version}</version>
-	    	</dependency>
-		</dependencies>
-	</dependencyManagement>
-	<build>
-		<plugins>
-			<!--<plugin>
-				<groupId>org.springframework.boot</groupId>
-				<artifactId>spring-boot-maven-plugin</artifactId>
-			</plugin>
-			 指定JDK编译版本 -->
-            <plugin>
-                <groupId>org.apache.maven.plugins</groupId>
-                <artifactId>maven-compiler-plugin</artifactId>
-                <configuration>
-                    <source>1.8</source>
-                    <target>1.8</target>
-                    <encoding>UTF-8</encoding>
-                </configuration>
-            </plugin>
-            <!-- 打包跳过测试 -->
-            <plugin>
-		        <groupId>org.apache.maven.plugins</groupId>
-		        <artifactId>maven-surefire-plugin</artifactId>
-		        <configuration>
-		          <skipTests>true</skipTests>
-		        </configuration>
-	        </plugin>
-	         <!-- 避免font文件的二进制文件格式压缩破坏 -->
-	         <plugin>
-                <groupId>org.apache.maven.plugins</groupId>
-                <artifactId>maven-resources-plugin</artifactId>
-                <configuration>
-                    <nonFilteredFileExtensions>
-                        <nonFilteredFileExtension>woff</nonFilteredFileExtension>
-                        <nonFilteredFileExtension>woff2</nonFilteredFileExtension>
-                        <nonFilteredFileExtension>eot</nonFilteredFileExtension>
-                        <nonFilteredFileExtension>ttf</nonFilteredFileExtension>
-                        <nonFilteredFileExtension>svg</nonFilteredFileExtension>
-                    </nonFilteredFileExtensions>
-                </configuration>
-            </plugin>
-		</plugins>
-		<resources>
-			<resource>
-                <directory>src/main/resources</directory>
-                <filtering>true</filtering>
-            </resource>
-			<resource>
-				<directory>src/main/java</directory>
-				<includes>
-					<include>**/*.xml</include>
-					<include>**/*.json</include>
-					<include>**/*.ftl</include>
-				</includes>
-			</resource>
-		</resources>
-	</build>
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+  <modelVersion>4.0.0</modelVersion>
+  <groupId>org.jeecgframework.boot</groupId>
+  <artifactId>happy-boot-parent</artifactId>
+  <version>2.1.0</version>
+  <packaging>pom</packaging>
+  
+  	<parent>
+	    <groupId>org.springframework.boot</groupId>
+	    <artifactId>spring-boot-starter-parent</artifactId>
+	    <version>2.1.3.RELEASE</version>
+	    <relativePath/>
+	</parent>
+
+
+	<modules>
+		<module>happy-boot-base-common</module>
+		<module>happy-boot-module-system</module>
+		<module>happy-boot-module-common</module>
+		<module>happy-boot-module-flexjob</module>
+        <module>happy-boot-module-pay</module>
+        <module>happy-boot-module-econtract</module>
+        <module>happy-boot-module-settlement</module>
+    </modules>
+	
+	<distributionManagement>
+	  	<repository>
+            <id>jeecg</id>
+            <name>jeecg Repository</name>
+            <url>http://maven.jeecg.com:8090/nexus/content/repositories/jeecg</url>
+        </repository>
+        <snapshotRepository>
+	        <id>jeecg-snapshots</id>
+            <name>jeecg Snapshot Repository</name>
+            <url>http://maven.jeecg.com:8090/nexus/content/repositories/snapshots/</url>
+	    </snapshotRepository>
+	</distributionManagement>
+	
+	<repositories>
+		<repository>
+            <id>aliyun</id>
+            <name>aliyun Repository</name>
+            <url>http://maven.aliyun.com/nexus/content/groups/public</url>
+            <snapshots>
+				<enabled>false</enabled>
+			</snapshots>
+        </repository>
+		<repository>
+            <id>jeecg</id>
+            <name>jeecg Repository</name>
+            <url>http://maven.jeewx.com/nexus/content/repositories/jeecg</url>
+            <snapshots>
+				<enabled>false</enabled>
+			</snapshots>
+        </repository>
+	</repositories>
+	
+    <properties>
+        <happyboot.common.version>2.1.0</happyboot.common.version>
+        <java.version>1.8</java.version>
+        <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
+        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
+        <mybatis-plus.version>3.1.2</mybatis-plus.version>
+        <druid.version>1.1.17</druid.version>
+        <jwt.version>0.9.1</jwt.version>
+        <commons.version>2.6</commons.version>
+        <aliyun-java-sdk-core.version>3.2.3</aliyun-java-sdk-core.version>
+		<aliyun-java-sdk-dysmsapi.version>1.0.0</aliyun-java-sdk-dysmsapi.version>
+		<okhttp-version>3.11.0</okhttp-version>
+    </properties>
+    
+	<dependencies>
+		<!--集成springmvc框架并实现自动配置 -->
+		<dependency>
+			<groupId>org.springframework.boot</groupId>
+			<artifactId>spring-boot-starter-web</artifactId>
+		</dependency>
+		<dependency>
+    		<groupId>org.springframework.boot</groupId>
+    		<artifactId>spring-boot-starter-mail</artifactId>
+		</dependency>
+		<dependency>
+	        <groupId>org.springframework.boot</groupId>
+	        <artifactId>spring-boot-starter-test</artifactId>
+	        <scope>test</scope>
+	    </dependency>
+	    <dependency>
+            <groupId>org.springframework.boot</groupId>
+            <artifactId>spring-boot-starter-aop</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.springframework.boot</groupId>
+            <artifactId>spring-boot-starter-actuator</artifactId>
+        </dependency>
+	    <!-- <dependency>
+			<groupId>org.springframework.boot</groupId>
+			<artifactId>spring-boot-devtools</artifactId>
+			<optional>true</optional>
+		</dependency> -->
+		
+		<!-- commons -->
+		<dependency>
+			<groupId>commons-io</groupId>
+			<artifactId>commons-io</artifactId>
+			<version>${commons.version}</version>
+		</dependency>
+		<dependency>
+			<groupId>commons-lang</groupId>
+			<artifactId>commons-lang</artifactId>
+			<version>${commons.version}</version>
+		</dependency>
+		<dependency>
+			<groupId>commons-fileupload</groupId>
+			<artifactId>commons-fileupload</artifactId>
+			<version>1.4</version>
+		</dependency>
+		
+		<!-- freemarker -->
+		<dependency>
+			<groupId>org.springframework.boot</groupId>
+			<artifactId>spring-boot-starter-freemarker</artifactId>
+		</dependency>
+		
+		<!-- Lombok -->
+		<dependency>
+			<groupId>org.projectlombok</groupId>
+			<artifactId>lombok</artifactId>
+		</dependency>
+		
+		<!-- mybatis-plus -->
+		 <dependency>
+	        <groupId>com.baomidou</groupId>
+	        <artifactId>mybatis-plus-boot-starter</artifactId>
+	        <version>${mybatis-plus.version}</version>
+	    </dependency>
+		
+		<!-- druid -->
+       <dependency>
+		   <groupId>com.alibaba</groupId>
+		   <artifactId>druid-spring-boot-starter</artifactId>
+		   <version>${druid.version}</version>
+		</dependency>
+		
+		<!-- 动态数据源 -->
+		<dependency>
+		  <groupId>com.baomidou</groupId>
+		  <artifactId>dynamic-datasource-spring-boot-starter</artifactId>
+		  <version>2.5.4</version>
+		</dependency>
+				
+		<!-- json -->
+		<dependency>
+         	<groupId>com.alibaba</groupId>
+         	<artifactId>fastjson</artifactId>
+         	<version>1.2.69</version>
+        </dependency>
+      
+		<!--mysql-->
+		<dependency>
+		   <groupId>mysql</groupId>
+		   <artifactId>mysql-connector-java</artifactId>
+		   <version>5.1.47</version>
+		   <scope>runtime</scope>
+		</dependency>
+		<!--  sqlserver-->
+		<dependency>
+		    <groupId>com.microsoft.sqlserver</groupId>
+		    <artifactId>sqljdbc4</artifactId>
+		    <version>4.0</version>
+		    <scope>runtime</scope>
+		</dependency>
+		<!-- oracle驱动 -->
+		<dependency>
+		    <groupId>com.oracle</groupId>
+		    <artifactId>ojdbc6</artifactId>
+		    <version>11.2.0.3</version>
+			<scope>runtime</scope>
+		</dependency>
+		
+		 <!-- Quartz定时任务 -->
+        <dependency>
+            <groupId>org.springframework.boot</groupId>
+            <artifactId>spring-boot-starter-quartz</artifactId>
+        </dependency>
+        
+		<!--JWT-->
+		<dependency>
+			<groupId>com.auth0</groupId>
+			<artifactId>java-jwt</artifactId>
+			<version>3.7.0</version>
+		</dependency>
+		
+		<!--shiro-->
+		<dependency>
+		    <groupId>org.apache.shiro</groupId>
+		    <artifactId>shiro-spring-boot-starter</artifactId>
+		    <version>1.4.0</version>
+		</dependency>
+		
+		<!-- Swagger API文档 -->
+        <dependency>
+		    <groupId>io.springfox</groupId>
+		    <artifactId>springfox-swagger2</artifactId>
+		    <version>2.9.2</version>
+		</dependency>
+		<dependency>
+		    <groupId>io.springfox</groupId>
+		    <artifactId>springfox-swagger-ui</artifactId>
+		    <version>2.9.2</version>
+		</dependency>
+		<dependency>
+			<groupId>com.github.xiaoymin</groupId>
+			<artifactId>swagger-bootstrap-ui</artifactId>
+			<version>1.9.3</version>
+		</dependency>
+		<dependency>
+			<groupId>io.springfox</groupId>
+			<artifactId>springfox-bean-validators</artifactId>
+			<version>2.9.2</version>
+		</dependency>
+		<!-- # 增加两个配置解决 NumberFormatException -->
+		<dependency>
+			<groupId>io.swagger</groupId>
+			<artifactId>swagger-annotations</artifactId>
+			<version>1.5.22</version>
+		</dependency>
+		<dependency>
+			<groupId>io.swagger</groupId>
+			<artifactId>swagger-models</artifactId>
+			<version>1.5.22</version>
+		</dependency>
+		
+		
+		<!-- Redis -->
+		<dependency>
+			 <groupId>org.springframework.boot</groupId>
+			  <artifactId>spring-boot-starter-data-redis</artifactId>
+		</dependency>
+		<dependency>
+            <groupId>org.apache.commons</groupId>
+            <artifactId>commons-pool2</artifactId>
+        </dependency>
+        
+		<!-- 代码生成器 -->
+		<!-- 如果下载失败,看这个链接http://jeecg-boot.mydoc.io/?t=345672 -->
+		<dependency>
+			<groupId>org.jeecgframework.boot</groupId>
+			<artifactId>codegenerate</artifactId>
+			<version>1.0.5</version>
+		</dependency>
+		
+        <!-- AutoPoi Excel工具类-->
+		<dependency>
+			<groupId>org.jeecgframework</groupId>
+			<artifactId>autopoi-web</artifactId>
+			<version>1.0.3</version>
+			<exclusions>
+				<exclusion>
+					<groupId>commons-codec</groupId>
+					<artifactId>commons-codec</artifactId>
+				</exclusion>
+			</exclusions>
+		</dependency>
+		
+		<dependency>
+		    <groupId>cn.hutool</groupId>
+		    <artifactId>hutool-all</artifactId>
+		    <version>4.5.11</version>
+		</dependency>
+		
+		<!-- 阿里云短信 -->
+		<dependency>
+			<groupId>com.aliyun</groupId>
+			<artifactId>aliyun-java-sdk-dysmsapi</artifactId>
+			<version>${aliyun-java-sdk-dysmsapi.version}</version>
+		</dependency>
+		<dependency>
+			<groupId>com.aliyun</groupId>
+			<artifactId>aliyun-java-sdk-core</artifactId>
+			<version>${aliyun-java-sdk-core.version}</version>
+		</dependency>
+		
+		<!--HttpClient-->
+		<dependency>
+			<groupId>org.apache.httpcomponents</groupId>
+			<artifactId>httpclient</artifactId>
+			<version>4.5.3</version>
+		</dependency>
+		
+		<!-- websocket -->
+		<dependency>
+		   <groupId>org.springframework.boot</groupId>
+		   <artifactId>spring-boot-starter-websocket</artifactId>
+		</dependency>
+
+		<!--阿里云图片服务-->
+		<dependency>
+			<groupId>com.aliyun.oss</groupId>
+			<artifactId>aliyun-sdk-oss</artifactId>
+			<version>2.6.0</version>
+		</dependency>
+
+		<dependency>
+			<groupId>com.squareup.okhttp3</groupId>
+			<artifactId>okhttp</artifactId>
+			<version>${okhttp-version}</version>
+		</dependency>
+
+		<!-- 配置文件处理器,会提示 -->
+		<dependency>
+			<groupId>org.springframework.boot</groupId>
+			<artifactId>spring-boot-configuration-processor</artifactId>
+			<optional>true</optional>
+		</dependency>
+		
+	</dependencies>
+
+	<dependencyManagement>
+		<dependencies>
+			<!-- happy-boot-base-common -->
+			<dependency>
+	    		<groupId>org.jeecgframework.boot</groupId>
+	    		<artifactId>happy-boot-base-common</artifactId>
+	    		<version>${happyboot.common.version}</version>
+	    	</dependency>
+		</dependencies>
+	</dependencyManagement>
+	<build>
+		<plugins>
+			<!--<plugin>
+				<groupId>org.springframework.boot</groupId>
+				<artifactId>spring-boot-maven-plugin</artifactId>
+			</plugin>
+			 指定JDK编译版本 -->
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-compiler-plugin</artifactId>
+                <configuration>
+                    <source>1.8</source>
+                    <target>1.8</target>
+                    <encoding>UTF-8</encoding>
+                </configuration>
+            </plugin>
+            <!-- 打包跳过测试 -->
+            <plugin>
+		        <groupId>org.apache.maven.plugins</groupId>
+		        <artifactId>maven-surefire-plugin</artifactId>
+		        <configuration>
+		          <skipTests>true</skipTests>
+		        </configuration>
+	        </plugin>
+	         <!-- 避免font文件的二进制文件格式压缩破坏 -->
+	         <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-resources-plugin</artifactId>
+                <configuration>
+                    <nonFilteredFileExtensions>
+                        <nonFilteredFileExtension>woff</nonFilteredFileExtension>
+                        <nonFilteredFileExtension>woff2</nonFilteredFileExtension>
+                        <nonFilteredFileExtension>eot</nonFilteredFileExtension>
+                        <nonFilteredFileExtension>ttf</nonFilteredFileExtension>
+                        <nonFilteredFileExtension>svg</nonFilteredFileExtension>
+                    </nonFilteredFileExtensions>
+                </configuration>
+            </plugin>
+		</plugins>
+		<resources>
+			<resource>
+                <directory>src/main/resources</directory>
+                <filtering>true</filtering>
+            </resource>
+			<resource>
+				<directory>src/main/java</directory>
+				<includes>
+					<include>**/*.xml</include>
+					<include>**/*.json</include>
+					<include>**/*.ftl</include>
+				</includes>
+			</resource>
+		</resources>
+	</build>
 </project>