Commit 1a4476e9 authored by 宋帮潮's avatar 宋帮潮

'sbc'

parent 3f6f81a9
...@@ -2,16 +2,15 @@ ...@@ -2,16 +2,15 @@
<classpath> <classpath>
<classpathentry kind="src" path="src"/> <classpathentry kind="src" path="src"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/> <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>
<classpathentry kind="lib" path="lib/json-lib-2.3-jdk15.jar"/>
<classpathentry kind="lib" path="lib/classes12.jar"/> <classpathentry kind="lib" path="lib/classes12.jar"/>
<classpathentry kind="lib" path="lib/commons-beanutils.jar"/> <classpathentry kind="lib" path="lib/commons-beanutils.jar"/>
<classpathentry kind="lib" path="lib/ezmorph-1.0.jar"/>
<classpathentry kind="lib" path="lib/json-lib-2.3-jdk15.jar"/>
<classpathentry kind="lib" path="lib/commons-httpclient-3.1.jar"/>
<classpathentry kind="lib" path="lib/commons-codec-1.4.jar"/> <classpathentry kind="lib" path="lib/commons-codec-1.4.jar"/>
<classpathentry kind="lib" path="lib/commons-collections.jar"/> <classpathentry kind="lib" path="lib/commons-collections.jar"/>
<classpathentry kind="lib" path="lib/commons-httpclient-3.1.jar"/>
<classpathentry kind="lib" path="lib/commons-lang.jar"/> <classpathentry kind="lib" path="lib/commons-lang.jar"/>
<classpathentry kind="lib" path="lib/commons-logging-1.1.1.jar"/> <classpathentry kind="lib" path="lib/commons-logging-1.1.1.jar"/>
<classpathentry kind="lib" path="D:/apache-tomcat-6.0.44/lib/servlet-api.jar"/> <classpathentry kind="lib" path="lib/ezmorph-1.0.jar"/>
<classpathentry kind="lib" path="E:/libs/commons-collections-3.1.jar"/> <classpathentry kind="con" path="org.eclipse.jst.server.core.container/org.eclipse.jst.server.tomcat.runtimeTarget/Apache Tomcat v7.0"/>
<classpathentry kind="output" path="bin"/> <classpathentry kind="output" path="bin"/>
</classpath> </classpath>
eclipse.preferences.version=1 eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
org.eclipse.jdt.core.compiler.codegen.methodParameters=do not generate
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6 org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6
org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
org.eclipse.jdt.core.compiler.compliance=1.6 org.eclipse.jdt.core.compiler.compliance=1.6
......
\u8D26\u53F7
appid=wx4257809fde0f5986
\u5BC6\u7801
secret=lyJAj3vUqDg2BJp4Yc2ZLq9qwCX1rOXKV8OHSTD7JqY
\u5FAE\u4FE1\u670D\u52A1\u5668\u4FDD\u5B58\u5730\u5740
weiXinSavePath=/u01/web/JUNCHUANG_WX/attachment
\u79DF\u8D41\u4FDD\u5B58\u5730\u5740
zuLinsavePath=/u01/web/JUNCHUANG_WX/attachment
\u5FAE\u4FE1\u670D\u52A1\u5668\u8BF7\u6C42\u5730\u5740
weixinserviceUrl=http://172.20.0.115:5371/junchuang_wx/WeixinServlet
file_type_code=image
\u79DF\u8D41\u8BF7\u6C42\u5730\u5740
zuLinserviceUrl=http://172.20.0.115:5371/junchuang_wx/ZuLinServlet
\ No newline at end of file
oracleDriver=oracle.jdbc.driver.OracleDriver oracleDriver=oracle.jdbc.driver.OracleDriver
url=jdbc:oracle:thin:@10.0.36.97:1521:hls url=jdbc:oracle:thin:@172.20.0.115:1521:hls
# url=jdbc:oracle:thin:@172.20.0.115:1521:hls username=jc_hls
username=hls_standard password=jc_hls
password=hls_standard \ No newline at end of file
\ No newline at end of file
package hls.plugin.weixin.common; package hls.plugin.weixin.common;
import hls.plugin.weixin.qiye.DBUtil; import hls.plugin.weixin.qiye.DBUtil;
import java.io.IOException; import java.io.IOException;
import java.io.InputStream; import java.io.InputStream;
import java.util.HashMap; import java.util.HashMap;
import java.util.Map; import java.util.Map;
import java.util.Properties; import java.util.Properties;
public class GetPropertiesValue { public class GetPropertiesValue
public Map<String, String> GetValue(){ {
Map<String, String> map=new HashMap<String, String>(); public Map<String, String> GetValue()
Properties prop = new Properties(); {
InputStream in = null; Map map = new HashMap();
in = new DBUtil().getPathName("hls/plugin/weixin/qiye/constants.properties"); Properties prop = new Properties();
try { InputStream in = null;
prop.load(in); in = new DBUtil().getPathName("hls/plugin/weixin/qiye/constants.properties");
map.put("appid", prop.getProperty("appid")); try {
map.put("secret", prop.getProperty("secret")); prop.load(in);
map.put("winXinSavePath", prop.getProperty("weiXinSavePath")); map.put("appid", prop.getProperty("appid"));
map.put("zuLinsavePath", prop.getProperty("zuLinsavePath")); map.put("secret", prop.getProperty("secret"));
map.put("weixinserviceUrl", prop.getProperty("weixinserviceUrl")); map.put("winXinSavePath", prop.getProperty("weiXinSavePath"));
map.put("zuLinserviceUrl", prop.getProperty("zuLinserviceUrl")); map.put("zuLinsavePath", prop.getProperty("zuLinsavePath"));
map.put("file_type_code", prop.getProperty("file_type_code")); map.put("weixinserviceUrl", prop.getProperty("weixinserviceUrl"));
} catch (Exception e) { map.put("zuLinserviceUrl", prop.getProperty("zuLinserviceUrl"));
e.printStackTrace(); map.put("file_type_code", prop.getProperty("file_type_code"));
} finally { } catch (Exception e) {
if (in != null) { e.printStackTrace();
try {
in.close(); if (in != null)
} catch (IOException e) { try {
e.printStackTrace(); in.close();
} } catch (IOException e1) {
} e1.printStackTrace();
} }
return map; }
} finally
{
if (in != null) {
try {
in.close();
} catch (IOException e) {
e.printStackTrace();
}
}
}
return map;
} }
}
\ No newline at end of file
package hls.plugin.weixin.common; package hls.plugin.weixin.common;
import java.io.IOException; import java.io.IOException;
import org.apache.commons.httpclient.HttpClient; import org.apache.commons.httpclient.HttpClient;
import org.apache.commons.httpclient.HttpException; import org.apache.commons.httpclient.HttpException;
import org.apache.commons.httpclient.HttpMethod; import org.apache.commons.httpclient.HttpMethod;
import org.apache.commons.httpclient.methods.GetMethod; import org.apache.commons.httpclient.methods.GetMethod;
import org.apache.commons.httpclient.methods.PostMethod; import org.apache.commons.httpclient.methods.PostMethod;
public class HttpUtil { public class HttpUtil
public static String httpRequestUrl(String requestUrl,String method){ {
HttpClient client=new HttpClient(); public static String httpRequestUrl(String requestUrl, String method)
HttpMethod httpMethod=null; {
String responseMessage=""; HttpClient client = new HttpClient();
if("GET".equals(method)){ HttpMethod httpMethod = null;
httpMethod=new GetMethod(requestUrl); String responseMessage = "";
}else{ if ("GET".equals(method))
httpMethod = new PostMethod(requestUrl); httpMethod = new GetMethod(requestUrl);
try { else {
} catch (Exception e) { httpMethod = new PostMethod(requestUrl);
e.printStackTrace(); }
}
} try
try { {
client.executeMethod(httpMethod); client.executeMethod(httpMethod);
} catch (HttpException e1) { } catch (HttpException e1) {
e1.printStackTrace(); e1.printStackTrace();
} catch (IOException e1) { } catch (IOException e1) {
e1.printStackTrace(); e1.printStackTrace();
} }
try
try { {
responseMessage = httpMethod.getResponseBodyAsString(); responseMessage = httpMethod.getResponseBodyAsString();
httpMethod.releaseConnection(); httpMethod.releaseConnection();
} catch (IOException e) { } catch (IOException e) {
e.printStackTrace(); e.printStackTrace();
} }
return responseMessage; return responseMessage;
} }
}
} \ No newline at end of file
package hls.plugin.weixin.fuwu; package hls.plugin.weixin.fuwu;
import net.sf.json.JSONException;
import net.sf.json.JSONObject;
import hls.plugin.weixin.common.GetPropertiesValue; import hls.plugin.weixin.common.GetPropertiesValue;
import hls.plugin.weixin.common.HttpUtil; import hls.plugin.weixin.common.HttpUtil;
import java.util.Map;
import net.sf.json.JSONException;
import net.sf.json.JSONObject;
public class GetOpenid { public class GetOpenid
{
public String getAccessTokenURL(String code, String appid, public static String getAccessTokenURL(String code, String appid, String secret)
String secret) { {
String mutiurl = "https://api.weixin.qq.com/sns/oauth2/access_token?appid=" String mutiurl = "https://api.weixin.qq.com/sns/oauth2/access_token?appid=" + appid + "&secret=" + secret + "&code=" + code + "&grant_type=authorization_code";
+ appid return mutiurl;
+ "&secret=" }
+ secret
+ "&code="
+ code
+ "&grant_type=authorization_code";
return mutiurl;
}
public String run(String code, String appid, String secret) { public String getPenid(String code) {
String openid = ""; String openid = "";
GetPropertiesValue gp = new GetPropertiesValue(); GetPropertiesValue gp = new GetPropertiesValue();
String requestUrl = getAccessTokenURL(code, appid, secret); String requestUrl = getAccessTokenURL(code, (String)gp.GetValue().get("appid"), (String)gp.GetValue().get("secret"));
JSONObject jsonObject = JSONObject.fromObject(HttpUtil.httpRequestUrl( JSONObject jsonObject = JSONObject.fromObject(HttpUtil.httpRequestUrl(
requestUrl, "GET")); // Http GET requestUrl, "GET"));
// ɹ
if (null != jsonObject) {
try {
openid = jsonObject.getString("openid");
} catch (JSONException e) {
openid = null;
}
}
return openid; if (jsonObject != null) {
try {
openid = jsonObject.getString("openid");
} catch (JSONException e) {
openid = null;
}
}
} return openid;
} }
}
\ No newline at end of file
package hls.plugin.weixin.fuwu; package hls.plugin.weixin.fuwu;
import hls.plugin.weixin.common.HttpUtil; import hls.plugin.weixin.common.HttpUtil;
import java.io.UnsupportedEncodingException; import java.io.UnsupportedEncodingException;
import java.net.URLEncoder; import java.net.URLEncoder;
public class ServiceUtil { public class ServiceUtil
public static String getAccessCodeURL(String appid,String redirect_uri,String state){ {
String mutiurl="https://open.weixin.qq.com/connect/oauth2/authorize?appid="+appid+"&redirect_uri="+redirect_uri+"&response_type=code&scope=snsapi_base&state="+state+"#wechat_redirect"; public static String getAccessCodeURL(String appid, String redirect_uri, String state)
return mutiurl; {
} String mutiurl = "https://open.weixin.qq.com/connect/oauth2/authorize?appid=" + appid + "&redirect_uri=" + redirect_uri + "&response_type=code&scope=snsapi_base&state=" + state + "#wechat_redirect";
/** return mutiurl;
* 手机发起请求 }
* @param redirect_uri 回调地址
* @param appid 账号 public static void getAccessCodeRuquest(String appid, String redirect_uri, String state)
* @param state 状态 {
* @return String redirect_urito = "";
*/ try {
public static void getAccessCodeRuquest(String appid,String redirect_uri,String state) { redirect_urito = URLEncoder.encode(redirect_uri, "utf-8");
String redirect_urito=""; } catch (UnsupportedEncodingException e) {
try { e.printStackTrace();
redirect_urito=URLEncoder.encode(redirect_uri,"utf-8"); }
} catch (UnsupportedEncodingException e) { String requestUrl = getAccessCodeURL(appid, redirect_urito, state);
e.printStackTrace(); HttpUtil.httpRequestUrl(requestUrl, "GET");
} }
String requestUrl=getAccessCodeURL(appid,redirect_urito,state); }
HttpUtil.httpRequestUrl(requestUrl, "GET"); // Http GET请求 \ No newline at end of file
// 如果请求成功
}
}
package hls.plugin.weixin.fuwu;
import java.io.IOException;
import java.sql.Connection;
import java.sql.Date;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.Statement;
import org.apache.commons.httpclient.HttpClient;
import org.apache.commons.httpclient.HttpException;
import org.apache.commons.httpclient.HttpMethod;
import org.apache.commons.httpclient.methods.GetMethod;
import org.apache.commons.httpclient.methods.PostMethod;
import org.apache.commons.httpclient.methods.RequestEntity;
import org.apache.commons.httpclient.methods.StringRequestEntity;
import hls.plugin.weixin.qiye.DBUtil;
import net.sf.json.JSONObject;
public class sendPostForOpenid {
private String urlTemplate = "https://api.weixin.qq.com/cgi-bin/token?grant_type=client_credential&appid={appid}&secret={secret}";
private String msgUrlTemplate = "https://api.weixin.qq.com/cgi-bin/message/custom/send?access_token={accessToken}";
private int MAX_RETRY = 3;
public String httpRequestUrl(String requestUrl, String method) throws IOException {
HttpClient client = new HttpClient();
HttpMethod httpMethod = null;
String openId = "";
if ("GET".equals(method)) {
httpMethod = new GetMethod(requestUrl);
} else {
httpMethod = new PostMethod(requestUrl);
try {
} catch (Exception e) {
e.printStackTrace();
}
}
try {
client.executeMethod(httpMethod);
openId = httpMethod.getResponseHeader("openid").getValue();
httpMethod.releaseConnection();
} catch (HttpException e1) {
e1.printStackTrace();
} catch (IOException e1) {
e1.printStackTrace();
} finally {
if (httpMethod != null) {
httpMethod.releaseConnection();
}
}
return openId;
}
public String getOpenId(String url) {
String openId = null;
String requestUrl = url;
try {
openId = httpRequestUrl(requestUrl, "GET");
} catch (IOException e) {
e.printStackTrace();
}
return openId;
}
public String replyText2OpenId(String appid,String secret,String toOpenId, String msgType, String msg) throws IllegalArgumentException {
String result = "failed";
try{
String accessToken = getAccessToken(appid,secret);
if (isNullOrEmpty(toOpenId) || isNullOrEmpty(msg) || isNullOrEmpty(msgType)) {
StringBuffer errorInfo = new StringBuffer("toOpenId:");
errorInfo.append(String.valueOf(toOpenId));
errorInfo.append("\tmsgType:");
errorInfo.append(String.valueOf(msgType));
errorInfo.append("\tmsg:");
errorInfo.append(String.valueOf(msg));
throw new IllegalArgumentException(errorInfo.toString());
}
String msgUrl = msgUrlTemplate.replace("{accessToken}", accessToken);
String jsonString = "{\"touser\":\""+toOpenId+"\",\"msgtype\":\""+msgType+"\",\"text\":{\"content\":\""+msg+"\"}}";
sendMsg(msgUrl, jsonString);
result = "success";
}catch(Exception e){
e.printStackTrace();
}
return result;
}
public String replyText2OpenIds(String appid,String secret,String[] toOpenId, String msgType) throws IllegalArgumentException {
String result = "failed";
try{
String accessToken = getAccessToken(appid,secret);
String msgUrl = msgUrlTemplate.replace("{accessToken}", accessToken);
for(int i=0; i<toOpenId.length; i++){
JSONObject jsonObject = JSONObject.fromObject(toOpenId[i]);
String openid = jsonObject.get("openid").toString();
String msg = jsonObject.get("msg").toString();
String jsonString = "{\"touser\":\""+openid+"\",\"msgtype\":\""+msgType+"\",\"text\":{\"content\":\""+msg+"\"}}";
sendMsg(msgUrl, jsonString);
}
result = "success";
}catch(Exception e){
e.printStackTrace();
}
return result;
}
private boolean isNullOrEmpty(String s) {
if (s == null || s.length() < 1) {
return true;
}
return false;
}
public String getAccessToken(String appid,String secret) throws IllegalArgumentException, Exception {
String accessToken = null;
HttpClient client = new HttpClient();
// 从数据库获取access_token
Connection connection = DBUtil.getConnection();
String sql = "select access_token from wfl_access_token where expire_date > ?";
PreparedStatement pstmt = connection.prepareStatement(sql);
pstmt.setDate(1, new Date(System.currentTimeMillis()));
ResultSet resultSet = pstmt.executeQuery();
// 如果存在,则使用数据库的access_token
if (resultSet.next()) {
accessToken = resultSet.getString(1);
} else {
// 像服务器请求
if (isNullOrEmpty(appid) || isNullOrEmpty(secret)) {
throw new IllegalArgumentException("cannot get access token");
}
String url = urlTemplate.replace("{appid}", appid).replace("{secret}", secret);
GetMethod get = new GetMethod(url);
int flag = 1;
while (flag > 0) {
int executeMethod = client.executeMethod(get);
byte[] responseBody = get.getResponseBody();
JSONObject jsonObject = JSONObject.fromObject(new String(responseBody));
Object object = jsonObject.get("access_token");
if (object == null) {
System.err.println("get token failed, try again!");
flag++;
if (flag > MAX_RETRY) {
flag = -1;
throw new Exception("get token failed max times. stopped!");
}
} else {
Object expire = jsonObject.get("expires_in");
accessToken = String.valueOf(object);
sql = "insert into wfl_access_token(access_token,expire_date,creation_date,created_by,last_update_date,last_updated_by) values('"
+accessToken
+"',sysdate+"
+String.valueOf(expire)
+"/24/60/60,sysdate,'1',sysdate,'1')";
Statement stmt = connection.createStatement();
// 保存到数据库
stmt.execute(sql);
flag = -1;
}
}
}
pstmt.close();
connection.commit();
connection.close();
return accessToken;
}
private void sendMsg(String url,String msg) throws Exception{
HttpClient client = new HttpClient();
PostMethod postMethod = new PostMethod(url);
RequestEntity requestEntity = new StringRequestEntity(msg,"text/xml","UTF-8");
postMethod.setRequestEntity(requestEntity);
int executeMethod = client.executeMethod(postMethod);
}
public static void main(String[] args) throws Exception{
sendPostForOpenid sendPostForOpenid = new sendPostForOpenid();
/*String accessToken = sendPostForOpenid.getAccessToken("wx114d72be121c0797", "f6490d5f2c58656be86fd522837db943 ");
System.out.println(accessToken);*/
String[] aStrings= new String[]{};
sendPostForOpenid.replyText2OpenIds("wx114d72be121c0797", "f6490d5f2c58656be86fd522837db943", new String[]{"{'openid':'oTZ5RwCyG8mUOgf_1bX4J9nY2L-4','msg':'345'}","{'openid':'12314-4','msg':'abc'}"}, "text");
}
}
...@@ -2,82 +2,77 @@ package hls.plugin.weixin.qiye; ...@@ -2,82 +2,77 @@ package hls.plugin.weixin.qiye;
import java.io.IOException; import java.io.IOException;
import java.io.InputStream; import java.io.InputStream;
import java.io.PrintStream;
import java.sql.Connection; import java.sql.Connection;
import java.sql.DriverManager; import java.sql.DriverManager;
import java.sql.SQLException; import java.sql.SQLException;
import java.util.Properties; import java.util.Properties;
/** public class DBUtil
* @title DBUtil {
* @Description: private static String oracleDriver;
* @Company: private static String url;
* @author jianwen_zheng private static String username;
* @date 2016-10-9 private static String password;
*/
public class DBUtil {
private static String oracleDriver; static
private static String url; {
private static String username; try
private static String password; {
get();
Class.forName(oracleDriver);
} catch (ClassNotFoundException e) {
System.out.println("..");
}
}
static { public InputStream getPathName(String pathName)
try { {
get(); return DBUtil.class.getClassLoader().getResourceAsStream(pathName);
Class.forName(oracleDriver); }
} catch (ClassNotFoundException e) {
System.out.println("驱动包不存在..");
}
}
/** private static void get() {
* Properties prop = new Properties();
*/ InputStream in = null;
public DBUtil() { try {
} in = new DBUtil().getPathName("hls/plugin/weixin/qiye/data_jdbc.properties");
prop.load(in);
oracleDriver = prop.getProperty("oracleDriver");
url = prop.getProperty("url");
username = prop.getProperty("username");
password = prop.getProperty("password");
} catch (Exception e) {
e.printStackTrace();
public InputStream getPathName(String pathName) { if (in != null)
return DBUtil.class.getClassLoader().getResourceAsStream(pathName);// "com/wx/util/data_jdbc.properties" try {
} in.close();
} catch (IOException e1) {
e1.printStackTrace();
}
}
finally
{
if (in != null)
try {
in.close();
} catch (IOException e) {
e.printStackTrace();
}
}
}
private static void get() { public static Connection getConnection()
Properties prop = new Properties(); throws SQLException
InputStream in = null; {
try { return DriverManager.getConnection(url, username, password);
in = new DBUtil().getPathName("hls/plugin/weixin/qiye/data_jdbc.properties"); }
prop.load(in); // /加载属性列表
oracleDriver = prop.getProperty("oracleDriver");
url = prop.getProperty("url");
username = prop.getProperty("username");
password = prop.getProperty("password");
} catch (Exception e) {
e.printStackTrace();
} finally {
if (in != null) {
try {
in.close();
} catch (IOException e) {
e.printStackTrace();
}
}
}
}
/** public static void main(String[] args) {
* 获取数据连接 try {
* getConnection();
* @return } catch (SQLException e) {
* @throws SQLException e.printStackTrace();
*/ }
public static Connection getConnection() throws SQLException { }
return DriverManager.getConnection(url, username, password); }
} \ No newline at end of file
public static void main(String[] args) {
try {
// DBUtil.get();
DBUtil.getConnection();
} catch (SQLException e) {
e.printStackTrace();
}
}
}
package hls.plugin.weixin.qiye; package hls.plugin.weixin.qiye;
public class Ertrt { import java.io.PrintStream;
/** public class Ertrt
* @param args {
*/ public static void main(String[] args)
public static void main(String[] args) { {
String time = (long)(Math.random() * 10000000.0D)+"";
String time=(long)(Math.random()*10000000)+""; System.out.println(time);
System.out.println(time); }
}
} \ No newline at end of file
}
package hls.plugin.weixin.qiye; package hls.plugin.weixin.qiye;
/** public class FndAtmAttachment
* @title FndAtmAttachment {
* @Description: private String source_pk_value;
* @Company: private String file_type_code;
* @author jianwen_zheng private String mime_type;
* @date 2016-10-12 private String file_name;
*/ private int file_size;
public class FndAtmAttachment { private String file_path;
private String source_pk_value; private int user_id;
private String file_type_code; private String table_name;
private String mime_type; private String table_pk_value;
private String file_name;
private int file_size; public FndAtmAttachment()
private String file_path; {
private int user_id; }
private String table_name;
private String table_pk_value; public FndAtmAttachment(String source_pk_value, String file_type_code, String mime_type, String file_name, int file_size, String file_path, int user_id, String table_name, String table_pk_value)
{
/** this.source_pk_value = source_pk_value;
* this.file_type_code = file_type_code;
*/ this.mime_type = mime_type;
public FndAtmAttachment() { this.file_name = file_name;
} this.file_size = file_size;
this.file_path = file_path;
/** this.user_id = user_id;
* @param source_pk_value this.table_name = table_name;
* @param file_type_code this.table_pk_value = table_pk_value;
* @param mime_type }
* @param file_name
* @param file_size public String getSource_pk_value() {
* @param file_path return this.source_pk_value;
* @param user_id }
* @param table_name
* @param table_pk_value public void setSource_pk_value(String source_pk_value) {
*/ this.source_pk_value = source_pk_value;
public FndAtmAttachment(String source_pk_value, String file_type_code, }
String mime_type, String file_name, int file_size,
String file_path, int user_id, String table_name, public String getFile_type_code() {
String table_pk_value) { return this.file_type_code;
super(); }
this.source_pk_value = source_pk_value;
this.file_type_code = file_type_code; public void setFile_type_code(String file_type_code) {
this.mime_type = mime_type; this.file_type_code = file_type_code;
this.file_name = file_name; }
this.file_size = file_size;
this.file_path = file_path; public String getMime_type() {
this.user_id = user_id; return this.mime_type;
this.table_name = table_name; }
this.table_pk_value = table_pk_value;
} public void setMime_type(String mime_type) {
this.mime_type = mime_type;
public String getSource_pk_value() { }
return source_pk_value;
} public String getFile_name() {
return this.file_name;
public void setSource_pk_value(String source_pk_value) { }
this.source_pk_value = source_pk_value;
} public void setFile_name(String file_name) {
this.file_name = file_name;
public String getFile_type_code() { }
return file_type_code;
} public int getFile_size() {
return this.file_size;
public void setFile_type_code(String file_type_code) { }
this.file_type_code = file_type_code;
} public void setFile_size(int file_size) {
this.file_size = file_size;
public String getMime_type() { }
return mime_type;
} public String getFile_path() {
return this.file_path;
public void setMime_type(String mime_type) { }
this.mime_type = mime_type;
} public void setFile_path(String file_path) {
this.file_path = file_path;
public String getFile_name() { }
return file_name;
} public int getUser_id() {
return this.user_id;
public void setFile_name(String file_name) { }
this.file_name = file_name;
} public void setUser_id(int user_id) {
this.user_id = user_id;
public int getFile_size() { }
return file_size;
} public String getTable_name() {
return this.table_name;
public void setFile_size(int file_size) { }
this.file_size = file_size;
} public void setTable_name(String table_name) {
this.table_name = table_name;
public String getFile_path() { }
return file_path;
} public String getTable_pk_value() {
return this.table_pk_value;
public void setFile_path(String file_path) { }
this.file_path = file_path;
} public void setTable_pk_value(String table_pk_value) {
this.table_pk_value = table_pk_value;
public int getUser_id() { }
return user_id; }
} \ No newline at end of file
public void setUser_id(int user_id) {
this.user_id = user_id;
}
public String getTable_name() {
return table_name;
}
public void setTable_name(String table_name) {
this.table_name = table_name;
}
public String getTable_pk_value() {
return table_pk_value;
}
public void setTable_pk_value(String table_pk_value) {
this.table_pk_value = table_pk_value;
}
}
package hls.plugin.weixin.qiye; package hls.plugin.weixin.qiye;
public abstract interface IWeChatDao
{
/** public abstract boolean save(FndAtmAttachment paramFndAtmAttachment);
* @title IWeChat }
* @Description: ݲҽӿ \ No newline at end of file
* @Company:
* @author jianwen_zheng
* @date 2016-10-9
*/
public interface IWeChatDao {
/**
*
* @return
*/
public boolean save(FndAtmAttachment fnd);
}
package hls.plugin.weixin.qiye; package hls.plugin.weixin.qiye;
import hls.plugin.weixin.common.GetPropertiesValue; import hls.plugin.weixin.common.GetPropertiesValue;
import hls.plugin.weixin.common.HttpUtil; import hls.plugin.weixin.common.HttpUtil;
import java.util.Map;
public class RequestToCompany
{
public static void sendMassage(String[] mediaId, String table_pk_value, String userId, String tableName, String pck_id)
{
GetPropertiesValue gp = new GetPropertiesValue();
for (int i = 0; i < mediaId.length; i++) {
String requestUrl = (String)gp.GetValue().get("weixinserviceUrl") + "?mediaId=" + mediaId[i] + "&pck_id=" + pck_id + "&userId=" + userId + "&tableName=" + tableName + "&table_pk_value=" + table_pk_value;
HttpUtil.httpRequestUrl(requestUrl, "GET");
}
}
public class RequestToCompany { public static void main(String[] args)
public static void sendMassage(String [] mediaId,String table_pk_value,String userId,String tableName,String pck_id) { {
GetPropertiesValue gp=new GetPropertiesValue(); }
for (int i = 0; i < mediaId.length; i++) { }
String requestUrl=gp.GetValue().get("weixinserviceUrl")+"?mediaId="+mediaId[i]+"&pck_id="+pck_id+"&userId="+userId+"&tableName="+tableName+"&table_pk_value="+table_pk_value; \ No newline at end of file
HttpUtil.httpRequestUrl(requestUrl, "GET"); // Http GET
}
}
public static void main(String[] args) {
// String a[]={"1qyU7RGN3LHdsMrqCw7VrTc85wY-Q5Z3pEk_VJKcU9E3Nx_ukMH7ik2Vp_43EiMa6VyEjpNwtuEQ2ILqoe7F5cA"};
}
}
package hls.plugin.weixin.qiye; package hls.plugin.weixin.qiye;
import hls.plugin.weixin.common.HttpUtil;
import hls.plugin.weixin.common.HttpUtil;
import java.io.PrintStream;
import java.util.Map; import java.util.Map;
import net.sf.json.JSONException; import net.sf.json.JSONException;
import net.sf.json.JSONObject; import net.sf.json.JSONObject;
public class WXupAndDown { public class WXupAndDown
/** {
* 获得token public static String getJSSDKAccessToken(String acceToken_urlx)
* @param acceToken_urlx 请求的url {
* @return String returnString = "";
*/ String requestUrl = acceToken_urlx;
public static String getJSSDKAccessToken(String acceToken_urlx) { JSONObject jsonObject = JSONObject.fromObject(HttpUtil.httpRequestUrl(
String returnString = ""; requestUrl, "GET"));
String requestUrl = acceToken_urlx;
JSONObject jsonObject = JSONObject.fromObject(HttpUtil.httpRequestUrl( if (jsonObject != null) {
requestUrl, "GET")); // Http GET请求 try {
// 如果请求成功 returnString = jsonObject.getString("access_token");
if (null != jsonObject) { } catch (JSONException e) {
try { returnString = null;
returnString = jsonObject.getString("access_token"); }
} catch (JSONException e) { }
returnString = null; return returnString;
} }
}
return returnString; public static String getJSSDKTicket(String access_token, String ticket_urlx)
} {
/** String returnString = "";
* 获得ticket String requestUrl = ticket_urlx.replace("ACCESS_TOKEN", access_token);
* @param access_token 上面来的token
* @param ticket_urlx ticket的请求地址 JSONObject jsonObject = JSONObject.fromObject(HttpUtil.httpRequestUrl(
* @return requestUrl, "GET"));
*/
public static String getJSSDKTicket(String access_token, String ticket_urlx) { if (jsonObject != null) {
String returnString = ""; try {
String requestUrl = ticket_urlx.replace("ACCESS_TOKEN", access_token); returnString = jsonObject.getString("ticket");
} catch (JSONException e) {
returnString = null;
}
}
return returnString;
}
public static Map<String, String> getSignture(String id, String secrect, String url)
{
String acceToken_urlx = "https://qyapi.weixin.qq.com/cgi-bin/gettoken?corpid=" + id + "&corpsecret=" + secrect;
String ticket_urlx = "https://qyapi.weixin.qq.com/cgi-bin/get_jsapi_ticket?access_token=ACCESS_TOKEN";
String js_accessToken = getJSSDKAccessToken(acceToken_urlx);
String jsapi_ticket = getJSSDKTicket(js_accessToken, ticket_urlx);
Map map = WxJSsign.sign(jsapi_ticket, url);
return map;
}
public static void main(String[] args) {
String id = "wx4257809fde0f5986";
String secrect = "iTgSpAaEYejcyPBLlyikzx6kvSVuiMBxotfAkAdWAKo6nF8cefdJSTgLXqivXpZ7";
String url = "http://cmsplus.com.cn";
JSONObject jsonObject = JSONObject.fromObject(HttpUtil.httpRequestUrl( Map map = getSignture(id, secrect, url);
requestUrl, "GET")); System.out.println("1" + (String)map.get("nonceStr"));
// 如果请求成功 System.out.println("2" + (String)map.get("timestamp"));
if (null != jsonObject) { System.out.println("3" + (String)map.get("signature"));
try { }
returnString = jsonObject.getString("ticket");
} catch (JSONException e) {
returnString = null;
}
}
return returnString;
}
/**
* 获得签名
* @param id 账号
* @param secrect 密码
* @param url 返回地址
* @return
*/
public static Map<String, String> getSignture(String id, String secrect,
String url) {
String acceToken_urlx="https://qyapi.weixin.qq.com/cgi-bin/gettoken?corpid="+id+"&corpsecret="+secrect;
String ticket_urlx="https://qyapi.weixin.qq.com/cgi-bin/get_jsapi_ticket?access_token=ACCESS_TOKEN";
String js_accessToken = WXupAndDown.getJSSDKAccessToken(acceToken_urlx); // 获取微信jssdk---access_token
String jsapi_ticket = WXupAndDown.getJSSDKTicket(js_accessToken,ticket_urlx); // 获取微信jssdk---ticket
// System.out.println("jsapi_ticket==="+jsapi_ticket);
Map<String, String> map = WxJSsign.sign(jsapi_ticket, url);
return map;
}
public static void main(String[] args) {
String id ="wx4257809fde0f5986";
String secrect="iTgSpAaEYejcyPBLlyikzx6kvSVuiMBxotfAkAdWAKo6nF8cefdJSTgLXqivXpZ7";
String url="http://cmsplus.com.cn";
Map<String, String> map = getSignture(id,secrect,url);
System.out.println("1"+map.get("nonceStr"));
System.out.println("2"+map.get("timestamp"));
System.out.println("3"+map.get("signature"));
}
} }
\ No newline at end of file
package hls.plugin.weixin.qiye; package hls.plugin.weixin.qiye;
import java.io.PrintStream;
import java.sql.CallableStatement; import java.sql.CallableStatement;
import java.sql.Connection; import java.sql.Connection;
import java.sql.SQLException; import java.sql.SQLException;
import java.sql.Types;
/** public class WeCatDaoImpl
* @title WeCatDaoImpl implements IWeChatDao
* @Description: {
* @Company: public static void main(String[] args)
* @author jianwen_zheng {
* @date 2016-10-12 FndAtmAttachment fnd = new FndAtmAttachment("1", "1", "1", "1", 1, "1", 1, "1", "1");
*/ boolean ss = new WeCatDaoImpl().save(fnd);
public class WeCatDaoImpl implements IWeChatDao { System.out.println(ss);
}
public static void main(String[] args) { public boolean save(FndAtmAttachment fnd) {
FndAtmAttachment fnd = new FndAtmAttachment("1","1","1","1",1,"1",1,"1","1"); boolean success = false;
boolean ss =new WeCatDaoImpl().save(fnd); Connection conn = null;
System.out.println(ss); CallableStatement pst = null;
} try {
conn = DBUtil.getConnection();
public boolean save(FndAtmAttachment fnd) { pst = conn
boolean success = false; .prepareCall("{ call fnd_atm_attachment_all_pkg.insert_fnd_atm_attachment(?,?,?,?,?,?,?,?,?,?) }");
Connection conn = null; pst.registerOutParameter(1, 4);
CallableStatement pst = null; pst.setString(2, fnd.getSource_pk_value());
try { pst.setString(3, fnd.getFile_type_code());
conn = DBUtil.getConnection(); pst.setString(4, fnd.getMime_type());
pst = conn. pst.setString(5, fnd.getFile_name());
prepareCall("{ call fnd_atm_attachment_all_pkg.insert_fnd_atm_attachment(?,?,?,?,?,?,?,?,?,?) }"); pst.setInt(6, fnd.getFile_size());
pst.registerOutParameter(1, Types.INTEGER); pst.setString(7, fnd.getFile_path());
pst.setString(2, fnd.getSource_pk_value()); pst.setInt(8, fnd.getUser_id());
pst.setString(3, fnd.getFile_type_code()); pst.setString(9, fnd.getTable_name());
pst.setString(4, fnd.getMime_type()); pst.setString(10, fnd.getTable_pk_value());
pst.setString(5, fnd.getFile_name()); pst.execute();
pst.setInt(6, fnd.getFile_size()); conn.commit();
pst.setString(7, fnd.getFile_path()); success = true;
pst.setInt(8, fnd.getUser_id()); } catch (SQLException e) {
pst.setString(9, fnd.getTable_name()); e.printStackTrace();
pst.setString(10, fnd.getTable_pk_value()); try
pst.execute(); {
conn.commit(); if (pst != null)
success = true; pst.close();
} catch (SQLException e) { if (conn != null)
e.printStackTrace(); conn.close();
} finally { } catch (SQLException e1) {
try { e1.printStackTrace();
if (null != pst) }
pst.close(); }
if (null != conn) finally
conn.close(); {
} catch (SQLException e) { try
e.printStackTrace(); {
} if (pst != null)
} pst.close();
return success; if (conn != null)
} conn.close();
} } catch (SQLException e) {
e.printStackTrace();
}
}
return success;
}
}
\ No newline at end of file
package hls.plugin.weixin.qiye; package hls.plugin.weixin.qiye;
import hls.plugin.weixin.common.GetPropertiesValue; import hls.plugin.weixin.common.GetPropertiesValue;
import java.io.BufferedInputStream;
import java.io.BufferedOutputStream;
import java.io.ByteArrayOutputStream; import java.io.ByteArrayOutputStream;
import java.io.File; import java.io.File;
import java.io.FileInputStream; import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException; import java.io.IOException;
import java.io.InputStream; import java.io.InputStream;
import java.io.OutputStream; import java.io.OutputStream;
import java.io.PrintStream;
import java.net.HttpURLConnection; import java.net.HttpURLConnection;
import java.net.URL; import java.net.URL;
import java.util.Map;
public class WeiImagePostTo
{
public void send(String mediaId, String pck_id, String fileName, String filetype, String fileSize, String userId, String tableName, String table_pk_value)
{
GetPropertiesValue gp = new GetPropertiesValue();
HttpURLConnection con = null;
OutputStream out = null;
InputStream in = null;
InputStream inputStream = null;
ByteArrayOutputStream baos = null;
int length = 0;
try {
File file = new File((String)gp.GetValue().get("winXinSavePath") + "/" +
fileName + "." + filetype);
if ((!file.exists()) || (!file.isFile())) {
throw new IOException("ļ");
}
String enCodemediaId = mediaId;
/*URL urlObj = new URL((String)gp.GetValue().get("zuLinserviceUrl") +
"?mediaId=" + enCodemediaId + "&pck_id=" + pck_id +
"&fileName=" + fileName + "&filetype=" + filetype +
"&fileSize=" + fileSize + "&userId=" + userId + "&tableName=" + tableName + "&table_pk_value=" + table_pk_value);
*/
int userId2 = Integer.parseInt(userId);
int file_size_int = Integer.parseInt(fileSize);
String mime_type = (String)gp.GetValue().get("file_type_code") + "/" +filetype;
String filepath =
(String)gp.GetValue()
.get("weiXinSavePath") +
"/" + fileName;
FndAtmAttachment fnd = new FndAtmAttachment(table_pk_value, filetype, mime_type, fileName, file_size_int, filepath, userId2, tableName, pck_id);
boolean ss = new WeCatDaoImpl().save(fnd);
System.out.println(ss);
public class WeiImagePostTo { /* con = (HttpURLConnection)urlObj.openConnection();
/** con.setDoOutput(true);
* 上传到微信服务器 con.setRequestProperty("Content-Length", fileSize);
* con.setRequestProperty("Content-type", "application/image");
* @param fileType con.setRequestMethod("POST");
* 文件类型
* @param filePath
* 本地上传文件路径
* @param id
* 账号
* @param secret
* 密码
* @return
* @throws Exception
*/
public void send(String mediaId, String pck_id, String fileName,String filetype, String fileSize,String userId,String tableName,String table_pk_value) { con.connect();
GetPropertiesValue gp = new GetPropertiesValue();
HttpURLConnection con = null;
OutputStream out = null;
InputStream in = null; out = con.getOutputStream();
InputStream inputStream = null; in = new FileInputStream(file);
ByteArrayOutputStream baos = null; int bytes = -1;
int length = 0; byte[] bufferOut = new byte[1024];
try { while ((bytes = in.read(bufferOut)) != -1) {
File file = new File(gp.GetValue().get("winXinSavePath") + "/" out.write(bufferOut, 0, bytes);
+ fileName + "." + filetype); }
if (!file.exists() || !file.isFile()) {
throw new IOException("文件不存在");
}
/**
* 第一部分
*/
String enCodemediaId = mediaId;
URL urlObj = new URL(gp.GetValue().get("zuLinserviceUrl")
+ "?mediaId=" + enCodemediaId + "&pck_id=" + pck_id
+ "&fileName=" + fileName + "&filetype=" + filetype
+ "&fileSize=" + fileSize+"&userId="+userId+"&tableName="+tableName+"&table_pk_value="+table_pk_value);
con = (HttpURLConnection) urlObj.openConnection(); inputStream = con.getInputStream();*/
}
// con.setDoInput(true); catch (Exception e) {
con.setDoOutput(true); System.out.println("쳣:" + e.getMessage());
con.setRequestProperty("Content-Length",fileSize);
con.setRequestProperty("Content-type", "application/image");//这句相当重要,没有回报各种错
con.setRequestMethod("POST"); // 以Post方式提交表单,默认get方式
//con.setUseCaches(false); // post方式不能使用缓存
con.connect();
// 获得输出流
out = con.getOutputStream();
in = new FileInputStream(file);
int bytes=-1;
byte[] bufferOut = new byte[1024];
while ((bytes = in.read(bufferOut)) != -1) {
out.write(bufferOut, 0, bytes);
}
inputStream = con.getInputStream();
// temp.close();
} catch (Exception e) {
System.out.println("传输异常:" + e.getMessage());
} finally {
if (in != null) {
try {
in.close();
} catch (IOException e) {
e.printStackTrace();
}
}
if (out != null) {
try {
out.flush();
out.close();
} catch (IOException e) {
e.printStackTrace();
}
}
if (con != null) {
con.disconnect();
}
if (inputStream != null) { if (in != null) {
try { try {
inputStream.close(); in.close();
} catch (IOException e) { } catch (IOException e1) {
e.printStackTrace(); e1.printStackTrace();
} }
} }
if (baos != null) { if (out != null) {
try { try {
baos.close(); out.flush();
} catch (IOException e) { out.close();
e.printStackTrace(); } catch (IOException e1) {
}// 再读取一遍 e1.printStackTrace();
} }
}
if (con != null) {
con.disconnect();
}
} if (inputStream != null) {
} try {
inputStream.close();
} catch (IOException e1) {
e1.printStackTrace();
}
}
if (baos != null)
try {
baos.close();
} catch (IOException e1) {
e1.printStackTrace();
}
}
finally
{
if (in != null) {
try {
in.close();
} catch (IOException e) {
e.printStackTrace();
}
}
if (out != null) {
try {
out.flush();
out.close();
} catch (IOException e) {
e.printStackTrace();
}
}
if (con != null) {
con.disconnect();
}
} if (inputStream != null) {
try {
inputStream.close();
} catch (IOException e) {
e.printStackTrace();
}
}
if (baos != null)
try {
baos.close();
} catch (IOException e) {
e.printStackTrace();
}
}
}
}
\ No newline at end of file
package hls.plugin.weixin.qiye; package hls.plugin.weixin.qiye;
import hls.plugin.weixin.common.HttpUtil; import hls.plugin.weixin.common.HttpUtil;
import java.io.BufferedReader; import java.io.BufferedReader;
import java.io.DataInputStream; import java.io.DataInputStream;
import java.io.DataOutputStream; import java.io.DataOutputStream;
...@@ -10,148 +9,135 @@ import java.io.FileInputStream; ...@@ -10,148 +9,135 @@ import java.io.FileInputStream;
import java.io.IOException; import java.io.IOException;
import java.io.InputStreamReader; import java.io.InputStreamReader;
import java.io.OutputStream; import java.io.OutputStream;
import java.io.PrintStream;
import java.net.HttpURLConnection; import java.net.HttpURLConnection;
import java.net.URL; import java.net.URL;
import java.util.HashMap; import java.util.HashMap;
import java.util.Map; import java.util.Map;
import net.sf.json.JSONException; import net.sf.json.JSONException;
import net.sf.json.JSONObject; import net.sf.json.JSONObject;
public class WeiImageUpload { public class WeiImageUpload
{
/** public JSONObject send(String fileType, String filePath, String id, String secret)
* 上传到微信服务器 throws Exception
* @param fileType 文件类型 {
* @param filePath 本地上传文件路径 String result = null;
* @param id 账号 File file = new File(filePath);
* @param secret 密码 if ((!file.exists()) || (!file.isFile())) {
* @return throw new IOException("文件不存在");
* @throws Exception }
*/ String token = getNowToken(id, secret);
public JSONObject send(String fileType, String filePath,String id,String secret) throws Exception { URL urlObj = new URL("https://qyapi.weixin.qq.com/cgi-bin/media/upload?access_token=" + token +
String result = null; "&type=" + fileType);
File file = new File(filePath); HttpURLConnection con = (HttpURLConnection)urlObj.openConnection();
if (!file.exists() || !file.isFile()) { con.setRequestMethod("POST");
throw new IOException("文件不存在"); con.setDoInput(true);
} con.setDoOutput(true);
String token=getNowToken(id,secret); con.setUseCaches(false);
/**
* 第一部分 con.setRequestProperty("Connection", "Keep-Alive");
*/ con.setRequestProperty("Charset", "UTF-8");
URL urlObj = new URL("https://qyapi.weixin.qq.com/cgi-bin/media/upload?access_token="+ token
+ "&type="+fileType+""); String BOUNDARY = "----------" + System.currentTimeMillis();
HttpURLConnection con = (HttpURLConnection) urlObj.openConnection(); con.setRequestProperty("Content-Type", "multipart/form-data; boundary=" + BOUNDARY);
con.setRequestMethod("POST"); // 以Post方式提交表单,默认get方式
con.setDoInput(true); StringBuilder sb = new StringBuilder();
con.setDoOutput(true); sb.append("--");
con.setUseCaches(false); // post方式不能使用缓存 sb.append(BOUNDARY);
// 设置请求头信息 sb.append("\r\n");
con.setRequestProperty("Connection", "Keep-Alive"); sb.append("Content-Disposition: form-data;name=\"media\";filename=\"" + file.getName() + "\"\r\n");
con.setRequestProperty("Charset", "UTF-8"); sb.append("Content-Type:application/octet-stream\r\n\r\n");
// 设置边界 byte[] head = sb.toString().getBytes("utf-8");
String BOUNDARY = "----------" + System.currentTimeMillis();
con.setRequestProperty("Content-Type", "multipart/form-data; boundary="+ BOUNDARY); OutputStream out = new DataOutputStream(con.getOutputStream());
// 请求正文信息
// 第一部分: out.write(head);
StringBuilder sb = new StringBuilder();
sb.append("--"); // 必须多两道线 DataInputStream in = new DataInputStream(new FileInputStream(file));
sb.append(BOUNDARY); int bytes = 0;
sb.append("\r\n"); byte[] bufferOut = new byte[1024];
sb.append("Content-Disposition: form-data;name=\"media\";filename=\""+ file.getName() + "\"\r\n"); while ((bytes = in.read(bufferOut)) != -1) {
sb.append("Content-Type:application/octet-stream\r\n\r\n"); out.write(bufferOut, 0, bytes);
byte[] head = sb.toString().getBytes("utf-8"); }
// 获得输出流 in.close();
OutputStream out = new DataOutputStream(con.getOutputStream());
// 输出表头 byte[] foot = ("\r\n--" + BOUNDARY + "--\r\n").getBytes("utf-8");
out.write(head); out.write(foot);
// 文件正文部分 out.flush();
// 把文件已流文件的方式 推入到url中 out.close();
DataInputStream in = new DataInputStream(new FileInputStream(file)); StringBuffer buffer = new StringBuffer();
int bytes = 0; BufferedReader reader = null;
byte[] bufferOut = new byte[1024]; try
while ((bytes = in.read(bufferOut)) != -1) { {
out.write(bufferOut, 0, bytes); reader = new BufferedReader(new InputStreamReader(con.getInputStream()));
} String line = null;
in.close(); while ((line = reader.readLine()) != null)
// 结尾部分 {
byte[] foot = ("\r\n--" + BOUNDARY + "--\r\n").getBytes("utf-8");// 定义最后数据分隔线 buffer.append(line);
out.write(foot); }
out.flush(); if (result == null)
out.close(); result = buffer.toString();
StringBuffer buffer = new StringBuffer(); }
BufferedReader reader = null; catch (IOException e) {
try { System.out.println("发送POST请求出现异常!" + e);
// 定义BufferedReader输入流来读取URL的响应 e.printStackTrace();
reader = new BufferedReader(new InputStreamReader(con.getInputStream())); throw new IOException("数据读取异常");
String line = null; } finally {
while ((line = reader.readLine()) != null) { if (reader != null) {
//System.out.println(line); reader.close();
buffer.append(line); }
} }
if(result==null){ JSONObject jsonObj = JSONObject.fromObject(result);
result = buffer.toString(); System.out.println("jsonObj>>>>" + jsonObj);
} return jsonObj;
} catch (IOException e) { }
System.out.println("发送POST请求出现异常!" + e);
e.printStackTrace(); public static String getNowToken(String id, String secret) {
throw new IOException("数据读取异常"); String returnString = "";
} finally { String requestUrl = getNowTokenURL(id, secret);
if(reader!=null){ JSONObject jsonObject = JSONObject.fromObject(HttpUtil.httpRequestUrl(
reader.close(); requestUrl, "GET"));
}
} if (jsonObject != null) {
JSONObject jsonObj =JSONObject.fromObject(result); try {
System.out.println("jsonObj>>>>"+jsonObj); returnString = jsonObject.getString("access_token");
return jsonObj; } catch (JSONException e) {
} returnString = null;
}
public static String getNowToken(String id,String secret) { }
String returnString = ""; return returnString;
String requestUrl=getNowTokenURL(id,secret); }
JSONObject jsonObject = JSONObject.fromObject(HttpUtil.httpRequestUrl( public static String getNowTokenURL(String id, String secret) {
requestUrl, "GET")); // Http GET请求 String mutiurl = "https://qyapi.weixin.qq.com/cgi-bin/gettoken?corpid=" + id + "&corpsecret=" + secret;
// 如果请求成功 return mutiurl;
if (null != jsonObject) { }
try {
returnString = jsonObject.getString("access_token"); public static void main(String[] args) {
} catch (JSONException e) { try {
returnString = null; JSONObject jsonObj = new WeiImageUpload().send("image", "C:/Users/Administrator/Desktop/pak/3.jpg", "wx4257809fde0f5986", "iTgSpAaEYejcyPBLlyikzx6kvSVuiMBxotfAkAdWAKo6nF8cefdJSTgLXqivXpZ7");
}
} System.out.println(jsonObj.getString("media_id"));
return returnString; System.out.println(jsonObj.getString("created_at"));
} }
public static String getNowTokenURL(String id,String secret){ catch (Exception e)
String mutiurl="https://qyapi.weixin.qq.com/cgi-bin/gettoken?corpid="+id+"&corpsecret="+secret; {
return mutiurl; e.printStackTrace();
} }
}
public static void main(String[] args) {
try { public static Map<String, String> weiUpload(String fileType, String filePath, String id, String secret)
JSONObject jsonObj=new WeiImageUpload().send("image","C:/Users/Administrator/Desktop/pak/3.jpg","wx4257809fde0f5986","iTgSpAaEYejcyPBLlyikzx6kvSVuiMBxotfAkAdWAKo6nF8cefdJSTgLXqivXpZ7"); {
Map map = new HashMap();
System.out.println(jsonObj.getString("media_id")); try {
System.out.println(jsonObj.getString("created_at")); JSONObject jsonObj = new WeiImageUpload().send(fileType, filePath, id, secret);
map.put("media_id", jsonObj.getString("media_id"));
map.put("created_at", jsonObj.getString("created_at"));
} catch (Exception e) { }
e.printStackTrace(); catch (Exception e) {
} e.printStackTrace();
}
} return map;
}
public static Map<String, String> weiUpload(String fileType, String filePath,String id,String secret){ }
Map<String, String> map=new HashMap<String, String>(); \ No newline at end of file
try {
JSONObject jsonObj=new WeiImageUpload().send(fileType,filePath,id,secret);
map.put("media_id", jsonObj.getString("media_id"));
map.put("created_at", jsonObj.getString("created_at"));
} catch (Exception e) {
e.printStackTrace();
}
return map;
}
}
package hls.plugin.weixin.qiye; package hls.plugin.weixin.qiye;
import hls.plugin.weixin.common.HttpUtil; import hls.plugin.weixin.common.HttpUtil;
import java.awt.RadialGradientPaint;
import java.io.BufferedInputStream; import java.io.BufferedInputStream;
import java.io.File; import java.io.File;
import java.io.FileOutputStream; import java.io.FileOutputStream;
...@@ -12,119 +9,114 @@ import java.net.HttpURLConnection; ...@@ -12,119 +9,114 @@ import java.net.HttpURLConnection;
import java.net.URL; import java.net.URL;
import java.util.HashMap; import java.util.HashMap;
import java.util.Map; import java.util.Map;
import java.util.Random;
import net.sf.json.JSONException; import net.sf.json.JSONException;
import net.sf.json.JSONObject; import net.sf.json.JSONObject;
public class WeixinDownload { public class WeixinDownload
static WeixinDownload weixinMedia = null; {
/** static WeixinDownload weixinMedia = null;
* 下载媒体文件:
* 获取媒体文件 public static String downloadMedia(String accessToken, String mediaId, String savePath, String imageName)
* @param accessToken 接口访问凭证 {
* @param media_id 媒体文件id String filePath = null;
* @param savePath 文件在服务器上的存储路径
* */ String filetype = "";
public static String downloadMedia(String accessToken, String mediaId, String savePath,String imageName) { HttpURLConnection conn = null;
String filePath = null; BufferedInputStream bis = null;
// 拼接请求地址 FileOutputStream fos = null;
String filetype=""; String requestUrl = "https://qyapi.weixin.qq.com/cgi-bin/media/get?access_token=ACCESS_TOKEN&media_id=MEDIA_ID";
HttpURLConnection conn=null; requestUrl = requestUrl.replace("ACCESS_TOKEN", accessToken).replace("MEDIA_ID", mediaId);
BufferedInputStream bis=null; try {
FileOutputStream fos=null; URL url = new URL(requestUrl);
String requestUrl = "https://qyapi.weixin.qq.com/cgi-bin/media/get?access_token=ACCESS_TOKEN&media_id=MEDIA_ID"; conn = (HttpURLConnection)url.openConnection();
requestUrl = requestUrl.replace("ACCESS_TOKEN", accessToken).replace("MEDIA_ID", mediaId); conn.setDoInput(true);
try { conn.setRequestMethod("GET");
URL url = new URL(requestUrl);
conn = (HttpURLConnection) url.openConnection(); if (!savePath.endsWith("/")) {
conn.setDoInput(true); savePath = savePath + "/";
conn.setRequestMethod("GET"); }
if (!savePath.endsWith("/")) { String fileExt = WeixinUtil.getTypeByStream(conn.getHeaderField("Content-Type"));
savePath += "/";
} filePath = savePath + imageName + "." + fileExt.substring(fileExt.indexOf("/") + 1);
// 根据内容类型获取扩展名 filetype = fileExt.substring(fileExt.indexOf("/") + 1);
String fileExt = WeixinUtil.getTypeByStream(conn.getHeaderField("Content-Type")); bis = new BufferedInputStream(conn.getInputStream());
// 将mediaId作为文件名 fos = new FileOutputStream(new File(filePath));
filePath = savePath + imageName +"."+fileExt.substring(fileExt.indexOf("/")+1); byte[] buf = new byte[1024];
filetype=fileExt.substring(fileExt.indexOf("/")+1); int size = 0;
bis = new BufferedInputStream(conn.getInputStream()); while ((size = bis.read(buf)) != -1)
fos = new FileOutputStream(new File(filePath)); fos.write(buf, 0, size);
byte[] buf = new byte[8096]; }
int size = 0; catch (Exception e) {
while ((size = bis.read(buf)) != -1) filePath = null;
fos.write(buf, 0, size); String error = String.format("ýļʧ", new Object[] { e });
e.printStackTrace();
} catch (Exception e) { } finally {
filePath = null; if (fos != null) {
String error = String.format("下载媒体文件失败:%s", e); try {
System.out.println(error); fos.close();
} finally{ } catch (IOException e) {
if(fos!=null){ e.printStackTrace();
try { }
fos.close(); }
} catch (IOException e) { if (bis != null) {
e.printStackTrace(); try {
} bis.close();
} } catch (IOException e) {
if(bis!=null){ e.printStackTrace();
try { }
bis.close(); }
} catch (IOException e) { if (conn != null) {
e.printStackTrace(); conn.disconnect();
} }
} }
if(conn!=null){ return filetype;
conn.disconnect(); }
} public static String getNowToken(String id, String secret) {
} String returnString = "";
return filetype; String requestUrl = getNowTokenURL(id, secret);
} JSONObject jsonObject = JSONObject.fromObject(HttpUtil.httpRequestUrl(
public static String getNowToken(String id,String secret) { requestUrl, "GET"));
String returnString = "";
String requestUrl=getNowTokenURL(id,secret); if (jsonObject != null) {
JSONObject jsonObject = JSONObject.fromObject(HttpUtil.httpRequestUrl( try {
requestUrl, "GET")); // Http GET请求 returnString = jsonObject.getString("access_token");
// 如果请求成功 } catch (JSONException e) {
if (null != jsonObject) { returnString = null;
try { }
returnString = jsonObject.getString("access_token"); }
} catch (JSONException e) { return returnString;
returnString = null; }
}
} public static String getNowTokenURL(String id, String secret) {
return returnString; String mutiurl = "https://qyapi.weixin.qq.com/cgi-bin/gettoken?corpid=" + id + "&corpsecret=" + secret;
} return mutiurl;
}
public static String getNowTokenURL(String id,String secret){ public static void main(String[] args) {
String mutiurl="https://qyapi.weixin.qq.com/cgi-bin/gettoken?corpid="+id+"&corpsecret="+secret; weiDownload("wx4257809fde0f5986", "iTgSpAaEYejcyPBLlyikzx6kvSVuiMBxotfAkAdWAKo6nF8cefdJSTgLXqivXpZ7", "1qyU7RGN3LHdsMrqCw7VrTc85wY-Q5Z3pEk_VJKcU9E3Nx_ukMH7ik2Vp_43EiMa6VyEjpNwtuEQ2ILqoe7F5cA", "G:/pad/");
return mutiurl; }
} private static String createImageName() {
public static void main(String[] args) { return (long)(Math.random()*10000000)+"";
weiDownload("wx4257809fde0f5986","iTgSpAaEYejcyPBLlyikzx6kvSVuiMBxotfAkAdWAKo6nF8cefdJSTgLXqivXpZ7","1qyU7RGN3LHdsMrqCw7VrTc85wY-Q5Z3pEk_VJKcU9E3Nx_ukMH7ik2Vp_43EiMa6VyEjpNwtuEQ2ILqoe7F5cA","G:/pad/"); // return Long.toString(System.currentTimeMillis() / 1000);
} }
private static String createImageName() {
return (long)(Math.random()*10000000)+""; public static Map<String, String> weiDownload(String id, String secret, String mediaId, String savePath) {
// return Long.toString(System.currentTimeMillis() / 1000); Map map = new HashMap();
} String accessToken = getNowToken(id, secret);
public static Map<String, String> weiDownload(String id,String secret, String mediaId, String savePath){ String imageName = createImageName();
Map<String, String> map=new HashMap<String, String>(); String filetype = downloadMedia(accessToken, mediaId, savePath, imageName);
String accessToken=getNowToken(id,secret); String fileSize=getFileSize(savePath,imageName,filetype)+"";
String imageName=createImageName(); map.put("fileName", imageName);
String filetype=downloadMedia(accessToken,mediaId,savePath,imageName); map.put("filetype", filetype);
String fileSize=getFileSize(savePath,imageName,filetype)+""; map.put("fileSize", fileSize);
map.put("fileName", imageName); return map;
map.put("filetype", filetype); }
map.put("fileSize", fileSize); public static long getFileSize(String savePath, String imageName, String filetype) {
return map; long fileSize = 0L;
} File file = new File(savePath + "/" + imageName + "." + filetype);
public static long getFileSize(String savePath,String imageName,String filetype){ if ((file.exists()) && (file.isFile())) {
long fileSize=0; fileSize = file.length() / 1024L;
File file=new File(savePath+"/"+imageName+"."+filetype); }
if (file.exists() && file.isFile()){ return fileSize;
fileSize=file.length()/1024; }
} }
return fileSize; \ No newline at end of file
}
}
package hls.plugin.weixin.qiye; package hls.plugin.weixin.qiye;
import hls.plugin.weixin.common.GetPropertiesValue; import hls.plugin.weixin.common.GetPropertiesValue;
import java.io.IOException; import java.io.IOException;
import java.io.PrintStream;
import java.io.PrintWriter; import java.io.PrintWriter;
import java.util.Map; import java.util.Map;
import javax.servlet.ServletException; import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
@SuppressWarnings("serial") public class WeixinServlet extends HttpServlet
public class WeixinServlet extends HttpServlet { {
@SuppressWarnings("static-access") protected void doGet(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException
/** {
* 获得mediaId进行下载到自己微信服务器, GetPropertiesValue gp = new GetPropertiesValue();
*/ System.out.println("11111");
protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { String mediaId = request.getParameter("mediaId");
GetPropertiesValue gp=new GetPropertiesValue(); String pck_id = request.getParameter("pck_id");
String mediaId=request.getParameter("mediaId"); String id = (String)gp.GetValue().get("appid");
String pck_id=request.getParameter("pck_id"); String secret = (String)gp.GetValue().get("secret");
String id=gp.GetValue().get("appid"); String winXinSavePath = (String)gp.GetValue().get("winXinSavePath");
String secret=gp.GetValue().get("secret"); String userId = request.getParameter("userId");
String winXinSavePath=gp.GetValue().get("winXinSavePath"); String tableName = request.getParameter("tableName");
String userId=request.getParameter("userId"); String table_pk_value = request.getParameter("table_pk_value");
String tableName=request.getParameter("tableName");
String table_pk_value=request.getParameter("table_pk_value"); new WeixinDownload(); Map map = WeixinDownload.weiDownload(id, secret, mediaId, winXinSavePath);
String fileName = (String)map.get("fileName");
String filetype = (String)map.get("filetype");
//下载 String fileSize = (String)map.get("fileSize");
Map<String,String> map=new WeixinDownload().weiDownload(id,secret,mediaId,winXinSavePath); try {
String fileName=map.get("fileName"); new WeiImagePostTo().send(mediaId, pck_id, fileName, filetype, fileSize, userId, tableName, table_pk_value);
String filetype=map.get("filetype"); } catch (Exception e) {
String fileSize=map.get("fileSize"); e.printStackTrace();
try { }
new WeiImagePostTo().send(mediaId, pck_id, fileName, filetype, fileSize,userId,tableName,table_pk_value);
} catch (Exception e) { PrintWriter pw = response.getWriter();
e.printStackTrace(); pw.println("OK!!");
} pw.flush();
//回执 pw.close();
PrintWriter pw = response.getWriter(); }
pw.println("OK!!");
pw.flush();
pw.close();
}
protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
doGet(request, response);
}
} protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
doGet(request, response);
}
}
\ No newline at end of file
package hls.plugin.weixin.qiye; package hls.plugin.weixin.qiye;
public class WeixinUtil
{
public class WeixinUtil { public static String getTypeByStream(String cot)
{
public static String getTypeByStream(String cot){ String type = cot.toUpperCase();
String type = cot.toUpperCase(); if (type.contains("FFD8FF"))
if(type.contains("FFD8FF")){ return "jpg";
return "jpg"; if (type.contains("89504E47"))
}else if(type.contains("89504E47")){ return "png";
return "png"; if (type.contains("47494638"))
}else if(type.contains("47494638")){ return "gif";
return "gif"; if (type.contains("49492A00"))
}else if(type.contains("49492A00")){ return "tif";
return "tif"; if (type.contains("424D")) {
}else if(type.contains("424D")){ return "bmp";
return "bmp"; }
} return type.toLowerCase();
return type.toLowerCase(); }
} }
} \ No newline at end of file
...@@ -8,50 +8,49 @@ import java.util.HashMap; ...@@ -8,50 +8,49 @@ import java.util.HashMap;
import java.util.Map; import java.util.Map;
import java.util.UUID; import java.util.UUID;
public class WxJSsign { public class WxJSsign
{
public static Map<String, String> sign(String jsapi_ticket, String url)
{
Map ret = new HashMap();
String nonce_str = create_nonce_str();
String timestamp = create_timestamp();
public static Map<String, String> sign(String jsapi_ticket,String url){ String signature = "";
Map<String, String> ret = new HashMap<String, String>();
String nonce_str = create_nonce_str(); String string1 = "jsapi_ticket=" + jsapi_ticket + "&noncestr=" + nonce_str + "&timestamp=" + timestamp + "&url=" + url;
String timestamp = create_timestamp(); try {
String string1; MessageDigest crypt = MessageDigest.getInstance("SHA-1");
String signature = ""; crypt.reset();
// 注意这里参数名必须全部小写,且必须有序 crypt.update(string1.getBytes("UTF-8"));
string1 = "jsapi_ticket=" + jsapi_ticket + "&noncestr=" + nonce_str + "&timestamp=" + timestamp + "&url=" + url; signature = byteToHex(crypt.digest());
try { } catch (NoSuchAlgorithmException e) {
MessageDigest crypt = MessageDigest.getInstance("SHA-1"); e.printStackTrace();
crypt.reset(); } catch (UnsupportedEncodingException e) {
crypt.update(string1.getBytes("UTF-8")); e.printStackTrace();
signature = byteToHex(crypt.digest()); }
} catch (NoSuchAlgorithmException e) { ret.put("url", url);
e.printStackTrace(); ret.put("jsapi_ticket", jsapi_ticket);
} catch (UnsupportedEncodingException e) { ret.put("nonceStr", nonce_str);
e.printStackTrace(); ret.put("timestamp", timestamp);
} ret.put("signature", signature);
ret.put("url", url); return ret;
ret.put("jsapi_ticket", jsapi_ticket); }
ret.put("nonceStr", nonce_str); private static String create_nonce_str() {
ret.put("timestamp", timestamp);
ret.put("signature", signature);
return ret;
}
private static String create_nonce_str() {
return UUID.randomUUID().toString(); return UUID.randomUUID().toString();
} }
private static String create_timestamp() {
return Long.toString(System.currentTimeMillis() / 1000L);
}
private static String create_timestamp() { private static String byteToHex(byte[] hash) {
return Long.toString(System.currentTimeMillis() / 1000);
}
private static String byteToHex(final byte[] hash) {
Formatter formatter = new Formatter(); Formatter formatter = new Formatter();
for (byte b : hash) { byte[] arrayOfByte = hash; int j = hash.length; for (int i = 0; i < j; i++) { byte b = arrayOfByte[i];
formatter.format("%02x", b); formatter.format("%02x", new Object[] { Byte.valueOf(b) });
} }
String result = formatter.toString(); String result = formatter.toString();
formatter.close(); formatter.close();
return result; return result;
} }
}
\ No newline at end of file
}
package hls.plugin.weixin.qiye; package hls.plugin.weixin.qiye;
import hls.plugin.weixin.common.GetPropertiesValue; import hls.plugin.weixin.common.GetPropertiesValue;
import java.io.FileOutputStream; import java.io.FileOutputStream;
import java.io.IOException; import java.io.IOException;
import java.io.InputStream; import java.io.InputStream;
import java.io.ObjectInputStream;
import java.io.OutputStream; import java.io.OutputStream;
import java.io.PrintWriter; import java.io.PrintStream;
import java.util.Map;
import javax.servlet.ServletException; import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
@SuppressWarnings("serial") public class ZuLinServlet extends HttpServlet
public class ZuLinServlet extends HttpServlet { {
@SuppressWarnings("static-access") protected void doGet(HttpServletRequest request, HttpServletResponse response)
/** throws ServletException, IOException
* 获得mediaId进行下载,并且保存参数到数据库 {
*/ doPost(request, response);
protected void doGet(HttpServletRequest request, }
HttpServletResponse response) throws ServletException, IOException {
doPost(request, response); protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException
} {
protected void doPost(HttpServletRequest request, InputStream in = null;
HttpServletResponse response) throws ServletException, IOException { OutputStream out = null;
//request.setCharacterEncoding("utf-8"); GetPropertiesValue gp = new GetPropertiesValue();
InputStream in=null;
OutputStream out=null; String pck_id = request.getParameter("pck_id");
GetPropertiesValue gp = new GetPropertiesValue(); String file_name = request.getParameter("fileName") + "." + request.getParameter("filetype");
//String mediaId = request.getParameter("mediaId"); String file_size = request.getParameter("fileSize");
String pck_id = request.getParameter("pck_id"); String userId = request.getParameter("userId");
String file_name = request.getParameter("fileName"); int userId2 = Integer.parseInt(userId);
String mime_type = request.getParameter("filetype"); String tableName = request.getParameter("tableName");
String file_size = request.getParameter("fileSize"); String table_pk_value = request.getParameter("table_pk_value");
String userId = request.getParameter("userId"); int file_size_int = Integer.parseInt(file_size);
int userId2 = Integer.parseInt(userId); String file_type_code = request.getParameter("filetype");
String tableName = request.getParameter("tableName"); String mime_type = (String)gp.GetValue().get("file_type_code") + "/" + request.getParameter("filetype");
String table_pk_value = request.getParameter("table_pk_value");
int file_size_int = Integer.parseInt(file_size);
String file_type_code =gp.GetValue().get("file_type_code");
System.out.println("file_type_code>>"+file_type_code);
System.out.println("file_size_int>>"+file_size_int);
System.out.println("table_pk_value>>"+table_pk_value);
System.out.println("tableName>>"+tableName);
System.out.println("file_size>>"+file_size);
System.out.println("mime_type>>"+mime_type);
System.out.println("file_name>>"+file_name);
String filepath = gp.GetValue().get(
"zuLinsavePath")
+ "/" + file_name+"."+mime_type;
System.out.println("filepath>>>"+filepath);
try {
in =request.getInputStream();
out = new FileOutputStream(filepath);
int bytes = -1;
byte[] bufferOut = new byte[1024];
while ((bytes = in.read(bufferOut)) != -1) {
out.write(bufferOut, 0, bytes);
}
} catch (Exception e) {
e.printStackTrace();
}finally{
if(in!=null){
in.close();
}
if(out!=null){
out.flush();
out.close();
}
}
// 保存数据到数据库 String filepath =
FndAtmAttachment fnd = new FndAtmAttachment(table_pk_value,file_type_code,mime_type,file_name,file_size_int,filepath,userId2,tableName,pck_id); (String)gp.GetValue()
boolean ss =new WeCatDaoImpl().save(fnd); .get("zuLinsavePath") +
System.out.println(ss); "/" + file_name;
System.out.println("filepath>>>" + filepath);
try {
in = request.getInputStream();
out = new FileOutputStream(filepath);
int bytes = -1;
byte[] bufferOut = new byte[1024];
while ((bytes = in.read(bufferOut)) != -1)
out.write(bufferOut, 0, bytes);
}
catch (Exception e) {
e.printStackTrace();
} finally {
if (in != null) {
in.close();
}
if (out != null) {
out.flush();
out.close();
}
} }
} FndAtmAttachment fnd = new FndAtmAttachment(table_pk_value, file_type_code, mime_type, file_name, file_size_int, filepath, userId2, tableName, pck_id);
boolean ss = new WeCatDaoImpl().save(fnd);
System.out.println(ss);
}
}
\ No newline at end of file
\u8D26\u53F7
appid=wx4257809fde0f5986
\u5BC6\u7801
secret=lyJAj3vUqDg2BJp4Yc2ZLq9qwCX1rOXKV8OHSTD7JqY
\u5FAE\u4FE1\u670D\u52A1\u5668\u4FDD\u5B58\u5730\u5740
weiXinSavePath=/u01/web/JUNCHUANG_WX/attachment
\u79DF\u8D41\u4FDD\u5B58\u5730\u5740
zuLinsavePath=/u01/web/JUNCHUANG_WX/attachment
\u5FAE\u4FE1\u670D\u52A1\u5668\u8BF7\u6C42\u5730\u5740
weixinserviceUrl=http://172.20.0.115:5371/junchuang_wx/WeixinServlet
file_type_code=image
\u79DF\u8D41\u8BF7\u6C42\u5730\u5740
zuLinserviceUrl=http://172.20.0.115:5371/junchuang_wx/ZuLinServlet
\ No newline at end of file
oracleDriver=oracle.jdbc.driver.OracleDriver oracleDriver=oracle.jdbc.driver.OracleDriver
url=jdbc:oracle:thin:@10.0.36.97:1521:hls url=jdbc:oracle:thin:@172.20.0.115:1521:hls
# url=jdbc:oracle:thin:@172.20.0.115:1521:hls username=jc_hls
username=hls_standard password=jc_hls
password=hls_standard \ No newline at end of file
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment