陈士柏 před 3 roky
rodič
revize
ec9d26177d
32 změnil soubory, kde provedl 3287 přidání a 0 odebrání
  1. 31 0
      CharacterEncodingFilter.java
  2. 98 0
      ConstDefault.java
  3. 65 0
      CreateSign1.java
  4. 250 0
      DBtoExcel.java
  5. 120 0
      Digests.java
  6. 8 0
      Fmap.java
  7. 8 0
      Hmap.java
  8. 342 0
      HttpRequestUtils.java
  9. 200 0
      HttpUtils.java
  10. 494 0
      HttpsClient.java
  11. 52 0
      LoginFilter.java
  12. 2 0
      MANIFEST.MF
  13. 49 0
      MD5Utils.java
  14. 23 0
      MyX509TrustManager.java
  15. 53 0
      ResUtil.java
  16. 52 0
      ResponseUtil.java
  17. 86 0
      ResultStatusCode.java
  18. 103 0
      ResultUtil.java
  19. 124 0
      SHA.java
  20. 42 0
      SHA1.java
  21. 61 0
      SSLSocketClientUtil.java
  22. 8 0
      Smap.java
  23. 211 0
      TimeExchange.java
  24. 21 0
      TokenUtil.java
  25. 53 0
      WxConfig.java
  26. 53 0
      WxConstants.java
  27. 381 0
      WxUtil.java
  28. 103 0
      applicationContext.xml
  29. 122 0
      loginAction.java
  30. 27 0
      struts.xml
  31. 35 0
      test2.java
  32. 10 0
      zc.properties

+ 31 - 0
CharacterEncodingFilter.java

@@ -0,0 +1,31 @@
+//
+// Source code recreated from a .class file by IntelliJ IDEA
+// (powered by Fernflower decompiler)
+//
+
+package com.happy.filter;
+
+import java.io.IOException;
+import javax.servlet.Filter;
+import javax.servlet.FilterChain;
+import javax.servlet.FilterConfig;
+import javax.servlet.ServletException;
+import javax.servlet.ServletRequest;
+import javax.servlet.ServletResponse;
+
+public class CharacterEncodingFilter implements Filter {
+	public CharacterEncodingFilter() {
+	}
+
+	public void destroy() {
+	}
+
+	public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException, ServletException {
+		request.setCharacterEncoding("utf-8");
+		response.setCharacterEncoding("utf-8");
+		chain.doFilter(request, response);
+	}
+
+	public void init(FilterConfig arg0) throws ServletException {
+	}
+}

+ 98 - 0
ConstDefault.java

@@ -0,0 +1,98 @@
+package com.happy.constant;
+
+import org.apache.http.client.HttpClient;
+
+import java.text.SimpleDateFormat;
+
+/**
+ * lockcslock
+ *
+ * @author yp
+ */
+public final class ConstDefault {
+
+    public static final String DATETIMES_FORMAT_STRING = "yyyy-MM-dd HH:mm:ss";
+    public static final String DATE_FORMAT_STRING = "yyyy-MM-dd";
+    public static final String TIMES_FORMAT_STRING = "HH:mm:ss";
+
+    public static final SimpleDateFormat DATETIMES_FORMAT = new SimpleDateFormat(DATETIMES_FORMAT_STRING);
+    public static final SimpleDateFormat DATE_FORMAT = new SimpleDateFormat(DATE_FORMAT_STRING);
+    public static final SimpleDateFormat TIMES_FORMAT = new SimpleDateFormat(TIMES_FORMAT_STRING);
+
+    public final static class USERROLE {
+        public final static int NORMMAL = 4;
+        public final static int SYSTEMADMIN = 1;
+        public final static int DEVICEADMIN = 2;
+    }
+
+    public final static class THIRDTYPE {
+
+        public final static int WEIXINPUBLIC = 1;
+        public final static int WEIXIN_MINI = 2;
+        public final static int WEIXIN_OPEN = 3;
+
+    }
+
+    public final static int ANONYMOUSID = -1;
+    public final static int DEFAULTORG = 1;
+    public final static int DEFAULTROLEPERMISSON = 0;
+    public final static int SOUND_KEY = 1;
+
+    //密码得前缀字符串
+    public static String FTSTR = "PARTYDUES";
+    //密码得后缀字符串
+    public static String BGSTR = "LYKJ";
+
+    //微信登录的token
+    public static String WXID = "wx";
+
+    public static String WXPASSWORD = "partydues";
+
+    public enum SignType {
+        MD5, HMACSHA256
+    }
+
+    public static final String DOMAIN_API = "api.mch.weixin.qq.com";
+    public static final String DOMAIN_API2 = "api2.mch.weixin.qq.com";
+    public static final String DOMAIN_APIHK = "apihk.mch.weixin.qq.com";
+    public static final String DOMAIN_APIUS = "apius.mch.weixin.qq.com";
+
+    public static final String FAIL     = "FAIL";
+    public static final String SUCCESS  = "SUCCESS";
+    public static final String HMACSHA256 = "HMAC-SHA256";
+    public static final String MD5 = "MD5";
+
+    public static final String FIELD_SIGN = "sign";
+    public static final String FIELD_SIGN_TYPE = "sign_type";
+
+    public static final String WXPAYSDK_VERSION = "WXPaySDK/3.0.9";
+    public static final String USER_AGENT = WXPAYSDK_VERSION +
+            " (" + System.getProperty("os.arch") + " " + System.getProperty("os.name") + " " + System.getProperty("os.version") +
+            ") Java/" + System.getProperty("java.version") + " HttpClient/" + HttpClient.class.getPackage().getImplementationVersion();
+
+    public static final String MICROPAY_URL_SUFFIX     = "/pay/micropay";
+    public static final String UNIFIEDORDER_URL_SUFFIX = "/pay/unifiedorder";
+    public static final String ORDERQUERY_URL_SUFFIX   = "/pay/orderquery";
+    public static final String REVERSE_URL_SUFFIX      = "/secapi/pay/reverse";
+    public static final String CLOSEORDER_URL_SUFFIX   = "/pay/closeorder";
+    public static final String REFUND_URL_SUFFIX       = "/secapi/pay/refund";
+    public static final String REFUNDQUERY_URL_SUFFIX  = "/pay/refundquery";
+    public static final String DOWNLOADBILL_URL_SUFFIX = "/pay/downloadbill";
+    public static final String REPORT_URL_SUFFIX       = "/payitil/report";
+    public static final String SHORTURL_URL_SUFFIX     = "/tools/shorturl";
+    public static final String AUTHCODETOOPENID_URL_SUFFIX = "/tools/authcodetoopenid";
+
+    // sandbox
+    public static final String SANDBOX_MICROPAY_URL_SUFFIX     = "/sandboxnew/pay/micropay";
+    public static final String SANDBOX_UNIFIEDORDER_URL_SUFFIX = "/sandboxnew/pay/unifiedorder";
+    public static final String SANDBOX_ORDERQUERY_URL_SUFFIX   = "/sandboxnew/pay/orderquery";
+    public static final String SANDBOX_REVERSE_URL_SUFFIX      = "/sandboxnew/secapi/pay/reverse";
+    public static final String SANDBOX_CLOSEORDER_URL_SUFFIX   = "/sandboxnew/pay/closeorder";
+    public static final String SANDBOX_REFUND_URL_SUFFIX       = "/sandboxnew/secapi/pay/refund";
+    public static final String SANDBOX_REFUNDQUERY_URL_SUFFIX  = "/sandboxnew/pay/refundquery";
+    public static final String SANDBOX_DOWNLOADBILL_URL_SUFFIX = "/sandboxnew/pay/downloadbill";
+    public static final String SANDBOX_REPORT_URL_SUFFIX       = "/sandboxnew/payitil/report";
+    public static final String SANDBOX_SHORTURL_URL_SUFFIX     = "/sandboxnew/tools/shorturl";
+    public static final String SANDBOX_AUTHCODETOOPENID_URL_SUFFIX = "/sandboxnew/tools/authcodetoopenid";
+
+}

+ 65 - 0
CreateSign1.java

@@ -0,0 +1,65 @@
+package com.happy.Until;
+
+import com.alibaba.fastjson.JSONObject;
+
+import java.io.UnsupportedEncodingException;
+import java.security.MessageDigest;
+import java.security.NoSuchAlgorithmException;
+
+public class CreateSign1 {
+    private static final char hexDigits[] = { '0', '1', '2', '3', '4', '5',
+            '6', '7', '8', '9', 'a', 'b', 'c', 'd', 'e', 'f' };
+
+    public static String MD5(String s) {
+        return MD5(s,"utf-8");
+    }
+
+    public static String MD5(String s, String charset) {
+        try{
+            MessageDigest messagedigest = MessageDigest.getInstance("MD5");
+            messagedigest.reset();
+            byte abyte0[] = messagedigest.digest(s.getBytes(charset));
+            return byteToString(abyte0);
+        } catch (NoSuchAlgorithmException e) {
+            e.printStackTrace();
+        } catch (UnsupportedEncodingException e) {
+            e.printStackTrace();
+        }
+        return "";
+    }
+
+    private static String byteToString(byte abyte0[]) {
+        int i = abyte0.length;
+        char ac[] = new char[i * 2];
+        int j = 0;
+        for (int k = 0; k < i; k++) {
+            byte byte0 = abyte0[k];
+            ac[j++] = hexDigits[byte0 >>> 4 & 0xf];
+            ac[j++] = hexDigits[byte0 & 0xf];
+        }
+        return new String(ac);
+    }
+
+    public static void main(String[] args) {
+        //密钥由艾停车提供,密钥和车场号一一对应
+        String ukey = "K1DIXZCLWNO0J0WV";
+
+        JSONObject data = new JSONObject(true);
+        data.put("uid","大门入口");
+        data.put("in_time",1611731098);
+        data.put("car_number","赣AE3434");
+        data.put("c_type","临时车");
+        data.put("in_channel_id","大门入口");
+        data.put("order_id","1902");
+        data.put("force_update",1);
+        data.put("empty_plot",879);
+        data.put("car_type","");
+        data.put("source","ist");
+        data.put("pic_addr","http://ist-falcon.oss-cn-shenzhen.aliyuncs.com/order-images/31809/in/1902.jpg?Expires=1611817499&OSSAccessKeyId=LTAIQQrl6GICP0QX&Signature=FnKZNrQ5nkdJlhgVTYp4v7Q3ejY%3D");
+
+        // 生成带签名的字符串并使用MD5生成签名,然后转大写
+        String sign = data.toJSONString()+"key="+ukey;
+        sign = MD5(sign).toUpperCase();
+        System.out.println(sign);//242441AAC1911DB6E47A942A2B6477D5
+    }
+}

+ 250 - 0
DBtoExcel.java

@@ -0,0 +1,250 @@
+package com.happy.Until;
+
+import jxl.Workbook;
+import jxl.write.Label;
+import jxl.write.WritableSheet;
+import jxl.write.WritableWorkbook;
+import jxl.write.WriteException;
+import jxl.write.biff.RowsExceededException;
+
+import java.io.File;
+import java.sql.ResultSet;
+import java.util.ArrayList;
+import java.util.Vector;
+
+public class DBtoExcel {
+	/**
+	 * 导出Excel表
+	 * 
+	 * @param rs
+	 *            数据库结果集
+	 * @param filePath
+	 *            要保存的路径,文件名为 fileName.xls
+	 * @param sheetName
+	 *            工作簿名称 工作簿名称,本方法目前只支持导出一个Excel工作簿
+	 * @param columnName
+	 *            列名,类型为Vector
+	 */
+	public void WriteExcel(ResultSet rs, String filePath, String sheetName,
+			Vector columnName) {
+		WritableWorkbook workbook = null;
+		WritableSheet sheet = null;
+
+		int rowNum = 1; // 从第2行开始写入
+		try {
+			workbook = Workbook.createWorkbook(new File(filePath)); // 创建Excel文件
+			sheet = workbook.createSheet(sheetName, 0); // 创建名为 sheetName 的工作簿
+
+			this.writeCol(sheet, columnName, 0); // 首先将列名写入第一行
+
+			// 将结果集写入
+			while (rs.next()) {
+				Vector col = new Vector(); // 用以保存一行数据
+
+				for (int i = 1; i <= columnName.size(); i++) { // 将一行内容保存在col中
+					col.add(rs.getString(i));
+				}
+				// 写入Excel
+				this.writeCol(sheet, col, rowNum++);
+			}
+
+		} catch (Exception e) {
+			e.printStackTrace();
+		} finally {
+			try {
+				// 关闭
+				workbook.write();
+				workbook.close();
+				rs.close();
+			} catch (Exception e) {
+				e.printStackTrace();
+			}
+		}
+	}
+
+	public void WriteExcel2(ResultSet rs, String filePath, String sheetName,
+						   Vector columnName, String time1, String time2) {
+		WritableWorkbook workbook = null;
+		WritableSheet sheet = null;
+
+		int rowNum = 2; // 从第一行开始写入
+		try {
+			workbook = Workbook.createWorkbook(new File(filePath)); // 创建Excel文件
+			sheet = workbook.createSheet(sheetName, 0); // 创建名为 sheetName 的工作簿
+
+			this.writeCol(sheet, columnName, 1); // 首先将列名写入
+
+			// 写入时间
+			Vector col2 = new Vector(); // 用以保存一行数据
+			col2.add("统计时间-:"+time1+"到"+time2);
+			this.writeCol(sheet, col2, 0);
+			// 将结果集写入
+			while (rs.next()) {
+				Vector col = new Vector(); // 用以保存一行数据
+
+				for (int i = 1; i <= columnName.size(); i++) { // 将一行内容保存在col中
+					col.add(rs.getString(i));
+				}
+				// 写入Excel
+				this.writeCol2(sheet, col, rowNum++);
+			}
+
+		} catch (Exception e) {
+			e.printStackTrace();
+		} finally {
+			try {
+				// 关闭
+				workbook.write();
+				workbook.close();
+				rs.close();
+			} catch (Exception e) {
+				e.printStackTrace();
+			}
+		}
+	}
+
+	public void WriteExcel4(ArrayList<ArrayList> aa, String filePath, String sheetName,
+							Vector columnName, String time1, String time2) {
+		WritableWorkbook workbook = null;
+		WritableSheet sheet = null;
+
+		int rowNum = 2; // 从第一行开始写入
+		try {
+			workbook = Workbook.createWorkbook(new File(filePath)); // 创建Excel文件
+			sheet = workbook.createSheet(sheetName, 0); // 创建名为 sheetName 的工作簿
+
+			this.writeCol(sheet, columnName, 1); // 首先将列名写入
+
+			// 写入时间
+			Vector col2 = new Vector(); // 用以保存一行数据
+			col2.add("统计时间-:"+time1+"到"+time2);
+			this.writeCol(sheet, col2, 0);
+			// 将结果集写入
+			for (int i=0; i<aa.size(); i++){
+				Vector col = new Vector(); // 用以保存一行数据
+
+				for (int j = 0; j < aa.get(i).size(); j++) { // 将一行内容保存在col中
+					col.add(aa.get(i).get(j));
+				}
+				// 写入Excel
+				this.writeCol2(sheet, col, rowNum++);
+			}
+
+		} catch (Exception e) {
+			e.printStackTrace();
+		} finally {
+			try {
+				// 关闭
+				workbook.write();
+				workbook.close();
+			} catch (Exception e) {
+				e.printStackTrace();
+			}
+		}
+	}
+
+	public void WriteExcel5(ArrayList<ArrayList<String>> aa, ArrayList<String> al, ArrayList<String> al2, ArrayList<String> al_1, String filePath, String sheetName,
+							Vector columnName, String time1, String time2, String place) {
+		WritableWorkbook workbook = null;
+		WritableSheet sheet = null;
+
+		int rowNum = 3; // 从第四行开始写入具体数据
+		try {
+			workbook = Workbook.createWorkbook(new File(filePath)); // 创建Excel文件
+			sheet = workbook.createSheet(sheetName, 0); // 创建名为 sheetName 的工作簿
+
+			this.writeCol(sheet, columnName, 1); // 首先第二行将列名写入
+
+			// 写入时间
+			Vector col2 = new Vector(); // 用以保存一行数据
+			col2.add("统计时间-:"+time1+"到"+time2);
+			col2.add(" ");
+			col2.add(" ");
+			col2.add(" ");
+			col2.add(" ");
+			col2.add("订单号:"+place);
+			this.writeCol(sheet, col2, 0);    // 第一行写入时间、订单号
+			// 将结果集写入
+			for (int i=0; i<aa.size(); i++){
+				Vector col = new Vector(); // 用以保存一行数据
+				for (int j = 0; j < aa.get(i).size(); j++) { // 将一行内容保存在col中
+					col.add(aa.get(i).get(j));
+				}
+				// 写入Excel
+				this.writeCol2(sheet, col, rowNum++);
+			}
+
+			Vector col3 = new Vector();
+			col3.add("-价格");
+			for (int j=0; j<al.size(); j++){
+				col3.add(al.get(j).toString());
+			}
+			this.writeCol2(sheet, col3, 2);
+
+			Vector col4 = new Vector();
+			col4.add("剩余数-");
+			for (int j=0; j<al2.size(); j++){
+				col4.add(al2.get(j).toString());
+			}
+			this.writeCol2(sheet, col4, rowNum+1);
+
+			Vector col5 = new Vector();
+			col5.add("走货数-");
+			for (int j=0; j<al_1.size(); j++){
+				col5.add(al_1.get(j).toString());
+			}
+			this.writeCol2(sheet, col5, rowNum);
+		} catch (Exception e) {
+			e.printStackTrace();
+		} finally {
+			try {
+				// 关闭
+				workbook.write();
+				workbook.close();
+			} catch (Exception e) {
+				e.printStackTrace();
+			}
+		}
+	}
+
+	/***
+	 * 将数组写入工作簿
+	 * 
+	 * @param sheet
+	 *            要写入的工作簿
+	 * @param col
+	 *            要写入的数据数组
+	 * @param rowNum
+	 *            要写入哪一行
+	 * @throws WriteException
+	 * @throws RowsExceededException
+	 */
+	private void writeCol(WritableSheet sheet, Vector col, int rowNum)
+			throws RowsExceededException, WriteException {
+		int size = col.size(); // 获取集合大小
+
+		for (int i = 0; i < size; i++) { // 写入每一列
+			Label label = new Label(i, rowNum, (String) col.get(i));
+			sheet.addCell(label);
+		}
+	}
+
+	// 处理工号和姓名的算法
+	private void writeCol2(WritableSheet sheet, Vector col, int rowNum)
+			throws RowsExceededException, WriteException {
+		int size = col.size(); // 获取集合大小
+
+		for (int i = 0; i < size; i++) { // 写入每一列
+			if(i == 0) {
+				String name1 = (String) col.get(i);
+				int n = name1.indexOf("-");
+				String name2 = name1.substring(0, n);
+				Label label = new Label(i, rowNum, name2);
+				sheet.addCell(label);
+			}else{
+				Label label = new Label(i, rowNum, (String) col.get(i));
+				sheet.addCell(label);
+			}
+		}
+	}
+}

+ 120 - 0
Digests.java

@@ -0,0 +1,120 @@
+package com.happy.common.http;
+
+import org.apache.commons.codec.binary.Hex;
+import org.apache.commons.lang3.Validate;
+
+import java.security.GeneralSecurityException;
+import java.security.MessageDigest;
+import java.security.SecureRandom;
+import java.util.Random;
+
+/**
+ * Http Digest
+ *
+ * @author 刘岩松
+ * @date 2020/6/23 9:37
+ */
+public class Digests {
+
+    private static SecureRandom random = new SecureRandom();
+    /**
+     * 加密遵循RFC2671规范 将相关参数加密生成一个MD5字符串,并返回
+     */
+    public static String http_da_calc_HA1(String username, String realm, String password,
+                                          String nonce, String nc, String cnonce, String qop,
+                                          String method, String uri, String algorithm) {
+        String HA1, HA2;
+        if ("MD5-sess".equals(algorithm)) {
+            HA1 = HA1_MD5_sess(username, realm, password, nonce, cnonce);
+        } else {
+            HA1 = HA1_MD5(username, realm, password);
+        }
+        byte[] md5Byte = md5(HA1.getBytes());
+        HA1 = new String(Hex.encodeHex(md5Byte));
+        md5Byte = md5(HA2(method, uri).getBytes());
+        HA2 = new String(Hex.encodeHex(md5Byte));
+        String original = HA1 + ":" + (nonce + ":" + nc + ":" + cnonce + ":" + qop) + ":" + HA2;
+        md5Byte = md5(original.getBytes());
+        return new String(Hex.encodeHex(md5Byte));
+    }
+
+    /**
+     * algorithm值为MD5时规则
+     */
+    private static String HA1_MD5(String username, String realm, String password) {
+        return username + ":" + realm + ":" + password;
+    }
+
+    /**
+     * algorithm值为MD5-sess时规则
+     */
+    private static String HA1_MD5_sess(String username, String realm, String password, String nonce, String cnonce) {
+        // MD5(username:realm:password):nonce:cnonce
+        String s = HA1_MD5(username, realm, password);
+        byte[] md5Byte = md5(s.getBytes());
+        String smd5 = new String(Hex.encodeHex(md5Byte));
+        return smd5 + ":" + nonce + ":" + cnonce;
+    }
+
+    private static String HA2(String method, String uri) {
+        return method + ":" + uri;
+    }
+
+    /**
+     * 对输入字符串进行md5散列.
+     */
+    public static byte[] md5(byte[] input) {
+        return digest(input, "MD5", null, 1);
+    }
+
+    /**
+     * 对字符串进行散列, 支持md5与sha1算法.
+     */
+    private static byte[] digest(byte[] input, String algorithm, byte[] salt, int iterations) {
+        try {
+            MessageDigest digest = MessageDigest.getInstance(algorithm);
+            if (salt != null) {
+                digest.update(salt);
+            }
+            byte[] result = digest.digest(input);
+            for (int i = 1; i < iterations; i++) {
+                digest.reset();
+                result = digest.digest(result);
+            }
+            return result;
+        } catch (GeneralSecurityException e) {
+            throw new RuntimeException(e);
+        }
+    }
+
+    /**
+     * 随机生成numBytes长度数组
+     * @param numBytes
+     * @return
+     */
+    public static byte[] generateSalt(int numBytes) {
+        Validate.isTrue(numBytes > 0, "numBytes argument must be a positive integer (1 or larger)", (long) numBytes);
+        byte[] bytes = new byte[numBytes];
+        random.nextBytes(bytes);
+        return bytes;
+    }
+
+    @Deprecated
+    public static String generateSalt2(int length) {
+        String val = "";
+        Random random = new Random();
+        //参数length,表示生成几位随机数
+        for (int i = 0; i < length; i++) {
+            String charOrNum = random.nextInt(2) % 2 == 0 ? "char" : "num";
+            //输出字母还是数字
+            if ("char".equalsIgnoreCase(charOrNum)) {
+                //输出是大写字母还是小写字母
+                int temp = random.nextInt(2) % 2 == 0 ? 65 : 97;
+                val += (char) (random.nextInt(26) + temp);
+            } else if ("num".equalsIgnoreCase(charOrNum)) {
+                val += String.valueOf(random.nextInt(10));
+            }
+        }
+        return val.toLowerCase();
+    }
+}

+ 8 - 0
Fmap.java

@@ -0,0 +1,8 @@
+package com.happy.Model;
+
+import java.util.HashMap;
+
+public class Fmap {
+
+    public static final HashMap<String,String> map = new HashMap<>();
+}

+ 8 - 0
Hmap.java

@@ -0,0 +1,8 @@
+package com.happy.Model;
+
+import java.util.HashMap;
+
+public class Hmap {
+
+    public static final HashMap<String,String> map = new HashMap<>();
+}

+ 342 - 0
HttpRequestUtils.java

@@ -0,0 +1,342 @@
+package com.happy.common.http;
+
+import com.alibaba.fastjson.JSONObject;
+import com.google.gson.Gson;
+import com.google.gson.reflect.TypeToken;
+import com.happy.Model.Hmap;
+import com.happy.common.wx.WxConfig;
+import com.happy.common.wx.WxConstants;
+import okhttp3.*;
+import org.apache.commons.lang3.StringUtils;
+
+import javax.net.ssl.*;
+import javax.servlet.http.HttpServletRequest;
+import java.io.BufferedReader;
+import java.io.IOException;
+import java.io.OutputStream;
+import java.net.HttpURLConnection;
+import java.net.URL;
+import java.util.Arrays;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.concurrent.TimeUnit;
+
+public class HttpRequestUtils {
+
+    static int nc = 0; //调用次数
+    private static final String GET = "GET";
+    private static final String POST = "POST";
+    private static final String PUT = "PUT";
+    private static final String DELETE = "DELETE";
+    private static Integer CONNECTION_TIMEOUT = WxConfig.connectionTimeout;
+    private static Integer READ_TIMEOUT = WxConfig.readTimeout;
+
+    public static Map sendPost3(String requestUrl, String requestMethod, String postData) throws Exception{
+        Map 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/json");
+            //设置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 = httpsUrlConnection.getHeaderFields();
+        }catch (Exception e){
+            throw new Exception();
+        }finally {
+            if (httpsUrlConnection != null) {
+                // 关闭连接
+                httpsUrlConnection.disconnect();
+            }
+        }
+        return response;
+    }
+
+    /**
+     * 向指定URL发送POST方法的请求
+     * @param
+     * @param param 请求参数,请求参数应该是 name1=value1&name2=value2 的形式。
+     * @param username 验证所需的用户名
+     * @param password 验证所需的密
+     * @param type 返回xml和json格式数据,默认xml,传入json返回json数据
+     * @return URL 所代表远程资源的响应结果
+     */
+    public static HashMap<String,String> sendPost(String requestUrl, String param, String username, String password, String type) {
+        HashMap<String,String> hmap = new HashMap<>();
+        BufferedReader in = null;
+        try {
+            Map map = sendPost3(requestUrl, "POST", "123");
+            List list = (List) map.get("WWW-Authenticate");
+            String wwwAuth = list.get(0).toString();
+            nc++;
+            String urlNameString = requestUrl + (StringUtils.isNotEmpty(param) ? "?" + param : "");
+            // 创建URL对象
+            URL url= new URL(urlNameString);
+            // 设置通用的请求属性
+            String auth = setRequestProperty(wwwAuth, url, username, password, POST, type);
+            // 支持https请求,绕过验证
+            X509TrustManager manager = SSLSocketClientUtil.getX509TrustManager();
+            OkHttpClient client = new OkHttpClient.Builder()
+                    .readTimeout(READ_TIMEOUT, TimeUnit.MILLISECONDS)
+                    .sslSocketFactory(SSLSocketClientUtil.getSocketFactory(manager), manager)// 忽略校验
+                    .hostnameVerifier(SSLSocketClientUtil.getHostnameVerifier())//忽略校验
+                    .build();
+            MediaType mediaType = MediaType.parse("text/plain");
+            RequestBody body = RequestBody.create(mediaType, "");
+            // https://172.22.42.1/API/Web/Login
+            Request request = new Request.Builder()
+                    .url("https://172.22.42.1/API/Web/Login")
+                    .method("POST", body)
+                    .addHeader("Authorization", auth)
+                    .addHeader("Cookie", "session=719217f94fac4389780af7b18535038329e2692bfff260fd30f1afd293aa1f28")
+                    .build();
+            Response response = client.newCall(request).execute();
+            Hmap.map.put("token", response.header("X-csrftoken"));
+            Hmap.map.put("cookie", response.header("Set-Cookie"));
+            nc = 0;
+            response.close();
+        } catch (Exception e) {
+            nc = 0;
+            throw new RuntimeException(e);
+        } finally {
+            try {
+                if (in != null) {
+                    in.close();
+                }
+            } catch (Exception e2) {
+                e2.printStackTrace();
+            }
+        }
+        return hmap;
+    }
+
+    public static String sendPost2(String requestUrl, String token, String cookie) {
+        StringBuilder result = new StringBuilder();
+        BufferedReader in = null;
+        try {
+            // 支持https请求,绕过验证
+            X509TrustManager manager = SSLSocketClientUtil.getX509TrustManager();
+            OkHttpClient client = new OkHttpClient.Builder()
+                    .sslSocketFactory(SSLSocketClientUtil.getSocketFactory(manager), manager)// 忽略校验
+                    .hostnameVerifier(SSLSocketClientUtil.getHostnameVerifier())//忽略校验
+                    .build();
+            MediaType mediaType = MediaType.parse("application/json; charset=utf-8");
+            RequestBody body = RequestBody.create(mediaType, "");
+            Request request = new Request.Builder()
+                    .url(requestUrl)
+                    .method("POST", body)
+                    .addHeader("X-csrftoken", token)
+                    .addHeader("Cookie", cookie)
+                    .build();
+            Response response = client.newCall(request).execute();
+            result.append(response.body().string());
+            nc = 0;
+            response.close();
+        } catch (Exception e) {
+            nc = 0;
+            throw new RuntimeException(e);
+        } finally {
+            try {
+                if (in != null) {
+                    in.close();
+                }
+            } catch (Exception e2) {
+                e2.printStackTrace();
+            }
+        }
+        return result.toString();
+    }
+
+    public static String sendPost4(String requestUrl, String token, String cookie,JSONObject data) {
+        StringBuilder result = new StringBuilder();
+        BufferedReader in = null;
+        try {
+            // 支持https请求,绕过验证
+            X509TrustManager manager = SSLSocketClientUtil.getX509TrustManager();
+            OkHttpClient client = new OkHttpClient.Builder()
+                    .sslSocketFactory(SSLSocketClientUtil.getSocketFactory(manager), manager)// 忽略校验
+                    .hostnameVerifier(SSLSocketClientUtil.getHostnameVerifier())//忽略校验
+                    .build();
+            MediaType mediaType = MediaType.parse("application/json; charset=utf-8");
+            RequestBody body = RequestBody.create(mediaType, String.valueOf(data));
+            Request request = new Request.Builder()
+                    .url(requestUrl)
+                    .method("POST", body)
+                    .addHeader("X-csrftoken", token)
+                    .addHeader("Cookie", cookie)
+                    .build();
+            Response response = client.newCall(request).execute();
+            result.append(response.body().string());
+            nc = 0;
+            response.close();
+        } catch (Exception e) {
+            nc = 0;
+            throw new RuntimeException(e);
+        } finally {
+            try {
+                if (in != null) {
+                    in.close();
+                }
+            } catch (Exception e2) {
+                e2.printStackTrace();
+            }
+        }
+        return result.toString();
+    }
+
+    /**
+     * 生成授权信息
+     * @param authorization 上一次调用返回401的WWW-Authenticate数据
+     * @param username 用户名
+     * @param password 密码
+     * @return 授权后的数据, 应放在http头的Authorization里
+     * @throws IOException 异常
+     */
+    private static String getAuthorization(String authorization, String uri, String username, String password, String method) throws IOException {
+        uri = StringUtils.isEmpty(uri) ? "/" : uri;
+        // String temp = authorization.replaceFirst("Digest", "").trim();
+        String temp = authorization.replaceFirst("Digest", "").trim().replace("MD5", "\"MD5\"");
+        // String json = "{\"" + temp.replaceAll("=", "\":").replaceAll(",", ",\"") + "}";
+        String json = withdrawJson(authorization);
+        // String json = "{ \"realm\": \"Wowza\", \" domain\": \"/\", \" nonce\": \"MTU1NzgxMTU1NzQ4MDo2NzI3MWYxZTZkYjBiMjQ2ZGRjYTQ3ZjNiOTM2YjJjZA==\", \" algorithm\": \"MD5\", \" qop\": \"auth\" }";
+        JSONObject jsonObject = JSONObject.parseObject(json);
+        // String cnonce = new String(Hex.encodeHex(com.lys.util.Digests.generateSalt(8))); //客户端随机数
+        String cnonce = "247fe9fd623c1c42";
+        String ncstr = ("00000000" + nc).substring(Integer.toString(nc).length()); //认证的次数,第一次是1,第二次是2...
+        // String algorithm = jsonObject.getString("algorithm");
+        String algorithm = jsonObject.getString("algorithm");
+        String qop = jsonObject.getString("qop");
+        String nonce = jsonObject.getString("nonce");
+        String realm = jsonObject.getString("realm");
+        String response = SHA.http_da_calc_HA1(username, realm, password,
+                nonce, ncstr, cnonce, qop,
+                method, uri, algorithm);
+        //组成响应authorization
+        authorization = "Digest username=\"" + username + "\"";
+        authorization += ",realm=\"" + realm
+                + "\",nonce=\"" + nonce
+                + "\",uri=\"" + uri
+                + "\",algorithm=\"" + algorithm
+                + "\",qop=\"" + qop
+                + "\",nc=\"" + ncstr
+                + "\",cnonce=\"" + cnonce
+                + "\",response=\"" + response + "\"";
+        return authorization;
+    }
+
+    /**
+     * 将返回的Authrization信息转成json
+     * @param authorization authorization info
+     * @return 返回authrization json格式数据 如:String json = "{ \"realm\": \"Wowza\", \" domain\": \"/\", \" nonce\": \"MTU1NzgxMTU1NzQ4MDo2NzI3MWYxZTZkYjBiMjQ2ZGRjYTQ3ZjNiOTM2YjJjZA==\", \" algorithm\": \"MD5\", \" qop\": \"auth\" }";
+     */
+    private static String withdrawJson(String authorization) {
+        String temp = authorization.replaceFirst("Digest", "").trim().replaceAll("\"", "");
+        // String noncetemp = temp.substring(temp.indexOf("nonce="), temp.indexOf("uri="));
+        // String json = "{\"" + temp.replaceAll("=", "\":").replaceAll(",", ",\"") + "}";
+        String[] split = temp.split(",");
+        Map map = new HashMap<>();
+        Arrays.asList(split).forEach(c -> {
+            String c1 = c.replaceFirst("=", ":");
+            String[] split1 = c1.split(":");
+            map.put(split1[0].trim(), split1[1].trim());
+        });
+        return JSONObject.toJSONString(map);
+    }
+
+
+    /**
+     * HTTP set request property
+     * @param wwwAuth 授权auth
+     * @param realUrl 实际url
+     * @param username 验证所需的用户名
+     * @param password 验证所需的密码
+     * @param method 请求方式
+     * @param type 返回xml和json格式数据,默认xml,传入json返回json数据
+     */
+    private static String setRequestProperty(String wwwAuth, URL realUrl, String username, String password, String method, String type)
+            throws IOException {
+        //授权信息
+        return getAuthorization(wwwAuth, realUrl.getPath(), username, password, method);
+    }
+
+    /**
+     * 格式化请求返回信息,支持json和xml格式
+     * @param connection HttpConnection
+     * @param type 指定返回数据格式,json、xml,默认xml
+     * @return 返回数据
+     */
+    private static String formatResultInfo(HttpURLConnection connection, String type) throws IOException {
+        String result = "";
+        if ("json".equals(type)) {
+            result = String.format("{\"errCode\":%s, \"message\":%s}", connection.getResponseCode(), connection.getResponseMessage());
+        } else {
+            result = String.format(" <?xml version=\"1.0\" encoding=\"UTF-8\" ?> "
+                    + " "
+                    + " %d"
+                    + " %s"
+                    + " ", connection.getResponseCode(), connection.getResponseMessage());
+        }
+        return result;
+    }
+
+
+    public static void main(String[] args) {
+
+    }
+
+}

+ 200 - 0
HttpUtils.java

@@ -0,0 +1,200 @@
+package com.happy.Until;
+
+import com.google.gson.Gson;
+import com.google.gson.reflect.TypeToken;
+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.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.BufferedReader;
+import java.io.IOException;
+import java.io.InputStreamReader;
+import java.net.HttpURLConnection;
+import java.net.URL;
+import java.text.SimpleDateFormat;
+import java.util.*;
+
+/**
+ * http post 提交 和 get请求
+ * 
+ * @author QT-666
+ * 
+ */
+public class HttpUtils {
+	private static RequestConfig requestConfig = RequestConfig.custom()
+			.setSocketTimeout(15000).setConnectTimeout(15000)
+			.setConnectionRequestTimeout(15000).build();
+
+	public static String get(String url, Map<String, String> params) {
+		CloseableHttpClient httpClient = null;
+		HttpGet httpGet = null;
+		String re = "";
+		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();
+			re = 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 re;
+	}
+
+	/**
+	 * 发送http post请求
+	 * 
+	 * @param
+	 *
+	 * @param
+	 *
+	 */
+	public static String post(String url, Map<String, String> params) throws IOException {
+		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 httpPost
+	 * @return
+	 */
+	public static String post(String url, String body) throws Exception {
+		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 new String(str.getBytes("iso-8859-1"));
+	}
+
+
+
+	public static String get(String strURL) throws Exception {
+		URL url = new URL(strURL);
+		HttpURLConnection httpConn = (HttpURLConnection) url.openConnection();
+		httpConn.setRequestMethod("GET");
+		httpConn.connect();
+
+		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();
+	}
+
+	public static void main(String[] args) throws Exception {
+		SimpleDateFormat df = new SimpleDateFormat("yyyyMMddHHmmss");// 设置日期格式
+		String time = df.format(new Date());
+		Map<String, String> req = new HashMap<>();
+		req.put("operator_id", "000000002");
+		req.put("operator_secret", "SBC88d0ItR3w6oCTY");
+		req.put("data_secret", "Epc3hhs0imtVhPSu");
+		req.put("data_secret_iv", "r57m1sr8Tg2E302L");
+		req.put("sign_key", "ikAhygeGCRnEdhjgBKf");
+		req.put("timeStamp", time);
+		req.put("seq", "0001");
+		String msg = post("http://183.129.139.222:10022/ems-share-api/queryToken", req);
+		System.out.println("aaa: "+msg);
+	}
+}

+ 494 - 0
HttpsClient.java

@@ -0,0 +1,494 @@
+package com.happy.common.http;
+
+import com.alibaba.fastjson.JSONObject;
+import com.google.gson.Gson;
+import com.google.gson.reflect.TypeToken;
+import com.happy.Until.CreateSign1;
+import com.happy.Until.TimeExchange;
+import com.happy.common.wx.WxConfig;
+import com.happy.common.wx.WxConstants;
+import com.happy.common.wx.WxUtil;
+import okhttp3.*;
+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.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.*;
+import java.io.*;
+import java.net.HttpURLConnection;
+import java.net.URL;
+import java.net.URLConnection;
+import java.text.SimpleDateFormat;
+import java.util.*;
+import java.util.concurrent.TimeUnit;
+
+/**
+ * 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 void get(String url, Map<String, String> params){
+        CloseableHttpClient httpClient = null;
+        HttpGet httpGet = null;
+        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();
+            System.out.println(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();
+            }
+        }
+    }
+
+    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 void post(String url, Map<String, String> params){
+        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);
+            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();
+            System.out.println(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();
+            }
+        }
+    }
+
+    //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;
+    }
+
+    public static String sendJson3(String requestUrl, String token) throws Exception{
+        HttpsURLConnection httpsUrlConnection = null;
+        String result = "";
+        InputStream is = 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("Accept", "application/json");
+            // 设置发送数据的格式
+            httpsUrlConnection.setRequestProperty("Content-Type", "application/json");
+            httpsUrlConnection.setRequestProperty("X-csrftoken", token);
+            //设置可接受信息
+            httpsUrlConnection.setDoOutput(true);
+            //设置可输入信息
+            httpsUrlConnection.setDoInput(true);
+            //不使用缓存
+            httpsUrlConnection.setUseCaches(false);
+            //设置请求方式(GET/POST)
+            httpsUrlConnection.setRequestMethod("POST");
+            //设置编码
+            httpsUrlConnection.setRequestProperty("Charsert", WxConstants.DEFAULT_CHARSET);
+            System.out.println(1111);
+            httpsUrlConnection.connect();
+            System.out.println(00000);
+            // 读取响应
+            System.out.println(httpsUrlConnection.getHeaderFields());
+        }catch (Exception e){
+            throw new Exception();
+        }finally {
+            if (httpsUrlConnection != null) {
+                // 关闭连接
+                httpsUrlConnection.disconnect();
+            }
+        }
+        return result;
+    }
+
+
+    public static void main(String[] args) throws Exception {
+        JSONObject json = new JSONObject();
+    }
+
+}

+ 52 - 0
LoginFilter.java

@@ -0,0 +1,52 @@
+////
+//// Source code recreated from a .class file by IntelliJ IDEA
+//// (powered by Fernflower decompiler)
+////
+//
+//package com.happy.filter;
+//
+//import javax.servlet.*;
+//import javax.servlet.http.HttpServletRequest;
+//import javax.servlet.http.HttpServletResponse;
+//import javax.servlet.http.HttpSession;
+//import java.io.IOException;
+//import java.util.Enumeration;
+//
+//public class LoginFilter implements Filter {
+//	Enumeration param;
+//
+//	public LoginFilter() {
+//	}
+//
+//	public void init(FilterConfig filterConfig) throws ServletException {
+//		this.param = filterConfig.getInitParameterNames();
+//	}
+//
+//	public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException, ServletException {
+//		HttpServletRequest servletRequest = (HttpServletRequest)request;
+//		HttpServletResponse servletResponse = (HttpServletResponse)response;
+//		HttpSession session = servletRequest.getSession();
+//		String path = servletRequest.getRequestURI();
+//		String isLogin = (String)session.getAttribute("isLogin");
+//		if (path.indexOf("login.jsp") <= -1 && path.indexOf("branduserbrandlist.action") <= -1 && path.indexOf("/weixin/") <= -1 && path.indexOf("/loginlogin.action") <= -1 && path.indexOf("/WxPaylog.action") <= -1 && path.indexOf("register2.jsp") <= -1 && path.indexOf("/WxPayregister2.action") <= -1) {
+//			if (isLogin != null && !"".equals(isLogin)) {
+//				chain.doFilter(request, response);
+//			} else {
+//				StringBuffer fileURL = servletRequest.getRequestURL();
+//				if (fileURL.indexOf(".css") > 0 || fileURL.indexOf(".png") > 0 || fileURL.indexOf(".jpg") > 0 || fileURL.indexOf(".bmp") > 0 || fileURL.indexOf(".gif") > 0 || fileURL.indexOf(".apk") > 0 || fileURL.indexOf(".ipa") > 0 || fileURL.indexOf(".woff") > 0 || fileURL.indexOf(".ttf") > 0 || fileURL.indexOf("image.jsp") > 0) {
+//					chain.doFilter(servletRequest, servletResponse);
+//					return;
+//				}
+//
+//				String contextPath = servletRequest.getContextPath();
+//				servletResponse.sendRedirect(contextPath + "/jsp/login.jsp");
+//			}
+//
+//		} else {
+//			chain.doFilter(servletRequest, servletResponse);
+//		}
+//	}
+//
+//	public void destroy() {
+//	}
+//}

+ 2 - 0
MANIFEST.MF

@@ -0,0 +1,2 @@
+Manifest-Version: 1.0
+

+ 49 - 0
MD5Utils.java

@@ -0,0 +1,49 @@
+package com.happy.Until;
+
+import java.security.MessageDigest;
+
+public class MD5Utils {
+
+    /***
+     * MD5加码 生成32位md5码
+     */
+    public static String toMD5(String inStr){
+        MessageDigest md5 = null;
+        try{
+            md5 = MessageDigest.getInstance("MD5");
+        }catch (Exception e){
+            System.out.println(e.toString());
+            e.printStackTrace();
+            return "";
+        }
+        char[] charArray = inStr.toCharArray();
+        byte[] byteArray = new byte[charArray.length];
+
+        for (int i = 0; i < charArray.length; i++)
+            byteArray[i] = (byte) charArray[i];
+        byte[] md5Bytes = md5.digest(byteArray);
+        StringBuffer hexValue = new StringBuffer();
+        for (int i = 0; i < md5Bytes.length; i++){
+            int val = ((int) md5Bytes[i]) & 0xff;
+            if (val < 16)
+                hexValue.append("0");
+            hexValue.append(Integer.toHexString(val));
+        }
+        return hexValue.toString();
+
+    }
+
+    /**
+     * 加密解密算法 执行一次加密,两次解密
+     */
+    public static String unlock(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;
+
+    }
+}

+ 23 - 0
MyX509TrustManager.java

@@ -0,0 +1,23 @@
+package com.happy.common.http;
+
+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;
+    }
+}

+ 53 - 0
ResUtil.java

@@ -0,0 +1,53 @@
+package com.happy.Until;
+
+import org.apache.poi.ss.usermodel.Workbook;
+
+import javax.servlet.http.HttpServletResponse;
+import java.io.OutputStream;
+import java.io.PrintWriter;
+
+public class ResUtil {
+
+	public static void write(Object o, HttpServletResponse response)
+			throws Exception {
+		response.setContentType("text/html;charset=utf-8");
+//		response.setHeader("Access-Control-Allow-Origin", "*");
+		PrintWriter out = response.getWriter();
+		out.println(o.toString());
+		out.flush();
+		out.close();
+	}
+
+	public static void write(String o, HttpServletResponse response)
+			throws Exception {
+		response.setContentType("text/html;charset=utf-8");
+		PrintWriter out = response.getWriter();
+		out.println(o.toString());
+		out.flush();
+		out.close();
+	}
+
+	public static void writeJson(HttpServletResponse respone, String result) {
+		respone.setContentType("application/json;charset=utf-8");
+		PrintWriter out;
+		try {
+			out = respone.getWriter();
+			out.print(result);
+			out.flush();
+			out.close();
+		} catch (Exception e) { 
+			// //System.out.println("Comm_Util_writeJson---->" + e);
+		}
+	}
+
+	public static void export(HttpServletResponse response, Workbook wb,
+			String fileName) throws Exception {
+		response.setHeader("Content-Disposition", "attachment;filename="
+				+ new String(fileName.getBytes("utf-8"), "iso8859-1"));
+		response.setContentType("application/ynd.ms-excel;charset=UTF-8");
+		OutputStream out = response.getOutputStream();
+		wb.write(out);
+		out.flush();
+		out.close();
+	}
+}

+ 52 - 0
ResponseUtil.java

@@ -0,0 +1,52 @@
+package com.happy.Until;
+
+import org.apache.poi.ss.usermodel.Workbook;
+
+import javax.servlet.http.HttpServletResponse;
+import java.io.OutputStream;
+import java.io.PrintWriter;
+
+public class ResponseUtil {
+
+	public static void write(Object o, HttpServletResponse response)
+			throws Exception {
+		response.setContentType("text/html;charset=utf-8");
+		PrintWriter out = response.getWriter();
+		out.println(o.toString());
+		out.flush();
+		out.close();
+	}
+
+	public static void write(String o, HttpServletResponse response)
+			throws Exception {
+		response.setContentType("text/html;charset=utf-8");
+		PrintWriter out = response.getWriter();
+		out.println(o.toString());
+		out.flush();
+		out.close();
+	}
+
+	public static void writeJson(HttpServletResponse respone, String result) {
+		respone.setContentType("application/json;charset=utf-8");
+		PrintWriter out;
+		try {
+			out = respone.getWriter();
+			out.print(result);
+			out.flush();
+			out.close();
+		} catch (Exception e) {
+			// //System.out.println("Comm_Util_writeJson---->" + e);
+		}
+	}
+
+	public static void export(HttpServletResponse response, Workbook wb,
+			String fileName) throws Exception {
+		response.setHeader("Content-Disposition", "attachment;filename="
+				+ new String(fileName.getBytes("utf-8"), "iso8859-1"));
+		response.setContentType("application/ynd.ms-excel;charset=UTF-8");
+		OutputStream out = response.getOutputStream();
+		wb.write(out);
+		out.flush();
+		out.close();
+	}
+}

+ 86 - 0
ResultStatusCode.java

@@ -0,0 +1,86 @@
+package com.happy.constant;
+
+public enum ResultStatusCode {
+	/** OKlockcslock */
+	QUIT(200, "退出成功"),
+	/** OK */
+	OK(200, "OK"),
+	/** 访问超时 */
+	TIME_OUT(130, "访问超时"),
+	/** 参数解析失败 */
+	BAD_REQUEST(400, "参数解析失败"),
+	/** 记录不存在 */
+	NOT_EXIST(404, "记录不存在"),
+	/** 不支持当前请求方法 */
+	METHOD_NOT_ALLOWED(405, "不支持当前请求方法"),
+	/** 服务器运行异常 */
+	SYSTEM_ERR(500, "服务器运行异常"),
+	/** 该用户不存在或密码错误 */
+	NOT_EXIST_USER_OR_ERROR_PWD(10000, "该用户不存在或账号密码错误"),
+	/** 该用户已登录 */
+	LOGINED_IN(10001, "该用户已登录"),
+	LOGINED_IN2(10002, "该用户不存在"),
+	LOGINED_IN3(100021, "该用户登录已失效"),
+	/** 登录异常 */
+	SHIRO_ERROR(10003, "登录异常"),
+	/** 您没有该权限 */
+	UNAUTHO_ERROR(10004, "您没有该权限"),
+	/** 请绑定手机号 */
+	BIND_PHONE(10010, "请绑定手机号"),
+	/** 上传文件异常 */
+	UPLOAD_ERROR(20000, "上传文件异常"),
+	/** 无效的验证码 */
+	INVALID_CAPTCHA(30005, "无效的验证码"),
+	/** 该用户已被冻结 */
+	USER_FROZEN(40000, "该用户已被冻结"),
+	/** 该用户未绑定微信号 */
+	USER_NOT_WX_OAUTH(40004, "该用户未进行微信授权"),
+    /** 该用户未绑定微信号 */
+	USER_NOT_BIND_WX(5000, "该用户未绑定微信号"),
+    /** 该用户成功绑定微信号 */
+    USER_BIND_WX_OK(5005, "该用户成功绑定微信号"),
+	/** 该部门已存在 */
+	DEPARTMENT_EXIT(5006, "该部门已存在"),
+	/** 该用户已存在 */
+	USER_EXIST(6000, "该用户已存在"),
+	/** 该账号已存在 */
+	USERACCOUNT_EXIST(6002, "该账号已存在"),
+	/** 缴费用户信息不存在 */
+	PARTYDUES_USER_NOEXIT(6003, "缴费用户信息不存在"),
+	/** 党费信息不存在 */
+	PARTYDUES_NOEXIT(6004, "费用信息不存在"),
+	/** 党费信息党费已支付 */
+	PARTYDUES_OK(6005, "费用已支付"),
+	/** 党费订单支付失败 */
+	PARTYDUES_ERR(6009, "费用支付失败");
+
+	private int status;
+	private String msg;
+
+	public int getStatus() {
+		return status;
+	}
+
+	public void setStatus(int status) {
+		this.status = status;
+	}
+
+	public String getMsg() {
+		return msg;
+	}
+
+	public void setMsg(String msg) {
+		this.msg = msg;
+	}
+
+	private ResultStatusCode(int code, String msg) {
+		this.status = code;
+		this.msg = msg;
+	}
+
+	@Override
+	public String toString() {
+		return "{\"status\":" + this.status + ",\"msg\":\"" + this.msg + "\",\"data\": null, \"ok\": false}";
+	}
+}
+

+ 103 - 0
ResultUtil.java

@@ -0,0 +1,103 @@
+package com.happy.Until;
+
+import com.happy.constant.ResultStatusCode;
+
+/**
+ * @author yp
+ * @date 2019/10/31 0:02
+ */
+public class ResultUtil {
+    private static final long serialVersionUID = 1L;
+    // 响应状态
+    protected Integer status = 0;
+
+    // 响应消息
+    protected String msg;
+
+    // 响应数据
+    protected Object data;
+
+    public static ResultUtil buildOK() {
+        return new ResultUtil(ResultStatusCode.OK);
+    }
+
+    public static ResultUtil buildOK(Object data) {
+        return ResultUtil.build(ResultStatusCode.OK, data);
+    }
+
+    public static ResultUtil build(ResultStatusCode rsc) {
+        return new ResultUtil(rsc.getStatus(), rsc.getMsg(), null);
+    }
+
+    public static ResultUtil build(ResultStatusCode rsc, Object data) {
+        return new ResultUtil(rsc.getStatus(), rsc.getMsg(), data);
+    }
+
+    public static ResultUtil build(Integer status, String msg, Object data) {
+        return new ResultUtil(status, msg, data);
+    }
+
+    public static ResultUtil ok(Object data) {
+        return new ResultUtil(data);
+    }
+
+    public static ResultUtil ok() {
+        return new ResultUtil(null);
+    }
+
+    public ResultUtil() {
+
+    }
+
+    public static ResultUtil build(Integer status, String msg) {
+        return new ResultUtil(status, msg, null);
+    }
+
+    public ResultUtil(Integer status, String msg, Object data) {
+        this.status = status;
+        this.msg = msg;
+        this.data = data;
+    }
+
+    public ResultUtil(Object data) {
+        this.status = 200;
+        this.msg = "OK";
+        this.data = data;
+    }
+
+    public Boolean isOK() {
+        if (null == this.status) {
+            return false;
+        }
+        return this.status == 200;
+    }
+
+    public Integer getStatus() {
+        return status;
+    }
+
+    public void setStatus(Integer status) {
+        this.status = status;
+    }
+
+    public String getMsg() {
+        return msg;
+    }
+
+    public void setMsg(String msg) {
+        this.msg = msg;
+    }
+
+    public Object getData() {
+        return data;
+    }
+
+    public void setData(Object data) {
+        this.data = data;
+    }
+
+    @Override
+    public String toString() {
+        return "ResultUtil [status=" + status + ", msg=" + msg + ", data=" + data + "]";
+    }
+}

+ 124 - 0
SHA.java

@@ -0,0 +1,124 @@
+package com.happy.common.http;
+
+import org.apache.commons.codec.binary.Hex;
+import org.apache.commons.lang3.Validate;
+
+import java.security.GeneralSecurityException;
+import java.security.MessageDigest;
+import java.security.SecureRandom;
+import java.util.Random;
+
+public class SHA {
+
+    private static SecureRandom random = new SecureRandom();
+    /**
+     * 加密遵循RFC2671规范 将相关参数加密生成一个MD5字符串,并返回
+     */
+    public static String http_da_calc_HA1(String username, String realm, String password,
+                                          String nonce, String nc, String cnonce, String qop,
+                                          String method, String uri, String algorithm) {
+        String HA1, HA2;
+        if ("SHA-256".equals(algorithm)) {
+            HA1 = HA1_MD5(username, realm, password);
+        } else {
+            HA1 = HA1_MD5_sess(username, realm, password, nonce, cnonce);
+        }
+        byte[] sha256Byte = sha256(HA1.getBytes());
+        HA1 = new String(Hex.encodeHex(sha256Byte));
+        sha256Byte = sha256(HA2(method, uri).getBytes());
+        HA2 = new String(Hex.encodeHex(sha256Byte));
+        String original = HA1 + ":" + nonce + ":" + nc + ":" + cnonce + ":" + qop + ":" + HA2;
+        sha256Byte = sha256(original.getBytes());
+        return new String(Hex.encodeHex(sha256Byte));
+    }
+
+    /**
+     * algorithm值为MD5时规则
+     */
+    private static String HA1_MD5(String username, String realm, String password) {
+        String s1 = username + ":" + realm + ":" + password;
+        return s1;
+    }
+
+    /**
+     * algorithm值为MD5-sess时规则
+     */
+    private static String HA1_MD5_sess(String username, String realm, String password, String nonce, String cnonce) {
+        // MD5(username:realm:password):nonce:cnonce
+        String s = HA1_MD5(username, realm, password);
+        byte[] md5Byte = sha256(s.getBytes());
+        String smd5 = new String(Hex.encodeHex(md5Byte));
+        return smd5 + ":" + nonce + ":" + cnonce;
+    }
+
+    private static String HA2(String method, String uri) {
+        String s2 = method + ":" + uri;
+        return s2;
+    }
+
+    /**
+     * 对输入字符串进行md5散列.
+     */
+    public static byte[] sha256(byte[] input) {
+        return digest(input, "sha-256", null, 1);
+    }
+
+    /**
+     * 对字符串进行散列, 支持md5与sha1算法.
+     */
+    private static byte[] digest(byte[] input, String algorithm, byte[] salt, int iterations) {
+        try {
+            MessageDigest digest = MessageDigest.getInstance(algorithm);
+            if (salt != null) {
+                digest.update(salt);
+            }
+            byte[] result = digest.digest(input);
+            for (int i = 1; i < iterations; i++) {
+                digest.reset();
+                result = digest.digest(result);
+            }
+            return result;
+        } catch (GeneralSecurityException e) {
+            throw new RuntimeException(e);
+        }
+    }
+
+    /**
+     * 随机生成numBytes长度数组
+     * @param numBytes
+     * @return
+     */
+    public static byte[] generateSalt(int numBytes) {
+        Validate.isTrue(numBytes > 0, "numBytes argument must be a positive integer (1 or larger)", (long) numBytes);
+        byte[] bytes = new byte[numBytes];
+        random.nextBytes(bytes);
+        return bytes;
+    }
+
+    @Deprecated
+    public static String generateSalt2(int length) {
+        String val = "";
+        Random random = new Random();
+        //参数length,表示生成几位随机数
+        for (int i = 0; i < length; i++) {
+            String charOrNum = random.nextInt(2) % 2 == 0 ? "char" : "num";
+            //输出字母还是数字
+            if ("char".equalsIgnoreCase(charOrNum)) {
+                //输出是大写字母还是小写字母
+                int temp = random.nextInt(2) % 2 == 0 ? 65 : 97;
+                val += (char) (random.nextInt(26) + temp);
+            } else if ("num".equalsIgnoreCase(charOrNum)) {
+                val += String.valueOf(random.nextInt(10));
+            }
+        }
+        return val.toLowerCase();
+    }
+
+    public static void main(String[] args) {
+        String response = http_da_calc_HA1("admin","device","Chuanghai-2021",
+                "58cacbc8f220d14fae8c8d8800c00fc4d424936c49d229872e86e7dbcd9b9a6e","00000001",
+                "247fe9fd623c1c42","auth","POST","/API/Web/Login","SHA-256");
+        System.out.println(response);
+    }
+}
+

+ 42 - 0
SHA1.java

@@ -0,0 +1,42 @@
+package com.happy.common.util;
+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);
+        }
+    }
+
+}

+ 61 - 0
SSLSocketClientUtil.java

@@ -0,0 +1,61 @@
+package com.happy.common.http;
+
+import javax.net.ssl.*;
+import java.security.KeyManagementException;
+import java.security.NoSuchAlgorithmException;
+import java.security.SecureRandom;
+import java.security.cert.CertificateException;
+import java.security.cert.X509Certificate;
+
+/**
+ * @author wcy
+ * @date 2020/3/4
+ * 为了支持okhttp 绕过验签功能
+ **/
+public class SSLSocketClientUtil {
+
+    public static SSLSocketFactory getSocketFactory(TrustManager manager) {
+        SSLSocketFactory socketFactory = null;
+        try {
+            SSLContext sslContext = SSLContext.getInstance("SSL");
+            sslContext.init(null, new TrustManager[]{manager}, new SecureRandom());
+            socketFactory = sslContext.getSocketFactory();
+        } catch (NoSuchAlgorithmException e) {
+            e.printStackTrace();
+        } catch (KeyManagementException e) {
+            e.printStackTrace();
+        }
+        return socketFactory;
+    }
+
+    public static X509TrustManager getX509TrustManager() {
+        return new 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 new X509Certificate[0];
+            }
+        };
+    }
+
+    public static HostnameVerifier getHostnameVerifier() {
+        HostnameVerifier hostnameVerifier = new HostnameVerifier() {
+            @Override
+            public boolean verify(String s, SSLSession sslSession) {
+                return true;
+            }
+        };
+        return hostnameVerifier;
+    }
+
+
+}

+ 8 - 0
Smap.java

@@ -0,0 +1,8 @@
+package com.happy.Model;
+
+import java.util.HashMap;
+
+public class Smap {
+
+    public static final HashMap<String,String> map = new HashMap<>();
+}

+ 211 - 0
TimeExchange.java

@@ -0,0 +1,211 @@
+package com.happy.Until;
+
+import org.apache.commons.lang.time.DateUtils;
+
+import java.sql.Timestamp;
+import java.text.DateFormat;
+import java.text.ParseException;
+import java.text.SimpleDateFormat;
+import java.util.Calendar;
+import java.util.Date;
+
+/**
+ * 时间转化工具 date转为时间戳 时间戳转date 互相与String的转换
+ * 所有出现的String time 格式都必须为(yyyy-MM-dd HH:mm:ss),否则出错
+ * @author 赵仁杰
+ *
+ */
+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) 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;
+    }
+
+    /**
+     * 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;
+    }
+    /**
+     * 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);
+    }
+
+    // 当前时间加5分钟
+    public static String TimeRangeI(String time) throws ParseException {
+        // 当前时间+5分钟
+        Date endTime = DateUtils.addMinutes(StringToDate(time), 300);
+        SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
+        return simpleDateFormat.format(endTime);
+    }
+
+    // 当前时间加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());
+    }
+
+    // 当前时间减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 getDate(){
+        SimpleDateFormat sp = new SimpleDateFormat("yyyy-MM-dd");
+        return sp.format(new Date());
+    }
+
+    // 获取当前时间
+    public static String getTime(){
+        SimpleDateFormat sp = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
+        return sp.format(new Date());
+    }
+
+    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());
+    }
+
+    /**
+     * 计算两个日期的时间差
+     * @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 void main(String[] args) throws ParseException {
+        String time1 = "2022-07-22 11:21:20";
+        String time2 = "2022-07-22 12:31:20";
+        System.out.println(getTimeDifference(time1,time2));
+    }
+
+}
+

+ 21 - 0
TokenUtil.java

@@ -0,0 +1,21 @@
+package com.happy.Until;
+
+import org.apache.commons.lang.StringUtils;
+
+import javax.servlet.http.HttpServletRequest;
+
+public class TokenUtil {
+    /**
+     * 获取请求的token
+     */
+    public static String getRequestToken(HttpServletRequest httpRequest) {
+
+        //从header中获取token
+        String token = httpRequest.getHeader("token");
+        //如果header中不存在token,则从参数中获取token
+        if (StringUtils.isBlank(token)) {
+            token = httpRequest.getParameter("token");
+        }
+        return token;
+    }
+}

+ 53 - 0
WxConfig.java

@@ -0,0 +1,53 @@
+package com.happy.common.wx;
+
+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
WxConstants.java

@@ -0,0 +1,53 @@
+package com.happy.common.wx;
+
+/**
+ * 微信公众号常量类
+ * @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";
+
+}

+ 381 - 0
WxUtil.java

@@ -0,0 +1,381 @@
+package com.happy.common.wx;
+
+import com.google.zxing.BarcodeFormat;
+import com.google.zxing.EncodeHintType;
+import com.google.zxing.MultiFormatWriter;
+import com.google.zxing.client.j2se.MatrixToImageWriter;
+import com.google.zxing.common.BitMatrix;
+import com.google.zxing.qrcode.decoder.ErrorCorrectionLevel;
+import com.happy.common.util.SHA1;
+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;
+	}
+
+	/**
+	 * 返回信息给微信
+	 * @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();
+	}
+
+
+}

+ 103 - 0
applicationContext.xml

@@ -0,0 +1,103 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<beans xmlns="http://www.springframework.org/schema/beans"
+       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+       xmlns:p="http://www.springframework.org/schema/p"
+       xmlns:aop="http://www.springframework.org/schema/aop"
+       xmlns:context="http://www.springframework.org/schema/context"
+       xmlns:jee="http://www.springframework.org/schema/jee"
+       xmlns:tx="http://www.springframework.org/schema/tx" xmlns:task="http://www.springframework.org/schema/task"
+       xsi:schemaLocation="http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-4.0.xsd
+        http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-4.0.xsd
+        http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-4.0.xsd
+        http://www.springframework.org/schema/jee http://www.springframework.org/schema/jee/spring-jee-4.0.xsd
+        http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-4.0.xsd http://www.springframework.org/schema/task http://www.springframework.org/schema/task/spring-task.xsd">
+
+    <!-- <context:property-placeholder location="classpath:jdbc.properties" /> -->
+    <!-- 设置需要进行Spring注解扫描的类包 -->
+    <context:component-scan base-package="com.happy" />
+
+    <!-- spring task -->
+    <task:annotation-driven executor="myExecutor" scheduler="myScheduler"/>
+    <task:executor id="myExecutor" pool-size="5"/>
+    <task:scheduler id="myScheduler" pool-size="10"/>
+
+    <!-- 自动加载构建bean
+     <context:component-scan base-package="com.happy.service" />
+     <context:component-scan base-package="com.happy.dao" />   -->
+
+    <!-- 配置数据源 -->
+    <bean id="dataSource" class="com.alibaba.druid.pool.DruidDataSource" init-method="init" destroy-method="close">
+
+        <property name="driverClassName" value="com.mysql.jdbc.Driver"></property>
+        <property name="url" value="jdbc:mysql://182.61.40.116:3306/air_manage?useCursorFetch=true&amp;autoReconnect=true&amp;useUnicode=true&amp;characterEncoding=UTF-8"></property>
+        <property name="username" value="root"></property>
+        <property name="password" value="Asd!688549"></property>
+
+        <!-- 配置获取连接等待超时的时间 -->
+        <property name="maxWait" value="60000" />
+
+        <!-- 配置间隔多久才进行一次检测,检测需要关闭的空闲连接,单位是毫秒 -->
+        <property name="timeBetweenEvictionRunsMillis" value="60000" />
+
+        <!-- 配置一个连接在池中最小生存的时间,单位是毫秒 -->
+        <property name="minEvictableIdleTimeMillis" value="300000" />
+
+        <property name="validationQuery" value="SELECT 'x'" />
+        <property name="testWhileIdle" value="true" />
+        <property name="testOnBorrow" value="false" />
+        <property name="testOnReturn" value="false" />
+
+        <!-- 打开PSCache,并且指定每个连接上PSCache的大小(Oracle使用) -->
+        <!-- <property name="poolPreparedStatements" value="true" />
+        <property name="maxPoolPreparedStatementPerConnectionSize" value="20" />   -->
+
+        <!-- 配置监控统计拦截的filters,去掉后监控界面sql无法统计 -->
+        <property name="filters" value="stat" />
+
+    </bean>
+
+
+    <!-- 配置Jdbc模板 -->
+    <bean id="namedParameterJdbcTemplate" class="org.springframework.jdbc.core.namedparam.NamedParameterJdbcTemplate" scope="prototype">
+        <constructor-arg ref="dataSource"></constructor-arg>
+    </bean>
+
+    <!-- 配置事务管理器 -->
+    <bean id="transactionManager" scope="prototype"
+          class="org.springframework.jdbc.datasource.DataSourceTransactionManager">
+        <property name="dataSource" ref="dataSource" />
+    </bean>
+
+    <!-- 配置事务通知属性 -->
+    <tx:advice id="txAdvice" transaction-manager="transactionManager" >
+        <!-- 定义事务传播属性 -->
+        <tx:attributes>
+            <tx:method name="insert*" propagation="REQUIRED"/>
+            <tx:method name="count*" propagation="REQUIRED"/>
+            <tx:method name="update*" propagation="REQUIRED"/>
+            <tx:method name="edit*" propagation="REQUIRED"/>
+            <tx:method name="save*" propagation="REQUIRED"/>
+            <tx:method name="add*" propagation="REQUIRED"/>
+            <tx:method name="new*" propagation="REQUIRED"/>
+            <tx:method name="set*" propagation="REQUIRED"/>
+            <tx:method name="remove*" propagation="REQUIRED"/>
+            <tx:method name="delete*" propagation="REQUIRED"/>
+            <tx:method name="change*" propagation="REQUIRED"/>
+
+            <tx:method name="get*" read-only="true" />
+            <tx:method name="find*" read-only="true" />
+            <tx:method name="load*" read-only="true" />
+
+            <tx:method name="*" propagation="REQUIRED" />
+        </tx:attributes>
+    </tx:advice>
+
+    <!-- 配置事务切面 -->
+    <aop:config>
+        <!-- 配置切点 -->
+        <aop:pointcut id="serviceOperation"
+                      expression="execution(* com.happy.service.*.*(..))" />
+        <aop:advisor advice-ref="txAdvice" pointcut-ref="serviceOperation" />
+    </aop:config>
+
+</beans>

+ 122 - 0
loginAction.java

@@ -0,0 +1,122 @@
+package com.happy.action;
+
+import com.alibaba.fastjson.JSONObject;
+import com.happy.Model.Fmap;
+import com.happy.Model.Hmap;
+import com.happy.Model.Smap;
+import com.happy.Until.ResUtil;
+import com.happy.Until.TimeExchange;
+import com.happy.common.http.HttpRequestUtils;
+import com.opensymphony.xwork2.ActionSupport;
+import org.apache.struts2.ServletActionContext;
+import org.apache.struts2.interceptor.ServletRequestAware;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+public class loginAction extends ActionSupport implements ServletRequestAware {
+
+    private HttpServletRequest request;
+    public HttpServletResponse response;
+
+    public HttpServletRequest getRequest() {
+        return request;
+    }
+
+    public void setRequest(HttpServletRequest request) {
+        this.request = request;
+    }
+
+    public void setServletRequest(HttpServletRequest request) {
+        this.request = request;
+    }
+
+    public HttpServletResponse getResponse() {
+        return response;
+    }
+
+    public void setResponse(HttpServletResponse response) {
+        this.response = response;
+    }
+
+    public String login() throws Exception {
+        HttpRequestUtils.sendPost("https://172.22.42.1:443/API/Web/Login","123","admin","Chuanghai-2021","json");
+        String token = Hmap.map.get("token");
+        String cookie = Hmap.map.get("cookie");
+        while (true){
+            String msg = HttpRequestUtils.sendPost2("https://172.22.42.1:443/API/Login/Heartbeat", token, cookie);
+            Thread.sleep(6000);
+            JSONObject json = JSONObject.parseObject(msg);
+            if (json.get("result")==null){
+                HttpRequestUtils.sendPost("https://172.22.42.1:443/API/Web/Login","123","admin","Chuanghai-2021","json");
+                token = Hmap.map.get("token");
+                cookie = Hmap.map.get("cookie");
+            }
+        }
+    }
+
+    public String firsts() throws Exception {
+        String token = Hmap.map.get("token");
+        String cookie = Hmap.map.get("cookie");
+        JSONObject json = new JSONObject();
+        String msg = HttpRequestUtils.sendPost2("https://172.22.42.1:443/API/Event/Check", token, cookie);
+        JSONObject jsonObject = JSONObject.parseObject(msg);
+        String datas = jsonObject.getString("data");
+        JSONObject jsonObject2 = JSONObject.parseObject(datas);
+        String reader_id = jsonObject2.getString("reader_id");
+        String sequence = jsonObject2.getString("sequence");
+        String lap_number = jsonObject2.getString("lap_number");
+        Fmap.map.put("reader_id",reader_id);
+        Fmap.map.put("sequence", sequence);
+        Fmap.map.put("lap_number", lap_number);
+        json.put("code", 200);
+        json.put("message", Fmap.map);
+        ResUtil.writeJson(ServletActionContext.getResponse(), json.toString());
+        return null;
+    }
+
+    public String seconds() throws InterruptedException {
+        while (true){
+            Thread.sleep(3000);
+            String token = Hmap.map.get("token");
+            String cookie = Hmap.map.get("cookie");
+            JSONObject data = new JSONObject();
+            data.put("reader_id",Fmap.map.get("reader_id"));
+            data.put("sequence",Fmap.map.get("sequence"));
+            data.put("lap_number",Fmap.map.get("lap_number"));
+            data.put("subscribe_ai_metadata",true);
+            data.put("subscribe_intelligence",true);
+            String msg = HttpRequestUtils.sendPost4("https://172.22.42.1:443/API/Event/Check",token,cookie,data);
+            JSONObject json2 = JSONObject.parseObject(msg);
+            String datas = json2.getString("data");
+            JSONObject json3 = JSONObject.parseObject(datas);
+            if (json3.get("reader_id")==null){
+                token = Hmap.map.get("token");
+                cookie = Hmap.map.get("cookie");
+                String msg_first = HttpRequestUtils.sendPost2("https://172.22.42.1:443/API/Event/Check", token, cookie);
+                JSONObject jsonObject = JSONObject.parseObject(msg_first);
+                String datas_first = jsonObject.getString("data");
+                JSONObject jsonObject2 = JSONObject.parseObject(datas_first);
+                String reader_id = jsonObject2.getString("reader_id");
+                String sequence = jsonObject2.getString("sequence");
+                String lap_number = jsonObject2.getString("lap_number");
+                Fmap.map.put("reader_id",reader_id);
+                Fmap.map.put("sequence", sequence);
+                Fmap.map.put("lap_number", lap_number);
+            }
+            if (json3.get("alarm_list")!=null){
+                json2.put("time", TimeExchange.getTime());
+                Smap.map.put("msg", JSONObject.toJSONString(json2));
+            }
+        }
+    }
+
+    public String query(){
+        JSONObject json = new JSONObject();
+        String msg = Smap.map.get("msg");
+        json.put("code", 200);
+        json.put("message", msg);
+        ResUtil.writeJson(ServletActionContext.getResponse(), json.toString());
+        return null;
+    }
+}

+ 27 - 0
struts.xml

@@ -0,0 +1,27 @@
+<?xml version="1.0" encoding="UTF-8"?>  
+<!DOCTYPE struts PUBLIC  
+    "-//Apache Software Foundation//DTD Struts Configuration 2.3//EN"  
+    "http://struts.apache.org/dtds/struts-2.3.dtd">
+
+<struts>
+	<constant name="struts.enable.DynamicMethodInvocation" value="true" />
+	<!-- 修改上传文件的大小 -->
+	<constant name="struts.multipart.maxSize" value="50000000"/>
+	<package name="happy" namespace="/" extends="struts-default">
+
+		<action name="data*" method = "{1}" class="com.happy.action.DataAction">
+			<result name="list">/jsp/list.jsp</result>
+		</action>
+		<action name="pro*" method = "{1}" class="com.happy.action.Propelling">
+		</action>
+		<action name="login*" method = "{1}" class="com.happy.action.loginAction">
+		</action>
+
+	</package>
+	<package name="interfaces" namespace="/interfaces" extends="struts-default">
+		<!-- 接口总调度开始 -->
+		<action name="main*" method="{1}" class="com.happy.action.MainAction">
+		</action>
+	</package>
+	
+</struts>   

+ 35 - 0
test2.java

@@ -0,0 +1,35 @@
+import java.io.File;
+import java.text.SimpleDateFormat;
+import java.util.Date;
+import java.util.Random;
+
+import javax.xml.parsers.DocumentBuilder;
+import javax.xml.parsers.DocumentBuilderFactory;
+import javax.xml.transform.Transformer;
+import javax.xml.transform.TransformerFactory;
+import javax.xml.transform.dom.DOMSource;
+import javax.xml.transform.stream.StreamResult;
+
+import com.alibaba.fastjson.JSONObject;
+import com.happy.common.http.HttpRequestUtils;
+import org.w3c.dom.Document;
+import org.w3c.dom.Element;
+import org.w3c.dom.NamedNodeMap;
+import org.w3c.dom.Node;
+
+/**
+ * 使用JAVA DOM PARSER:修改 XML 文件
+ *
+ * @author zfc
+ * @date 2017年12月7日 下午8:31:55
+ */
+public class test2 {
+    public static void main(String[] args) throws InterruptedException {
+        String token = "123";
+        while (true){
+            Thread.sleep(1000);
+            System.out.println(token);
+            token = "456";
+        }
+    }
+}

+ 10 - 0
zc.properties

@@ -0,0 +1,10 @@
+#conf.global.upload.image.dir=/usr/local/apache-tomcat-7.0.69/webapps/HappysSystem/happy/image
+conf.global.upload.image.dir=/usr/local/apache-tomcat-8.0.28/webapps/HappysSystem/happy/image
+#conf.global.upload.image.dir=D\:/apache-tomcat-8.0.28/webapps/HappysSystemhappy/image
+#conf.global.upload.image.dir=/opt/apache-tomcat-8.0.28/webapps/HappysSystem/happy/image
+#conf.global.upload.image.dir=D\:/tomcat7.0/tomcat7.0/apache-tomcat-7.0.52/webapps/CustomerServiceManager/csm/image
+#conf.global.upload.image.dir=D\:/tomcat7.0/tomcat7.0/apache-tomcat-7.0.52/webapps/HappysSystem/happy/image
+#conf.global.upload.image.dir=C\:/tomcat6/webapps/CustomerServiceManager/csm/image
+#conf.global.upload.image.dir=/home/bae/app/CustomerServiceManager/csm/image
+
+conf.global.decrypt.key=123456789012345678901234567890~!